[systemd-commits] 3 commits - configure.ac Makefile.am src/service.c units/fedora units/gentoo units/getty at .service.m4 units/graphical.target.m4 units/multi-user.target.m4

Lennart Poettering lennart at kemper.freedesktop.org
Thu May 20 09:28:34 PDT 2010


 Makefile.am                   |    9 +++++++++
 configure.ac                  |    2 +-
 src/service.c                 |    4 ++--
 units/fedora/prefdm.service   |    1 +
 units/fedora/rc-local.service |    1 +
 units/gentoo/halt.service     |   19 +++++++++++++++++++
 units/gentoo/killall.service  |   15 +++++++++++++++
 units/gentoo/poweroff.service |   18 ++++++++++++++++++
 units/gentoo/reboot.service   |   18 ++++++++++++++++++
 units/gentoo/xdm.service      |   16 ++++++++++++++++
 units/getty at .service.m4       |    1 +
 units/graphical.target.m4     |    3 +++
 units/multi-user.target.m4    |    3 +++
 13 files changed, 107 insertions(+), 3 deletions(-)

New commits:
commit 78c390dee163db80ed903c3d830e7115409f5f34
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu May 20 18:18:06 2010 +0200

    fedora: make sure both prefdm and rc-local depend on base.target properly

diff --git a/units/fedora/prefdm.service b/units/fedora/prefdm.service
index 6fcd975..2919102 100644
--- a/units/fedora/prefdm.service
+++ b/units/fedora/prefdm.service
@@ -8,6 +8,7 @@
 [Unit]
 Description=Display Manager
 Before=graphical.target
+Requires=basic.target
 After=basic.target syslog.target messagebus.service haldaemon.service
 Conflicts=shutdown.target
 
diff --git a/units/fedora/rc-local.service b/units/fedora/rc-local.service
index ad0fb06..cb07007 100644
--- a/units/fedora/rc-local.service
+++ b/units/fedora/rc-local.service
@@ -8,6 +8,7 @@
 [Unit]
 Description=/etc/rc.local Compatibility
 Requires=basic.target
+After=basic.target
 Conflicts=shutdown.target
 
 # The rcN.d symlink uses the name "local" while the script itself is
commit ea2d9ed42d9896d2ade0dcd5d555c35778c19049
Author: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
Date:   Thu May 20 10:31:04 2010 +0200

    units: add services for Gentoo

diff --git a/Makefile.am b/Makefile.am
index 6d860ec..8313e57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -132,6 +132,15 @@ dist_systemunit_DATA += \
 	units/fedora/sysinit.service
 endif
 
+if TARGET_GENTOO
+dist_systemunit_DATA += \
+	units/gentoo/halt.service \
+	units/gentoo/killall.service \
+	units/gentoo/poweroff.service \
+	units/gentoo/reboot.service \
+	units/gentoo/xdm.service
+endif
+
 # This is needed because automake is buggy in how it generates the
 # rules for C programs, but not Vala programs.  We therefore can't
 # list the .h files as dependencies if we want make dist to work.
diff --git a/units/gentoo/halt.service b/units/gentoo/halt.service
new file mode 100644
index 0000000..8762a78
--- /dev/null
+++ b/units/gentoo/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
+Requires=shutdown.target killall.service
+After=shutdown.target killall.service
+Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+Environment=INIT_HALT=HALT
+Environment=RC_DOWN_HARDDISK=yes
+ExecStart=/etc/init.d/shutdown.sh
diff --git a/units/gentoo/killall.service b/units/gentoo/killall.service
new file mode 100644
index 0000000..a02062f
--- /dev/null
+++ b/units/gentoo/killall.service
@@ -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 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
+After=shutdown.target
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+ExecStart=/etc/init.d/killprocs start
diff --git a/units/gentoo/poweroff.service b/units/gentoo/poweroff.service
new file mode 100644
index 0000000..1a0a6a4
--- /dev/null
+++ b/units/gentoo/poweroff.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=Power-Off
+Requires=shutdown.target killall.service
+After=shutdown.target killall.service
+Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+Environment=RC_DOWN_HARDDISK=yes
+ExecStart=/etc/init.d/shutdown.sh
diff --git a/units/gentoo/reboot.service b/units/gentoo/reboot.service
new file mode 100644
index 0000000..92c4962
--- /dev/null
+++ b/units/gentoo/reboot.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=Reboot
+Requires=shutdown.target killall.service
+After=shutdown.target killall.service
+Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount
+
+[Service]
+Type=finish
+ValidNoProcess=yes
+Environment=RUNLEVEL=6
+ExecStart=/etc/init.d/reboot.sh
diff --git a/units/gentoo/xdm.service b/units/gentoo/xdm.service
new file mode 100644
index 0000000..8394991
--- /dev/null
+++ b/units/gentoo/xdm.service
@@ -0,0 +1,16 @@
+#  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=Display Manager
+Before=graphical.target
+After=basic.target syslog.target messagebus.service haldaemon.service
+Conflicts=shutdown.target
+
+[Service]
+ExecStart=/etc/init.d/xdm start
+Type=simple
commit cfe243e3720062c2e0eecd8bb0bdd7b4059e156d
Author: Kay Sievers <kay.sievers at vrfy.org>
Date:   Thu May 20 17:55:42 2010 +0200

    units: SUSE support

diff --git a/configure.ac b/configure.ac
index 5e50536..cccb0ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,7 +179,7 @@ case $with_distro in
                 ;;
         suse)
                 SYSTEM_SYSVRCND_PATH=/etc/init.d
-                AC_DEFINE(TARGET_SUSE, [], [Target is OpenSUSE/SLES])
+                AC_DEFINE(TARGET_SUSE, [], [Target is OpenSUSE/SLE])
                 M4_DISTRO_FLAG=-DTARGET_SUSE=1
                 ;;
         debian)
diff --git a/src/service.c b/src/service.c
index ac83862..2f699cd 100644
--- a/src/service.c
+++ b/src/service.c
@@ -57,7 +57,7 @@ static const struct {
         { "rc5.d",  SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP },
         { "rc6.d",  SPECIAL_RUNLEVEL6_TARGET, RUNLEVEL_DOWN },
 
-        /* SuSE style boot.d */
+        /* SUSE style boot.d */
         { "boot.d", SPECIAL_BASIC_TARGET,     RUNLEVEL_BASIC },
 
         /* Debian style rcS.d */
@@ -676,7 +676,7 @@ static int service_load_sysv_name(Service *s, const char *name) {
                 free(path);
 
                 if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
-                        /* Try Suse style boot.xxx init scripts */
+                        /* Try SUSE style boot.xxx init scripts */
 
                         if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
                                 return -ENOMEM;
diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
index 72d4794..31e8415 100644
--- a/units/getty at .service.m4
+++ b/units/getty at .service.m4
@@ -6,6 +6,7 @@
 #  (at your option) any later version.
 
 m4_ifdef(`TARGET_FEDORA', `m4_define(`GETTY', `/sbin/mingetty')')m4_dnl
+m4_ifdef(`TARGET_SUSE', `m4_define(`GETTY', `/sbin/mingetty')')m4_dnl
 m4_ifdef(`TARGET_DEBIAN', `m4_define(`GETTY', `/sbin/getty 38400')')m4_dnl
 m4_ifdef(`TARGET_GENTOO', `m4_define(`GETTY', `/sbin/agetty 38400')')m4_dnl
 m4_dnl
diff --git a/units/graphical.target.m4 b/units/graphical.target.m4
index c9b7669..98555ad 100644
--- a/units/graphical.target.m4
+++ b/units/graphical.target.m4
@@ -17,3 +17,6 @@ m4_ifdef(`TARGET_FEDORA',
 m4_dnl On Fedora Runlevel 5 is graphical login
 Names=runlevel5.target
 )m4_dnl
+m4_ifdef(`TARGET_SUSE',
+Names=runlevel5.target
+)m4_dnl
diff --git a/units/multi-user.target.m4 b/units/multi-user.target.m4
index ac05be8..2cc7489 100644
--- a/units/multi-user.target.m4
+++ b/units/multi-user.target.m4
@@ -17,3 +17,6 @@ m4_ifdef(`TARGET_FEDORA',
 m4_dnl On Fedora Runlevel 3 is multi-user
 Names=runlevel3.target
 )m4_dnl
+m4_ifdef(`TARGET_SUSE',
+Names=runlevel3.target
+)m4_dnl


More information about the systemd-commits mailing list