<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi,<br><br></div> I am using sd_notify_pid_with_fds and subsequently sd_notify_fds to store and receive fds from systemd.<br><br></div> Systemd differentiates between<br><br></div> systemctl restart <service>  -> Where it stops and starts the service, but maintains the fd stored above<br><br></div> whereas if I do systemctl stop <service> and then start, the fds are cleaned out.<br><br></div> 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.<br><br></div> 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?<br><br></div> Without that it seems difficult for the service to make the determination to maintain/restore state or flush/init state?<br><br></div>Thanks<br></div>Jana<br><br></div>