[arch-dev-public] systemd units for ppp and watchdog
Jan Steffens
jan.steffens at gmail.com
Thu Aug 30 07:44:01 EDT 2012
On Thu, Aug 30, 2012 at 1:27 PM, Thomas Bächler <thomas at archlinux.org> wrote:
> Am 30.08.2012 12:32, schrieb Jan Steffens:
>>> You use Type=forking with a process that doesn't fork - that's what
>>> 'nodetach' means: do NOT fork into the background. That doesn't seem right.
>>
>> Yeah, whoops - it should have been "updetach". I added it in the
>> email. The original doesn't use either and just expects the default
>> detaching behavior.
>
> Yes, that's my problem:
>
> * updetach may wait a very long time before detaching.
> * You cannot force 'detach' on the commandline.
As I see it you either want to wait for it to establish the
connection, or you don't.
If the former, updetach and Type=forking is the right choice:
[Unit]
Description=PPP link to %I
After=network.target
[Service]
Type=forking
PIDFile=/run/ppp-%i.pid
ExecStart=/usr/sbin/pppd call %I linkname %i updetach
[Install]
WantedBy=multi-user.target
---
If the latter, nodetach:
[Unit]
Description=PPP link to %I
After=network.target
[Service]
ExecStart=/usr/sbin/pppd call %I nodetach
[Install]
WantedBy=multi-user.target
---
I'd say go for the former. Would allow other units to depend on the
connection being up.
You could also ship both units under differing names, such as
ppp-wait at .service and ppp-nowait at .service. In that case, Conflicts on
each other would probably be a good idea
(Conflicts=ppp-nowait@%i.service).
More information about the arch-dev-public
mailing list