--- .gitignore | 1 + Makefile.am | 44 ++++++- src/test/test-enabled.c | 143 +++++++++++++++++++++ .../etc/systemd/system/masked.service | 1 + .../etc/systemd/system/maskedstatic.service | 1 + .../etc/systemd/system/some.target | 15 +++ .../system/some.target.wants/aliased.service | 1 + .../system/some.target.wants/also_masked.service | 1 + .../system/some.target.wants/another.service | 1 + .../system/some.target.wants/different.service | 1 + .../system/some.target.wants/masked.service | 1 + .../some.target.wants/templating@four.service | 1 + .../some.target.wants/templating@one.service | 1 + .../some.target.wants/templating@three.service | 1 + .../some.target.wants/templating@two.service | 1 + .../run/systemd/system/maskedruntime.service | 1 + .../run/systemd/system/maskedruntimestatic.service | 1 + .../run/systemd/system/other.target | 15 +++ .../system/other.target.wants/runtime.service | 1 + .../usr/lib/systemd/system/another.service | 12 ++ .../usr/lib/systemd/system/disabled.service | 12 ++ .../usr/lib/systemd/system/invalid.service | 1 + .../usr/lib/systemd/system/masked.service | 12 ++ .../usr/lib/systemd/system/maskedruntime.service | 12 ++ .../lib/systemd/system/maskedruntimestatic.service | 9 ++ .../usr/lib/systemd/system/maskedstatic.service | 9 ++ .../usr/lib/systemd/system/runtime.service | 12 ++ .../usr/lib/systemd/system/static.service | 9 ++ .../usr/lib/systemd/system/templating@.service | 12 ++ .../lib/systemd/system/templating@three.service | 12 ++ .../usr/lib/systemd/system/templating@two.service | 12 ++ .../usr/lib/systemd/system/unique.service | 12 ++ 32 files changed, 365 insertions(+), 3 deletions(-) create mode 100644 src/test/test-enabled.c create mode 120000 test/test-enabled-root/etc/systemd/system/masked.service create mode 120000 test/test-enabled-root/etc/systemd/system/maskedstatic.service create mode 100644 test/test-enabled-root/etc/systemd/system/some.target create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/aliased.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/also_masked.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/another.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/different.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/masked.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/templating@four.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/templating@one.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/templating@three.service create mode 120000 test/test-enabled-root/etc/systemd/system/some.target.wants/templating@two.service create mode 120000 test/test-enabled-root/run/systemd/system/maskedruntime.service create mode 120000 test/test-enabled-root/run/systemd/system/maskedruntimestatic.service create mode 100644 test/test-enabled-root/run/systemd/system/other.target create mode 120000 test/test-enabled-root/run/systemd/system/other.target.wants/runtime.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/another.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/disabled.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/invalid.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/masked.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/maskedruntime.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/maskedruntimestatic.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/maskedstatic.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/runtime.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/static.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/templating@.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/templating@three.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/templating@two.service create mode 100644 test/test-enabled-root/usr/lib/systemd/system/unique.service
diff --git a/.gitignore b/.gitignore index f119b57..97b2b2b 100644 --- a/.gitignore +++ b/.gitignore @@ -173,6 +173,7 @@ /test-icmp6-rs /test-ellipsize /test-engine +/test-enabled /test-env-replace /test-event /test-fdset diff --git a/Makefile.am b/Makefile.am index 60011b7..3d782fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1355,7 +1355,8 @@ tests += \ test-ratelimit \ test-condition-util \ test-uid-range \ - test-bus-policy + test-bus-policy \ + test-enabled EXTRA_DIST += \ test/a.service \ @@ -1391,8 +1392,36 @@ EXTRA_DIST += \ test/bus-policy/hello.conf \ test/bus-policy/methods.conf \ test/bus-policy/ownerships.conf \ - test/bus-policy/signals.conf - + test/bus-policy/signals.conf \ + test/test-enabled-root/usr/lib/systemd/system/masked.service \ + test/test-enabled-root/usr/lib/systemd/system/runtime.service \ + test/test-enabled-root/usr/lib/systemd/system/maskedruntime.service \ + test/test-enabled-root/usr/lib/systemd/system/another.service \ + test/test-enabled-root/usr/lib/systemd/system/templating@three.service \ + test/test-enabled-root/usr/lib/systemd/system/maskedstatic.service \ + test/test-enabled-root/usr/lib/systemd/system/invalid.service \ + test/test-enabled-root/usr/lib/systemd/system/disabled.service \ + test/test-enabled-root/usr/lib/systemd/system/templating@two.service \ + test/test-enabled-root/usr/lib/systemd/system/unique.service \ + test/test-enabled-root/usr/lib/systemd/system/templating@.service \ + test/test-enabled-root/usr/lib/systemd/system/static.service \ + test/test-enabled-root/usr/lib/systemd/system/maskedruntimestatic.service \ + test/test-enabled-root/run/systemd/system/other.target.wants/runtime.service \ + test/test-enabled-root/run/systemd/system/maskedruntime.service \ + test/test-enabled-root/run/systemd/system/other.target \ + test/test-enabled-root/run/systemd/system/maskedruntimestatic.service \ + test/test-enabled-root/etc/systemd/system/masked.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/masked.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/another.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/templating@three.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/templating@one.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/templating@two.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/templating@four.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/also_masked.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/different.service \ + test/test-enabled-root/etc/systemd/system/some.target.wants/aliased.service \ + test/test-enabled-root/etc/systemd/system/maskedstatic.service \ + test/test-enabled-root/etc/systemd/system/some.target EXTRA_DIST += \ src/test/test-helper.h @@ -1779,6 +1808,15 @@ test_install_LDADD = \ libsystemd-shared.la \ libsystemd-internal.la +test_enabled_SOURCES = \ + src/test/test-enabled.c + +test_enabled_LDADD = \ + libsystemd-units.la \ + libsystemd-label.la \ + libsystemd-shared.la \ + libsystemd-internal.la + test_watchdog_SOURCES = \ src/test/test-watchdog.c diff --git a/src/test/test-enabled.c b/src/test/test-enabled.c new file mode 100644 index 0000000..607f68c --- /dev/null +++ b/src/test/test-enabled.c @@ -0,0 +1,143 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Pantheon, Inc. + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see <http://www.gnu.org/licenses/>. +***/ + +#include <errno.h> +#include <string.h> +#include <stdio.h> +#include <fcntl.h> + +#include "util.h" +#include "path-util.h" +#include "unit-name.h" +#include "install.h" + +/* +. +├── etc +│ └── systemd +│ └── system +│ ├── masked.service -> /dev/null +│ ├── maskedstatic.service -> /dev/null +│ ├── some.target +│ └── some.target.wants +│ ├── another.service -> ../../../../usr/lib/systemd/system/another.service +│ ├── aliased.service -> ../../../../usr/lib/systemd/system/another.service +│ ├── different.service -> ../../../../usr/lib/systemd/system/unique.service +│ ├── masked.service -> ../../../../usr/lib/systemd/system/masked.service +│ ├── also_masked.service -> ../../../../usr/lib/systemd/system/masked.service +│ ├── templating@one.service -> ../../../../usr/lib/systemd/system/templating@.service +│ ├── templating@two.service -> ../../../../usr/lib/systemd/system/templating@two.service +│ ├── templating@three.service -> ../../../../usr/lib/systemd/system/templating@.service +│ └── templating@four.service -> ../../../../usr/lib/systemd/system/templating@four.service +├── run +│ └── systemd +│ └── system +│ ├── maskedruntime.service -> /dev/null +│ ├── maskedruntimestatic.service -> /dev/null +│ ├── other.target +│ └── other.target.wants +│ └── runtime.service -> ../../../../usr/lib/systemd/system/runtime.service +└── usr + └── lib + └── systemd + └── system + ├── invalid.service + ├── disabled.service + ├── another.service + ├── runtime.service + ├── masked.service + ├── maskedruntime.service + ├── static.service + ├── maskedstatic.service + ├── maskedruntimestatic.service + ├── templating@.service + ├── templating@two.service + ├── templating@three.service + └── unique.service +*/ + + +const char *subdir = "/test-enabled-root"; +char root_dir[UNIT_NAME_MAX + 2 + 1] = TEST_DIR; + +#define confirm_unit_state(unit, expected) \ + assert_se(unit_file_get_state(UNIT_FILE_SYSTEM, root_dir, unit) == expected) + +static void test_enabled(int argc, char* argv[]) { + Hashmap *h; + UnitFileList *p; + Iterator i; + int r; + + strncat(root_dir, subdir, strlen(subdir)); + + confirm_unit_state("nonexistent.service", -ENOENT); + confirm_unit_state("invalid.service", -EBADMSG); + confirm_unit_state("disabled.service", UNIT_FILE_DISABLED); + confirm_unit_state("another.service", UNIT_FILE_ENABLED); + confirm_unit_state("runtime.service", UNIT_FILE_ENABLED_RUNTIME); + confirm_unit_state("masked.service", UNIT_FILE_MASKED); + confirm_unit_state("maskedruntime.service", UNIT_FILE_MASKED_RUNTIME); + confirm_unit_state("static.service", UNIT_FILE_STATIC); + confirm_unit_state("maskedstatic.service", UNIT_FILE_MASKED); + confirm_unit_state("maskedruntimestatic.service", UNIT_FILE_MASKED_RUNTIME); + confirm_unit_state("templating@.service", UNIT_FILE_ENABLED); + confirm_unit_state("templating@two.service", UNIT_FILE_ENABLED); + confirm_unit_state("templating@three.service", UNIT_FILE_ENABLED); + confirm_unit_state("unique.service", UNIT_FILE_ENABLED); + + h = hashmap_new(&string_hash_ops); + r = unit_file_get_list(UNIT_FILE_SYSTEM, root_dir, h); + assert_se(r >= 0); + + HASHMAP_FOREACH(p, h, i) { + UnitFileState s; + + s = unit_file_get_state(UNIT_FILE_SYSTEM, root_dir, + basename(p->path)); + + /* unit_file_get_list and unit_file_get_state are + * a little different in some cases. Handle these + * cases here ... + */ + switch ((int)s) { + case UNIT_FILE_ENABLED_RUNTIME: + assert_se(p->state == UNIT_FILE_ENABLED); + break; + case -EBADMSG: + assert_se(p->state == UNIT_FILE_INVALID); + break; + default: + assert_se(p->state == s); + break; + } + + fprintf(stderr, "%s (%s)\n", + p->path, + unit_file_state_to_string(p->state)); + } + unit_file_list_free(h); +} + +int main(int argc, char* argv[]) { + test_enabled(argc, argv); + return 0; +} diff --git a/test/test-enabled-root/etc/systemd/system/masked.service b/test/test-enabled-root/etc/systemd/system/masked.service new file mode 120000 index 0000000..dc1dc0c --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/masked.service @@ -0,0 +1 @@ +/dev/null \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/maskedstatic.service b/test/test-enabled-root/etc/systemd/system/maskedstatic.service new file mode 120000 index 0000000..dc1dc0c --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/maskedstatic.service @@ -0,0 +1 @@ +/dev/null \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target b/test/test-enabled-root/etc/systemd/system/some.target new file mode 100644 index 0000000..a2c4532 --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target @@ -0,0 +1,15 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +After=multi-user.target +Conflicts=rescue.target +Wants=display-manager.service +AllowIsolate=yes diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/aliased.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/aliased.service new file mode 120000 index 0000000..fec3d43 --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/aliased.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/another.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/also_masked.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/also_masked.service new file mode 120000 index 0000000..322a87b --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/also_masked.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/masked.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/another.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/another.service new file mode 120000 index 0000000..fec3d43 --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/another.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/another.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/different.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/different.service new file mode 120000 index 0000000..40b36c8 --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/different.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/unique.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/masked.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/masked.service new file mode 120000 index 0000000..322a87b --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/masked.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/masked.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@four.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@four.service new file mode 120000 index 0000000..7ccde6b --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@four.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/templating@four.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@one.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@one.service new file mode 120000 index 0000000..16f781d --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@one.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/templating@.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@three.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@three.service new file mode 120000 index 0000000..16f781d --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@three.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/templating@.service \ No newline at end of file diff --git a/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@two.service b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@two.service new file mode 120000 index 0000000..ee2c510 --- /dev/null +++ b/test/test-enabled-root/etc/systemd/system/some.target.wants/templating@two.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/templating@two.service \ No newline at end of file diff --git a/test/test-enabled-root/run/systemd/system/maskedruntime.service b/test/test-enabled-root/run/systemd/system/maskedruntime.service new file mode 120000 index 0000000..dc1dc0c --- /dev/null +++ b/test/test-enabled-root/run/systemd/system/maskedruntime.service @@ -0,0 +1 @@ +/dev/null \ No newline at end of file diff --git a/test/test-enabled-root/run/systemd/system/maskedruntimestatic.service b/test/test-enabled-root/run/systemd/system/maskedruntimestatic.service new file mode 120000 index 0000000..dc1dc0c --- /dev/null +++ b/test/test-enabled-root/run/systemd/system/maskedruntimestatic.service @@ -0,0 +1 @@ +/dev/null \ No newline at end of file diff --git a/test/test-enabled-root/run/systemd/system/other.target b/test/test-enabled-root/run/systemd/system/other.target new file mode 100644 index 0000000..a2c4532 --- /dev/null +++ b/test/test-enabled-root/run/systemd/system/other.target @@ -0,0 +1,15 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +After=multi-user.target +Conflicts=rescue.target +Wants=display-manager.service +AllowIsolate=yes diff --git a/test/test-enabled-root/run/systemd/system/other.target.wants/runtime.service b/test/test-enabled-root/run/systemd/system/other.target.wants/runtime.service new file mode 120000 index 0000000..a28ebda --- /dev/null +++ b/test/test-enabled-root/run/systemd/system/other.target.wants/runtime.service @@ -0,0 +1 @@ +../../../../usr/lib/systemd/system/runtime.service \ No newline at end of file diff --git a/test/test-enabled-root/usr/lib/systemd/system/another.service b/test/test-enabled-root/usr/lib/systemd/system/another.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/another.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/disabled.service b/test/test-enabled-root/usr/lib/systemd/system/disabled.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/disabled.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/invalid.service b/test/test-enabled-root/usr/lib/systemd/system/invalid.service new file mode 100644 index 0000000..e420fe4 --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/invalid.service @@ -0,0 +1 @@ +INVALID diff --git a/test/test-enabled-root/usr/lib/systemd/system/masked.service b/test/test-enabled-root/usr/lib/systemd/system/masked.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/masked.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/maskedruntime.service b/test/test-enabled-root/usr/lib/systemd/system/maskedruntime.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/maskedruntime.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/maskedruntimestatic.service b/test/test-enabled-root/usr/lib/systemd/system/maskedruntimestatic.service new file mode 100644 index 0000000..0fcfc12 --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/maskedruntimestatic.service @@ -0,0 +1,9 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes diff --git a/test/test-enabled-root/usr/lib/systemd/system/maskedstatic.service b/test/test-enabled-root/usr/lib/systemd/system/maskedstatic.service new file mode 100644 index 0000000..0fcfc12 --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/maskedstatic.service @@ -0,0 +1,9 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes diff --git a/test/test-enabled-root/usr/lib/systemd/system/runtime.service b/test/test-enabled-root/usr/lib/systemd/system/runtime.service new file mode 100644 index 0000000..5fcdd66 --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/runtime.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=other.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/static.service b/test/test-enabled-root/usr/lib/systemd/system/static.service new file mode 100644 index 0000000..0fcfc12 --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/static.service @@ -0,0 +1,9 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes diff --git a/test/test-enabled-root/usr/lib/systemd/system/templating@.service b/test/test-enabled-root/usr/lib/systemd/system/templating@.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/templating@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/templating@three.service b/test/test-enabled-root/usr/lib/systemd/system/templating@three.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/templating@three.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/templating@two.service b/test/test-enabled-root/usr/lib/systemd/system/templating@two.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/templating@two.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target diff --git a/test/test-enabled-root/usr/lib/systemd/system/unique.service b/test/test-enabled-root/usr/lib/systemd/system/unique.service new file mode 100644 index 0000000..669548a --- /dev/null +++ b/test/test-enabled-root/usr/lib/systemd/system/unique.service @@ -0,0 +1,12 @@ +[Unit] +Description=Crash recovery kernel arming +After=network.target network-online.target remote-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/kdumpctl start +ExecStop=/usr/bin/kdumpctl stop +RemainAfterExit=yes + +[Install] +WantedBy=some.target -- 1.9.3 _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel