[systemd-devel] DBUS API to restart unit by sending sigkill/sighup

prashantkumar dhotre prashantkumardhotre at gmail.com
Mon Sep 10 06:42:53 UTC 2018


Hi,
Is there is dbus API for systemd to restart unit by sending sigkill /sighup
?
https://www.freedesktop.org/wiki/Software/systemd/dbus/
RestartUnit(in  s name, in  s mode, out o job);
My requirement is to have a way to restart unit by sending sigkill or
sighup (user can specify ) also along with sigterm.
Since that dbus APi does not seem to exists, to achieve same effect ,
I can use KillUnit() API to send custom signal and then use  StartUnit().
KillUnit(in  s name, in  s who,   in  i signal);
StartUnit(in  s name, in  s mode,  out o job);

Is that correct understanding ?
One issue with this is how to know when to do  StartUnit() after KillUnit()
since KillUnit() may not have completed stopping unit yet.
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180910/031bebb1/attachment.html>


More information about the systemd-devel mailing list