[systemd-devel] What if a service is started manually
Cecil Westerhof
Cecil.Westerhof at Snow.nl
Thu Nov 28 15:23:51 PST 2013
In a trial presentation I used the following service file:
[Unit]
Description=Virtual Distributed Ethernet
After=syslog.target
[Service]
Type=forking
PIDFile=/var/run/vde.pid
# Note the -f: don't fail if there is no PID file
ExecStartPre=/bin/rm -f /var/run/vde.pid
ExecStart=/usr/bin/vde_switch --tap tap0 --mode 0660 \
--dirmode 0750 --group qemu \
--daemon --pidfile /var/run/vde.pid
Restart=on-abort
[Install]
WantedBy=multi-user.target
Here the PID file is removed before the service is started.
This brought up two questions.
- What happens is you start a service that you already started? Nothing,
or is the service first stopped and then again started?
- What happens if someone started the service manually? So bypassing
systemd and running directly /usr/bin/vde_switch.
Met vriendelijke groet,
Cecil Westerhof
Engineer
mobiel +31 - 6 - 25 00 38 81
--
Snow B.V.
Unix Specialists
De Ooyen 11
4191 PB Geldermalsen
http://www.snow.nl
tel. +31 - 345 - 65 66 66
More information about the systemd-devel
mailing list