<p dir="ltr">On Jul 7, 2014 1:20 PM, "pradip K" <<a href="mailto:pskothali@gmail.com">pskothali@gmail.com</a>> wrote:<br>
> I am trying implement watchdog feature using sd_notify, could you pls give<br>
> us more details on setting $NOTIFY_SOCKET.<br>
> Like how to create socket and assign to environment NOTIFY_SOCKET for this</p>
<p dir="ltr">The socket is created automatically by systemd; all you need to set is Type=notify and systemd will set the right variable.</p>
<p dir="ltr">> [Unit]<br>
> After=snmpd.service<br>
> Before=exxxl.service nxx.service ixx.service lac<br>
><br>
> [Service]<br>
> Type=notify<br>
> ExecStart=/data/ABC -d<br>
> ExecStop=/data/pkill ABC<br>
> TimeoutStopSec=5<br>
> Environment=NOTIFY_SOCKET=<br>
> WatchdogSec=30s<br>
> NotifyAccess=all<br>
> FailureAction==reboot-force<br>
><br>
> [Install]<br>
> WantedBy=multi-user.target</p>
<p dir="ltr">(Also, please do not use `pkill` in ExecStop; it's not just unnecessary, it even makes the stop process *less* reliable. systemd already knows which PID it has to kill.)</p>
<p dir="ltr">-- <br>
Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>><br>
// sent from phone</p>