Clean up systemd jobs.

The main visible effect of this is that if console-conf crashes or is killed
it restarts instantly rather than 90 seconds later. It also removes the flicker
where a getty gets started and then instantly killed during startup.
This commit is contained in:
Michael Hudson-Doyle 2016-09-01 22:33:00 +12:00
parent d3e3e11a18
commit 0e56b0cba0
5 changed files with 9 additions and 15 deletions

View File

@ -1,3 +1,2 @@
[Unit]
After=serial-console-conf@%i.service
Wants=serial-console-conf@%i.service
[Service]
ExecStartPre=/bin/systemctl start serial-console-conf@%i.service

View File

@ -1,3 +1,2 @@
[Unit]
After=console-conf@%i.service
Wants=console-conf@%i.service
[Service]
ExecStartPre=/bin/systemctl start console-conf@%i.service

View File

@ -1,9 +1,7 @@
[Unit]
Description=Ubuntu Core Firstboot Configuration %I
After=systemd-user-sessions.service plymouth-quit-wait.service
ExecPreStart=systemctl stop getty@%I
After=rc-local.service
ExecStop=systemctl start getty@%I
IgnoreOnIsolate=yes
ConditionPathExists=/dev/tty0
ConditionPathExists=!/var/lib/console-conf/complete
@ -11,10 +9,8 @@ ConditionPathExists=!/var/lib/console-conf/complete
[Service]
Environment=PYTHONPATH=/usr/share/subiquity
ExecStartPre=/bin/systemctl stop getty@%I
ExecStart=-/sbin/agetty -n --noclear -l /usr/share/subiquity/console-conf-wrapper %I $TERM
ExecStop=/bin/systemctl start getty@%I
#ExecStopPost=/bin/echo "Post stop, starting getty@%I"
#ExecStopPost=/bin/systemctl start getty@%I
ExecStart=/sbin/agetty -n --noclear -l /usr/share/subiquity/console-conf-wrapper %I $TERM
ExecStopPost=/bin/systemctl start getty@%I
Type=idle
Restart=always
RestartSec=0

View File

@ -8,8 +8,8 @@ ConditionPathExists=!/var/lib/console-conf/complete
[Service]
Environment=PYTHONPATH=/usr/share/subiquity
ExecStartPre=/bin/systemctl stop serial-getty@%I
ExecStart=-/sbin/agetty -n --keep-baud -f /usr/share/subiquity/console-conf-wait -w -l /usr/bin/console-conf --login-options "--serial" 115200,38400,9600 %I $TERM
ExecStop=/bin/systemctl start serial-getty@%I
ExecStart=/sbin/agetty -n --keep-baud -f /usr/share/subiquity/console-conf-wait -w -l /usr/bin/console-conf --login-options "--serial" 115200,38400,9600 %I $TERM
ExecStopPost=/bin/systemctl start serial-getty@%I
Type=idle
Restart=always
RestartSec=0

View File

@ -222,5 +222,5 @@ def mark_firstboot_complete():
def disable_first_boot_service():
""" Stop firstboot service; which also restores getty service """
log.info('disabling first boot service')
run_command(["systemctl", "stop", "console-conf@*.service", "serial-console-conf@*.service"])
run_command(["systemctl", "stop", "--no-block", "console-conf@*.service", "serial-console-conf@*.service"])
return