[systemd-devel] ExecReload and dynamic arguments (start control process with arguments)
Michal Koutný
mkoutny at suse.com
Tue Apr 2 18:43:40 UTC 2024
Hello.
On Mon, Mar 04, 2024 at 06:47:42PM +0400, Vadim Nevorotin <nevorotin at gmail.com> wrote:
> One of them - how to support different "reload" modes? We need to start
> some control process in the context of service (like ExecReload does), but
> this process supports some arguments and we need to pass them in time of
> 'systemctl reload' call. Previously we have commands like:
>
> /etc/init.d/ourservice reload|soft-reload|hard-reload [--someargs]
I assume the command + args must be somehow delivered to the service
process (e.g. written to a socket). (DM)
> All doing different actions, manipulating service main process/workers and
> pidfiles, How can I do it with systemd? Did I miss something in the
> documentation?
It seems to me you're focusing too much on the reload aspect whereas it
is a generic communication with the service (because of the
parametrization).
Simply use the delivery mechanism above (DM) and if it should result in
the replacement of tha mein service process send MAINPID=" via
sd_notify().
HTH,
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240402/b2295262/attachment.sig>
More information about the systemd-devel
mailing list