Native systemd unit for tsm client

Michal Schmidt mschmidt at redhat.com
Thu Dec 15 11:48:29 UTC 2011


Jóhann B. Guðmundsson" wrote:
> Nope nothing odd with specifying Type=oneshot together with
> RemainAfterExit=yes

Well, it is really odd to spacify oneshot if the service is actually a daemon.

> # systemctl start tsm-client.service && systemctl status
> tsm-client.service && ps aux | grep dsmcad && netstat -pant | grep
> dsmcad
> tsm-client.service - Tivoly Storage Manager Client
>        Loaded: loaded (/lib/systemd/system/tsm-client.service;
>        disabled)
>        Active: active (exited) since Thu, 15 Dec 2011 10:53:08 +0000;
>        8s ago
>       Process: 7312 ExecStart=/usr/bin/dsmcad (code=exited,
> status=0/SUCCESS)
>        CGroup: name=systemd:/system/tsm-client.service
>            └ 7315 /usr/bin/dsmcad

Notice the not-quite correct "active (exited)" state.
If PID 7315 dies unexpectedly, your service would still show up as active.

> You have Type=forking and GuessMainPID=no without having PIDFile=
> entry
> 
> The above seem odd to me about the unit file you are using

If dsmcad is indeed forking, the type is correct. Don't lie to systemd.
If dsmcad indeed creates no PID file, it's correct to not have the PIDFile= entry.
If the main PID guessing can go wrong (for double-forking daemons that can happen),
GuessMainPID=no is the right option to set.
I see nothing wrong with that.

Michal


More information about the devel mailing list