Lennart, Marius, I don't know what happened with Marius' patches, so I'm submitting the patch I need to make my system boot (taking into account the comments made by Lennart).
On Thu, May 20, 2010 at 6:27 PM, Lennart Poettering <[email protected]> wrote: > On Thu, 20.05.10 15:17, Marius O ([email protected]) wrote: > >> > Are you sure you have something like rc.local? >> >> Yes, Arch has it... but with the mention of having a >> rc.local.shutdown. Is there a way of defining a dependency between the >> two (ie, if we start the service responsible for rc.local we should >> run at shutdown time the rc.local.shutdow) ? > > Hmm, this could be something you want to put in the ExecStop line in > your service file then. Done. >> > And are you sure you need >> > that stupid hack I have in there that establishes two names for rc.local >> > because our symlink for that is so weird? (i.e. we have a symlink >> > /etc/rc2.d/S99local → /etc/rc.local instead of /etc/rc2.d/S99rc.local). >> >> There's exactly /etc/rc.local, as Arch doesn't have the /etc/rcN.d >> runlevel folders. > > Ah, so you have are not using the classic SysV layout? Are there no > runlevels currently being used on ArchLinux? As far as I know the runlevel support on Arch is very minimal (see below). >> > If you call /sbin/halt and friends directly you should be able to simply >> > pass -f, and you won't need the RUNLEVEL=6 env hack then. (RUNLEVEL=6 is >> > needed because sysvinit's halt is just one evil piece of code and our >> > halt script on Fedora does not pass -f to halt). Arch (in /etc/rc.shutdown) uses the runlevel to decide if it should reboot or halt, so this hack is needed (as far as I can tell). With the attached patch Arch boots, but more work is needed before systemd can be a dropin replacement for sysvinit on Arch: 1) parse the DAEMONS array from /etc/rc.conf 2) each daemon should be made into a service and be scheduled "After" the preceding daemon in the array. Two exceptions: * if a daemon has an "!" in front of it, it should be ignored * if a daemon has an "@" in front of it, no later daemon should have an "After" dependency on it (the service is started in the background) Would a patch to do this be accepted? I might work on it in a few weeks time if no one does it before me. -t
From 452b087b2c542744dfcc011a44b76bdd0e79cb86 Mon Sep 17 00:00:00 2001 From: Tom Gundersen <[email protected]> Date: Wed, 16 Jun 2010 13:50:55 +0200 Subject: [PATCH] Make Arch boot This patch gives minimal Arch support (enough to boot). We still need to parse the services to start from /etc/rc.conf before systemd can be a drop-in replacement on Arch. --- Makefile.am | 9 +++++++++ units/arch/halt.service | 18 ++++++++++++++++++ units/arch/poweroff.service | 18 ++++++++++++++++++ units/arch/rc-local.service | 20 ++++++++++++++++++++ units/arch/reboot.service | 18 ++++++++++++++++++ units/arch/sysinit.service | 19 +++++++++++++++++++ units/[email protected] | 1 + units/sysinit.target.m4 | 5 +++++ 8 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 units/arch/halt.service create mode 100644 units/arch/poweroff.service create mode 100644 units/arch/rc-local.service create mode 100644 units/arch/reboot.service create mode 100644 units/arch/sysinit.service diff --git a/Makefile.am b/Makefile.am index 20fd06f..913ce7a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -181,6 +181,15 @@ dist_systemunit_DATA += \ units/gentoo/xdm.service endif +if TARGET_ARCH +dist_systemunit_DATA += \ + units/arch/sysinit.service \ + units/arch/rc-local.service \ + units/arch/halt.service \ + units/arch/poweroff.service \ + units/arch/reboot.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/arch/halt.service b/units/arch/halt.service new file mode 100644 index 0000000..445ca48 --- /dev/null +++ b/units/arch/halt.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=Halt +Requires=shutdown.target +After=shutdown.target +Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount + +[Service] +Type=finish +ValidNoProcess=yes +Environment=RUNLEVEL=0 +ExecStart=/etc/rc.shutdown diff --git a/units/arch/poweroff.service b/units/arch/poweroff.service new file mode 100644 index 0000000..3ca8f30 --- /dev/null +++ b/units/arch/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 +After=shutdown.target +Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount + +[Service] +Type=finish +ValidNoProcess=yes +Environment=RUNLEVEL=0 +ExecStart=/etc/rc.shutdown diff --git a/units/arch/rc-local.service b/units/arch/rc-local.service new file mode 100644 index 0000000..45b6e16 --- /dev/null +++ b/units/arch/rc-local.service @@ -0,0 +1,20 @@ +# 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=/etc/rc.local Compatibility +Requires=basic.target +After=basic.target +Conflicts=shutdown.target [email protected] + +[Service] +ExecStart=/etc/rc.local +ExectStop=/etc/rc.local.shutdown +TimeoutSec=0 +StandardInput=tty +ValidNoProcess=yes diff --git a/units/arch/reboot.service b/units/arch/reboot.service new file mode 100644 index 0000000..4aa7dc2 --- /dev/null +++ b/units/arch/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 +After=shutdown.target +Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount + +[Service] +Type=finish +ValidNoProcess=yes +Environment=RUNLEVEL=6 +ExecStart=/etc/rc.shutdown diff --git a/units/arch/sysinit.service b/units/arch/sysinit.service new file mode 100644 index 0000000..8be50d7 --- /dev/null +++ b/units/arch/sysinit.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=System Initialization +Before=local-fs.target remote-fs.target swap.target sockets.target +Conflicts=shutdown.target +Before=shutdown.target + +[Service] +ExecStart=/etc/rc.sysinit +Type=forking +TimeoutSec=0 +StandardInput=tty +ValidNoProcess=yes diff --git a/units/[email protected] b/units/[email protected] index 1ada4ff..8f3f628 100644 --- a/units/[email protected] +++ b/units/[email protected] @@ -9,6 +9,7 @@ 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_ifdef(`TARGET_ARCH', `m4_define(`GETTY', `/sbin/agetty -8 38400')')m4_dnl m4_dnl [Unit] Description=Getty on %I diff --git a/units/sysinit.target.m4 b/units/sysinit.target.m4 index 68c661e..48e55a4 100644 --- a/units/sysinit.target.m4 +++ b/units/sysinit.target.m4 @@ -17,3 +17,8 @@ m4_dnl Hook in Fedora's /etc/rc.d/rc.sysinit Requires=sysinit.service After=sysinit.service )m4_dnl +m4_ifdef(`TARGET_ARCH', +m4_dnl Hook in Arch's /etc/rc.sysinit +Requires=sysinit.service +After=sysinit.service +)m4_dnl -- 1.7.1
_______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
