diff options
Diffstat (limited to 'data/systemd')
-rw-r--r-- | data/systemd/Makefile.am | 4 | ||||
-rwxr-xr-x | data/systemd/anaconda-generator | 34 | ||||
-rw-r--r-- | data/systemd/anaconda-shell@.service | 5 | ||||
-rw-r--r-- | data/systemd/anaconda.target | 12 | ||||
-rw-r--r-- | data/systemd/anaconda@.service (renamed from data/systemd/anaconda.service) | 9 |
5 files changed, 52 insertions, 12 deletions
diff --git a/data/systemd/Makefile.am b/data/systemd/Makefile.am index 589854cfa..ae89c1806 100644 --- a/data/systemd/Makefile.am +++ b/data/systemd/Makefile.am @@ -18,5 +18,7 @@ # Author: Chris Lumens <clumens@redhat.com> systemddir = /lib/systemd/system -dist_systemd_DATA = anaconda-shell@.service anaconda.target anaconda.service instperf.service +generatordir = /lib/systemd/system-generators +dist_systemd_DATA = anaconda-shell@.service anaconda.target anaconda@.service instperf.service +dist_generator_SCRIPTS = anaconda-generator MAINTAINERCLEANFILES = Makefile.in diff --git a/data/systemd/anaconda-generator b/data/systemd/anaconda-generator new file mode 100755 index 000000000..654557278 --- /dev/null +++ b/data/systemd/anaconda-generator @@ -0,0 +1,34 @@ +#!/bin/bash +# anaconda-generator: generate services needed for anaconda operation + +# set up dirs +systemd_dir=/lib/systemd/system +target_dir=$systemd_dir/anaconda.target.wants +mkdir -p $target_dir + +# create symlink anaconda.target.wants/SERVICE@TTY.service +service_on_tty() { + local service="$1" tty="$2" + local service_instance="${service/@.service/@$tty.service}" + ln -sf $systemd_dir/$service $target_dir/$service_instance +} + +# find the real tty for /dev/console +tty="console" +while [ -f /sys/class/tty/$tty/active ]; do + tty=$(< /sys/class/tty/$tty/active) + tty=${tty##* } # last item in the list +done +consoletty="$tty" + +# put anaconda on the real console +service_on_tty anaconda@.service $consoletty + +# put a shell on tty2 and the first virtualization console we find +for tty in tty2 hvc0 hvc1 xvc0 hvsi0 hvsi1 hvsi2; do + [ "$tty" = "$consoletty" ] && continue + if [ -d /sys/class/tty/$tty ]; then + service_on_tty anaconda-shell@.service $tty + [ "$tty" != "tty2" ] && break + fi +done diff --git a/data/systemd/anaconda-shell@.service b/data/systemd/anaconda-shell@.service index ad2141ee0..52bed74b5 100644 --- a/data/systemd/anaconda-shell@.service +++ b/data/systemd/anaconda-shell@.service @@ -6,14 +6,13 @@ BindTo=dev-%i.device After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service [Service] -Environment=TERM=linux WorkingDirectory=/ ExecStart=-/sbin/agetty -n -l /bin/bash -o '--login' %I 38400 Restart=always RestartSec=0 -TimeoutSec=0 -TTYPath=/dev/%i +TTYPath=/dev/%I TTYReset=yes TTYVHangup=yes TTYVTDisallocate=yes +KillMode=process KillSignal=SIGHUP diff --git a/data/systemd/anaconda.target b/data/systemd/anaconda.target index 9f7f3be07..983ff3b77 100644 --- a/data/systemd/anaconda.target +++ b/data/systemd/anaconda.target @@ -1,7 +1,11 @@ [Unit] -Description=The anaconda installation program +Description=Anaconda System Services Requires=basic.target -Conflicts=rescue.service rescue.target -After=basic.target rescue.service rescue.target +After=basic.target AllowIsolate=yes -Wants=anaconda.service anaconda-shell@tty2.service anaconda-shell@hvc1.service fedora-import-state.service +Before=anaconda@.service +Wants=instperf.service +Wants=rsyslog.service +Wants=udev-settle.service +Wants=NetworkManager.service +Wants=plymouth-quit.service plymouth-quit-wait.service diff --git a/data/systemd/anaconda.service b/data/systemd/anaconda@.service index 8e853aae2..903df7a85 100644 --- a/data/systemd/anaconda.service +++ b/data/systemd/anaconda@.service @@ -1,12 +1,13 @@ [Unit] -Description=the anaconda installation program -Wants=instperf.service rsyslog.service udev-settle.service NetworkManager.service -After=instperf.service rsyslog.service udev-settle.service NetworkManager.service +Description=Anaconda +After=anaconda.target [Service] -Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin PYTHONPATH=/tmp/updates TERM=linux +Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin PYTHONPATH=/tmp/updates Type=oneshot WorkingDirectory=/root ExecStart=/usr/sbin/anaconda StandardInput=tty-force +TTYPath=/dev/%I +TTYReset=yes TimeoutSec=0 |