[systemd-devel] Difference between restart versus stop-start

Pathangi Janardhanan path.jana at gmail.com
Fri Jan 15 00:41:18 PST 2016


Hi,

 I am using sd_notify_pid_with_fds and subsequently sd_notify_fds to store
and receive fds from systemd.

 Systemd differentiates between

 systemctl restart <service>  -> Where it stops and starts the service, but
maintains the fd stored above

 whereas if I do systemctl stop <service> and then start, the fds are
cleaned out.

 This works well for me, but my question is that apart from the fds, the
service also stores local state and tries to restore them on start, and i
need the same logic for that data also. i.e. if the service is being
restarted than it stores that data otherwise it deletes and flsuhes them
out.

 So my question is, is there any way for the service to know when it is
being stopped that it is done for a restart versus stop command?

 Without that it seems difficult for the service to make the determination
to maintain/restore state or flush/init state?

Thanks
Jana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20160115/2f630374/attachment.html>


More information about the systemd-devel mailing list