Hi, patch 0001 and 0002 add preliminary Debian support to systemd. patch 0003 fixes a small typo.
The fsck.target file is currently empy. In Debian we use two separate init scripts during boot for the fsck task: /etc/init.d/checkroot.sh and /etc/init.d/checkfs.sh. I'm wondering if they should be hooked up in fsck.target or not. Regarding umount: Debian uses separate init scripts during shutdown, to unmount the file systems (afaik fedora does the unmount in the reboot resp. halt init script) /etc/init.d/umountnfs.sh (don't ask me, why this script has a sh extension, but not the other two) /etc/init.d/umountfs /etc/init.d/umountroot Those scripts are not run during shutdown/reboot, as systemd only stop services which are running (I hope I understood that correctly). I thus created separate service files called umountfs.service, umountnfs.service and umountroot.service. I've installed them to /lib/systemd/system, and symlinked them to /lib/systemd/system/umount.target.wants (I did not choose /etc for that as I don't think this should be configurable). If this is considered the correct approach to umount the file systems (on Debian), I'll post a patch for that too. Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
From 5ead9f74145610e2284523379cf66249b56f93f4 Mon Sep 17 00:00:00 2001 From: Michael Biebl <bi...@debian.org> Date: Fri, 3 Sep 2010 15:16:35 +0200 Subject: [PATCH 1/3] Add halt, killall, poweroff and reboot unit files for Debian --- Makefile.am | 8 ++++++++ units/debian/halt.service | 19 +++++++++++++++++++ units/debian/killall.service | 18 ++++++++++++++++++ units/debian/poweroff.service | 19 +++++++++++++++++++ units/debian/reboot.service | 19 +++++++++++++++++++ 5 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 units/debian/halt.service create mode 100644 units/debian/killall.service create mode 100644 units/debian/poweroff.service create mode 100644 units/debian/reboot.service diff --git a/Makefile.am b/Makefile.am index d93442a..ee8ff40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -230,6 +230,14 @@ dist_systemunit_DATA += \ units/fedora/plymouth-halt.service endif +if TARGET_DEBIAN +dist_systemunit_DATA += \ + units/debian/halt.service \ + units/debian/killall.service \ + units/debian/poweroff.service \ + units/debian/reboot.service +endif + if TARGET_SUSE dist_systemunit_DATA += \ units/suse/halt.service \ diff --git a/units/debian/halt.service b/units/debian/halt.service new file mode 100644 index 0000000..96061be --- /dev/null +++ b/units/debian/halt.service @@ -0,0 +1,19 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Halt +DefaultDependencies=no +Requires=shutdown.target umount.target killall.service +After=shutdown.target umount.target killall.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Environment=INIT_HALT=HALT RUNLEVEL=0 +ExecStart=/etc/init.d/halt stop +StandardOutput=tty diff --git a/units/debian/killall.service b/units/debian/killall.service new file mode 100644 index 0000000..b7ed11a --- /dev/null +++ b/units/debian/killall.service @@ -0,0 +1,18 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Kill All Processes +DefaultDependencies=no +After=shutdown.target +RefuseManualStart=yes + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/etc/init.d/sendsigs stop +StandardOutput=tty diff --git a/units/debian/poweroff.service b/units/debian/poweroff.service new file mode 100644 index 0000000..34a6683 --- /dev/null +++ b/units/debian/poweroff.service @@ -0,0 +1,19 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Power-Off +DefaultDependencies=no +Requires=shutdown.target umount.target killall.service +After=shutdown.target umount.target killall.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Environment=RUNLEVEL=0 +ExecStart=/etc/init.d/halt stop +StandardOutput=tty diff --git a/units/debian/reboot.service b/units/debian/reboot.service new file mode 100644 index 0000000..99f259e --- /dev/null +++ b/units/debian/reboot.service @@ -0,0 +1,19 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Reboot +DefaultDependencies=no +Requires=shutdown.target umount.target killall.service +After=shutdown.target umount.target killall.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Environment=RUNLEVEL=6 +ExecStart=/etc/init.d/reboot stop +StandardOutput=tty -- 1.7.1
From 6ffdfb2e2f14ccb8cb6da8bfd44e57711ddfd469 Mon Sep 17 00:00:00 2001 From: Michael Biebl <bi...@debian.org> Date: Fri, 3 Sep 2010 16:23:05 +0200 Subject: [PATCH 2/3] Provide separate fsck.target for Debian On Debian sysinit is not a single script but a separate runlevel. Split of fsck.target into separate unit file as otherwise we get an unbreakable cycle on shutdown/reboot. --- Makefile.am | 5 ++++- units/debian/fsck.target | 11 +++++++++++ units/sysinit.target.m4 | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 units/debian/fsck.target diff --git a/Makefile.am b/Makefile.am index ee8ff40..944b871 100644 --- a/Makefile.am +++ b/Makefile.am @@ -235,7 +235,8 @@ dist_systemunit_DATA += \ units/debian/halt.service \ units/debian/killall.service \ units/debian/poweroff.service \ - units/debian/reboot.service + units/debian/reboot.service \ + units/debian/fsck.target endif if TARGET_SUSE @@ -961,10 +962,12 @@ if TARGET_GENTOO $(LN_S) $(systemunitdir)/xdm.service xdm.service ) endif if !TARGET_SUSE +if !TARGET_DEBIAN ( cd $(DESTDIR)$(systemunitdir) && \ rm -f fsck.target && \ $(LN_S) sysinit.target fsck.target ) endif +endif DISTCHECK_CONFIGURE_FLAGS = \ --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \ diff --git a/units/debian/fsck.target b/units/debian/fsck.target new file mode 100644 index 0000000..5da9a4f --- /dev/null +++ b/units/debian/fsck.target @@ -0,0 +1,11 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# See systemd.special(7) for details + +[Unit] +Description=File System Check diff --git a/units/sysinit.target.m4 b/units/sysinit.target.m4 index 029bb3c..e8d4d72 100644 --- a/units/sysinit.target.m4 +++ b/units/sysinit.target.m4 @@ -24,6 +24,8 @@ Requires=sysinit.service After=sysinit.service )m4_dnl m4_ifdef(`TARGET_SUSE',`', -m4_dnl On Suse, fsck.target is seperate, everywhere else it is just an alias for sysinit.target +m4_ifdef(`TARGET_DEBIAN',`', +m4_dnl On Suse and Debian fsck.target is separate, everywhere else it is just an alias for sysinit.target Names=fsck.target )m4_dnl +)m4_dnl -- 1.7.1
From 10eb4ba3b2fd1c6dcd327c07f6eeae6e23a30667 Mon Sep 17 00:00:00 2001 From: Michael Biebl <bi...@debian.org> Date: Fri, 3 Sep 2010 16:30:48 +0200 Subject: [PATCH 3/3] Fix small typo: s/seperate/separate/ --- man/runlevel.xml | 2 +- man/sd_notify.xml | 2 +- man/systemctl.xml | 2 +- man/systemd.conf.xml | 2 +- man/systemd.exec.xml | 16 ++++++++-------- man/systemd.mount.xml | 2 +- man/systemd.service.xml | 4 ++-- src/initreq.h | 2 +- src/logger.c | 2 +- src/sd-daemon.h | 2 +- src/test-job-type.c | 2 +- src/unit.h | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/man/runlevel.xml b/man/runlevel.xml index 51bc3ed..160d1b1 100644 --- a/man/runlevel.xml +++ b/man/runlevel.xml @@ -59,7 +59,7 @@ <para><command>runlevel</command> prints the previous and current SysV runlevel if they are known.</para> - <para>The two runlevel characters are seperated by a + <para>The two runlevel characters are separated by a single space character. If a runlevel cannot be determined, N is printed instead. If neither can be determined, the word "unknown" is printed.</para> diff --git a/man/sd_notify.xml b/man/sd_notify.xml index 7c1d982..c060bba 100644 --- a/man/sd_notify.xml +++ b/man/sd_notify.xml @@ -87,7 +87,7 @@ processes.</para> <para>The <parameter>state</parameter> parameter - should contain an newline-seperated list of variable + should contain an newline-separated list of variable assignments, similar in style to an environment block. A trailing newline is implied if none is specified. The string may contain any kind of variable diff --git a/man/systemctl.xml b/man/systemctl.xml index 88bc48f..2eb153e 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -445,7 +445,7 @@ does not have the effect that any of the units enabled are also started at the same time. If this is desired a - seperate <command>start</command> + separate <command>start</command> command must be invoked for the unit.</para> diff --git a/man/systemd.conf.xml b/man/systemd.conf.xml index 95a2e52..399cae0 100644 --- a/man/systemd.conf.xml +++ b/man/systemd.conf.xml @@ -96,7 +96,7 @@ <listitem><para>Configures the initial CPU affinity for the init - process. Takes a space-seperated list + process. Takes a space-separated list of CPU indexes.</para></listitem> </varlistentry> </variablelist> diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index c71d429..38b9e06 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -122,7 +122,7 @@ <listitem><para>Sets the supplementary Unix groups the processes are executed - as. This takes a space seperated list + as. This takes a space separated list of group names or IDs. This option may be specified more than once in which case all listed groups are set as @@ -234,7 +234,7 @@ <listitem><para>Controls the CPU affinity of the executed - processes. Takes a space-seperated + processes. Takes a space-separated list of CPU indexes. See <citerefentry><refentrytitle>sched_setaffinity</refentrytitle><manvolnum>2</manvolnum></citerefentry> for details.</para></listitem> @@ -256,7 +256,7 @@ <listitem><para>Sets environment variables for executed - processes. Takes a space-seperated + processes. Takes a space-separated list of variable assignments. This option may be specified more than once in which case all listed variables @@ -272,7 +272,7 @@ <varname>Environment=</varname> but reads the environment variables from a text file. The text file should - contain new-line seperated variable + contain new-line separated variable assignments. Empty lines and lines starting with ; or # will be ignored, which may be used for @@ -618,7 +618,7 @@ <listitem><para>Controls the control groups the executed processes shall be made members of. Takes a - space-seperated list of cgroup + space-separated list of cgroup identifiers. A cgroup identifier has a format like <filename>cpu:/foo/bar</filename>, @@ -637,7 +637,7 @@ arbitrary hierachies -- which can be configured externally with additional execution limits. By default systemd will place all executed - processes in seperate per-unit control + processes in separate per-unit control groups (named after the unit) in the systemd named hierarchy. Since every process can be in one group per @@ -660,7 +660,7 @@ to limit access a process might have to the main file-system hierarchy. Each setting takes a - space-seperated list of absolute + space-separated list of absolute directory paths. Directories listed in <varname>ReadWriteDirectories=</varname> are accessible from within the @@ -677,7 +677,7 @@ restricting access with these options does not extend to submounts of a directory. You must list submounts - seperately in these setttings to + separately in these setttings to ensure the same limited access. These options may be specified more than once in which case all directories diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml index 70170bb..323f232 100644 --- a/man/systemd.mount.xml +++ b/man/systemd.mount.xml @@ -180,7 +180,7 @@ <listitem><para>Mount options to use when mounting. This takes a comma - seperated list of options. This + separated list of options. This setting is optional.</para></listitem> </varlistentry> diff --git a/man/systemd.service.xml b/man/systemd.service.xml index c0fc9a9..d6c0e3f 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -290,7 +290,7 @@ by the string value of the environment variable of the same name. Also <literal>$FOO</literal> may appear as - seperate word on the command line in + separate word on the command line in which case the variable is replaced by its value split at whitespaces.</para></listitem> @@ -306,7 +306,7 @@ command lines may be concatenated in a single directive, by seperating them by semicolons (these semicolons must - be passed as seperate words). In that + be passed as separate words). In that case, the commands are executed one after the other, serially. Alternatively, these diff --git a/src/initreq.h b/src/initreq.h index 6f6547b..859042c 100644 --- a/src/initreq.h +++ b/src/initreq.h @@ -58,7 +58,7 @@ struct init_request_bsd { /* * Because of legacy interfaces, "runlevel" and "sleeptime" - * aren't in a seperate struct in the union. + * aren't in a separate struct in the union. * * The weird sizes are because init expects the whole * struct to be 384 bytes. diff --git a/src/logger.c b/src/logger.c index a590bb8..03a8ae8 100644 --- a/src/logger.c +++ b/src/logger.c @@ -514,7 +514,7 @@ static int process_event(Server *s, struct epoll_event *ev) { /* Yes, this is a bit ugly, we assume that that valid pointers * are > SD_LISTEN_FDS_START+SERVER_FD_MAX. Which is certainly * true on Linux (and probably most other OSes, too, since the - * first 4k usually are part of a seperate null pointer + * first 4k usually are part of a separate null pointer * dereference page. */ if (PTR_TO_INT(ev->data.ptr) >= SD_LISTEN_FDS_START && diff --git a/src/sd-daemon.h b/src/sd-daemon.h index c68c96d..3474213 100644 --- a/src/sd-daemon.h +++ b/src/sd-daemon.h @@ -171,7 +171,7 @@ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t /* Informs systemd about changed daemon state. This takes a number of - newline seperated environment-style variable assignments in a + newline separated environment-style variable assignments in a string. The following variables are known: READY=1 Tells systemd that daemon startup is finished (only diff --git a/src/test-job-type.c b/src/test-job-type.c index 29bb9e4..9e2fc35 100644 --- a/src/test-job-type.c +++ b/src/test-job-type.c @@ -50,7 +50,7 @@ int main(int argc, char*argv[]) { /* Verify that merged entries can be * merged with the same entries they - * can be merged with seperately */ + * can be merged with separately */ assert(!job_type_is_mergeable(a, c) || job_type_is_mergeable(d, c)); assert(!job_type_is_mergeable(b, c) || job_type_is_mergeable(d, c)); diff --git a/src/unit.h b/src/unit.h index c85d968..c93f3f7 100644 --- a/src/unit.h +++ b/src/unit.h @@ -338,7 +338,7 @@ struct UnitVTable { void (*shutdown)(Manager *m); /* When sending out PropertiesChanged signal, which properties - * shall be invalidated? This is a NUL seperated list of + * shall be invalidated? This is a NUL separated list of * strings, to minimize relocations a little. */ const char *bus_invalidating_properties; -- 1.7.1
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel