From 525ee6f4a1639bcb28198bf9e32b93ca2bfd268b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Oct 2010 20:30:44 +0200 Subject: [PATCH] service: rename settings for Restart= from 'restart-always' to 'always' and similar --- fixme | 2 ++ man/systemd.service.xml | 12 ++++++------ src/service.c | 8 ++++---- src/service.h | 2 +- units/emergency.service | 2 +- units/fedora/prefdm.service | 2 +- units/fedora/single.service | 2 +- units/getty@.service.m4 | 2 +- units/serial-getty@.service.m4 | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/fixme b/fixme index 24fb1694..fd756312 100644 --- a/fixme +++ b/fixme @@ -107,6 +107,8 @@ later: * enable syslog.socket by default, activating our kmsg bridge +* Restart=on-failure and Restart=on-abort + External: * place /etc/inittab with explaining blurb. diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 6ab3bc36..d573ec6f 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -428,17 +428,17 @@ Configures whether the main service process shall be restarted when it exists. Takes one of - , - or - . If - set to (the + , + or + . If + set to (the default) the service will not be restarted when it exits. If set to - it + it will be restarted only when it exited cleanly, i.e. terminated with an exit code of 0. If set to - the + the service will be restarted regardless whether it exited cleanly or not, or got terminated abnormally by a diff --git a/src/service.c b/src/service.c index 301633ec..116e539d 100644 --- a/src/service.c +++ b/src/service.c @@ -795,7 +795,7 @@ static int service_load_sysv_path(Service *s, const char *path) { /* Special setting for all SysV services */ s->type = SERVICE_FORKING; s->remain_after_exit = true; - s->restart = SERVICE_ONCE; + s->restart = SERVICE_RESTART_NO; s->exec_context.std_output = (s->meta.manager->sysv_console || s->exec_context.std_input == EXEC_INPUT_TTY) ? EXEC_OUTPUT_TTY : EXEC_OUTPUT_NULL; @@ -3109,9 +3109,9 @@ static const char* const service_state_table[_SERVICE_STATE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(service_state, ServiceState); static const char* const service_restart_table[_SERVICE_RESTART_MAX] = { - [SERVICE_ONCE] = "once", - [SERVICE_RESTART_ON_SUCCESS] = "restart-on-success", - [SERVICE_RESTART_ALWAYS] = "restart-always", + [SERVICE_RESTART_NO] = "no", + [SERVICE_RESTART_ON_SUCCESS] = "on-success", + [SERVICE_RESTART_ALWAYS] = "always", }; DEFINE_STRING_TABLE_LOOKUP(service_restart, ServiceRestart); diff --git a/src/service.h b/src/service.h index e2b11db6..f4734670 100644 --- a/src/service.h +++ b/src/service.h @@ -48,7 +48,7 @@ typedef enum ServiceState { } ServiceState; typedef enum ServiceRestart { - SERVICE_ONCE, + SERVICE_RESTART_NO, SERVICE_RESTART_ON_SUCCESS, SERVICE_RESTART_ALWAYS, _SERVICE_RESTART_MAX, diff --git a/units/emergency.service b/units/emergency.service index 8e378482..8578654d 100644 --- a/units/emergency.service +++ b/units/emergency.service @@ -18,7 +18,7 @@ ExecStartPre=-/bin/plymouth --hide-splash ExecStartPre=-/bin/echo 'Welcome to emergency mode. Use "systemctl default" to activate default mode.' ExecStart=-/sbin/sulogin StandardInput=tty-force -Restart=restart-always +Restart=always RestartSec=0 KillMode=process-group diff --git a/units/fedora/prefdm.service b/units/fedora/prefdm.service index efb83fef..32ceb9aa 100644 --- a/units/fedora/prefdm.service +++ b/units/fedora/prefdm.service @@ -16,7 +16,7 @@ After=getty@tty1.service plymouth-quit.service [Service] ExecStart=/etc/X11/prefdm -nodaemon -Restart=restart-always +Restart=always RestartSec=0 [Install] diff --git a/units/fedora/single.service b/units/fedora/single.service index 6afc8b35..a519ae3d 100644 --- a/units/fedora/single.service +++ b/units/fedora/single.service @@ -21,7 +21,7 @@ ExecStartPre=-/bin/plymouth --hide-splash ExecStartPre=-/bin/echo 'Welcome to rescue mode. Use "systemctl default" to activate default mode.' ExecStart=-/sbin/sulogin StandardInput=tty-force -Restart=restart-always +Restart=always RestartSec=0 KillMode=process-group diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 index 4b65d5b9..8df77c70 100644 --- a/units/getty@.service.m4 +++ b/units/getty@.service.m4 @@ -31,7 +31,7 @@ Before=getty.target [Service] Environment=TERM=linux ExecStart=-GETTY %I -Restart=restart-always +Restart=always RestartSec=0 KillMode=process-group diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 index b91ed983..baf2eca1 100644 --- a/units/serial-getty@.service.m4 +++ b/units/serial-getty@.service.m4 @@ -28,7 +28,7 @@ m4_ifdef(`TARGET_FEDORA', ExecStartPre=-/sbin/securetty %I )m4_dnl ExecStart=-/sbin/agetty -s %I 115200,38400,9600 -Restart=restart-always +Restart=always RestartSec=0 KillMode=process-group -- 2.39.5