[systemd-devel] What if a service is started manually

Cecil Westerhof Cecil.Westerhof at Snow.nl
Thu Nov 28 15:37:25 PST 2013


On 11/29/2013 12:23 AM, Cecil Westerhof wrote:
> 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.

I was not clear here. What I mend: someone starts the service manually 
and after this starts the service with systemctl.


More information about the systemd-devel mailing list