Commit 34e9ba66 authored by Lennart Poettering's avatar Lennart Poettering

service: rename Type=finish to Type=oneshot and allow multiple ExecStart=...

service: rename Type=finish to Type=oneshot and allow multiple ExecStart= lines for oneshot services

In contrast to the other service types oneshot services are usually not
long lasting and there's not necessarily a single clean main process for
them. This change allows multiple ExecStart= lines for this type of
services so that the admin/developer doesn't have to arbitrarily pick on
of various sequential commands as the "main one".
parent 00b07cb3
......@@ -71,8 +71,6 @@
* be more forgiving when parsing unit files, when encountering incorrect lines with assignments
* ExecStart= mehrfach bei Type=finish
* move runlevel symlinks to /lib
* agetty darf nicht mit emergency.service kollidieren
......
......@@ -119,7 +119,7 @@
start-up type for this service
unit. One of <option>simple</option>,
<option>forking</option>,
<option>finish</option>,
<option>oneshot</option>,
<option>dbus</option>,
<option>notify</option>.</para>
......@@ -158,7 +158,7 @@
exits.</para>
<para>Behaviour of
<option>finish</option> is similar
<option>oneshot</option> is similar
to <option>simple</option>, however
it is expected that the process has to
exit before systemd starts follow-up
......
......@@ -295,7 +295,6 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
DBUS_TYPE_INVALID))
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "GetUnitByPID")) {
const char *name;
Unit *u;
uint32_t pid;
......
This diff is collapsed.
......@@ -58,7 +58,7 @@ typedef enum ServiceRestart {
typedef enum ServiceType {
SERVICE_SIMPLE, /* we fork and go on right-away (i.e. modern socket activated daemons) */
SERVICE_FORKING, /* forks by itself (i.e. traditional daemons) */
SERVICE_FINISH, /* we fork and wait until the program finishes (i.e. programs like fsck which run and need to finish before we continue) */
SERVICE_ONESHOT, /* we fork and wait until the program finishes (i.e. programs like fsck which run and need to finish before we continue) */
SERVICE_DBUS, /* we fork and wait until a specific D-Bus name appears on the bus */
SERVICE_NOTIFY, /* we fork and wait until a daemon sends us a ready message with sd_notify() */
_SERVICE_TYPE_MAX,
......
......@@ -5,7 +5,7 @@ Description=Permission Enforcement checker
ExecStart=/usr/bin/id
ExecStartPost=/usr/bin/env
ExecStartPost=/bin/sleep 5
Type=finish
Type=oneshot
Capabilities=all= cap_dac_override=eip
User=nobody
Group=nobody
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=RUNLEVEL=0
ExecStart=/etc/rc.shutdown
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=RUNLEVEL=0
ExecStart=/etc/rc.shutdown
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=RUNLEVEL=6
ExecStart=/etc/rc.shutdown
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target killall.service
After=shutdown.target umount.target killall.service
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=INIT_HALT=HALT RUNLEVEL=0
ExecStart=/etc/init.d/halt start
......
......@@ -12,7 +12,7 @@ After=shutdown.target
RefuseManualStart=yes
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
ExecStart=-/etc/init.d/killall start
StandardOutput=tty
......@@ -11,7 +11,7 @@ Before=getty@tty1.service
[Service]
ExecStart=-/usr/bin/plymouth quit
Type=finish
Type=oneshot
[Install]
WantedBy=multi-user.target
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target killall.service
After=shutdown.target umount.target killall.service
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=RUNLEVEL=0
ExecStart=/etc/init.d/halt start
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target killall.service
After=shutdown.target umount.target killall.service
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=RUNLEVEL=6
ExecStart=/etc/init.d/reboot start
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target killall.service
After=shutdown.target umount.target killall.service
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=INIT_HALT=HALT RC_DOWN_HARDDISK=yes
ExecStart=/etc/init.d/shutdown.sh
......
......@@ -12,7 +12,7 @@ After=shutdown.target
RefuseManualStart=yes
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
ExecStart=-/etc/init.d/killprocs start
StandardOutput=tty
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target killall.service
After=shutdown.target umount.target killall.service
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=RC_DOWN_HARDDISK=yes
ExecStart=/etc/init.d/shutdown.sh
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target killall.service
After=shutdown.target umount.target killall.service
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
ExecStart=/etc/init.d/reboot.sh
StandardOutput=tty
......@@ -5,5 +5,5 @@ Requires=shutdown.target
After=shutdown.target
[Service]
Type=finish
Type=oneshot
ExecStart=@SYSTEMCTL@ --session daemon-exit
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=INIT_HALT=HALT RUNLEVEL=0 COLD_BOOT=1
ExecStart=/etc/init.d/halt
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=COLD_BOOT=1
ExecStart=/etc/init.d/halt
......
......@@ -12,7 +12,7 @@ Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
Type=finish
Type=oneshot
ValidNoProcess=yes
Environment=COLD_BOOT=1
ExecStart=/etc/init.d/reboot
......
......@@ -11,5 +11,5 @@ DefaultDependencies=no
After=runlevel1.target runlevel2.target runlevel3.target runlevel4.target runlevel5.target auditd.service
[Service]
Type=finish
Type=oneshot
ExecStart=-@rootlibexecdir@/systemd-update-utmp runlevel
......@@ -12,5 +12,5 @@ Before=killall.service
Conflicts=systemd-update-utmp-runlevel.service
[Service]
Type=finish
Type=oneshot
ExecStart=-@rootlibexecdir@/systemd-update-utmp shutdown
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment