[systemd-devel] Restart=always and "ExecStartPre" (netatalk)

Reindl Harald h.reindl at thelounge.net
Tue Oct 25 18:42:12 PDT 2011



Am 29.09.2011 00:16, schrieb Michal Schmidt:
> On Wed, 28 Sep 2011 23:01:46 +0200 Reindl Harald wrote:
>> thank you for your reply
>>
>> first i tried two services (netatalk.service + netatalk-cnid.service)
>> but for whatever reason /usr/sbin/cnid_metad will be started with
>> a correct zero-return-value but the process is closed, tried
>> preforking/simple
> 
> See if 'GuessMainPID=no' works around it

perfect - thank you!
netatalk-2.2.1-7.p3.fc15.20111025.rh.x86_64

now both services are working fine and cnid is automatically started
and stopped with "netatalk.service", exactly what i need since we are
using only afp-over-tcp and not need the additional services / configs

well, this was my last critical package for our F15 rollout in december AFAIK
all other business critical are backported from F16/F17 or replaced
with systemd-units and optimized start-orderings as needed

[root at testserver:~]$ cat /lib/systemd/system/netatalk.service
[Unit]
Description=Apple-Fileserver
After=avahi-daemon.service
[Service]
Type=forking
GuessMainPID=no
ExecStartPre=/bin/systemctl start netatalk-cnid.service
ExecStart=/usr/sbin/afpd -P /var/run/netatalk.pid -F /etc/netatalk/afpd.conf -U uams_dhx.so,uams_dhx2.so -g nobody
ExecStopPost=/bin/systemctl stop netatalk-cnid.service
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target

[root at testserver:~]$ cat /lib/systemd/system/netatalk-cnid.service
[Unit]
Description=Netatalk CNID
[Service]
Type=forking
GuessMainPID=no
ExecStart=/usr/sbin/cnid_metad -l log_note
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20111026/ae2913ca/attachment.pgp>


More information about the systemd-devel mailing list