ExecReload and dynamic arguments (start control process with arguments)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

We're trying to pack our services to systemd units, but we've run into a number of problems.

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]

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?

In general - I need to start a control script in the context of some service (like ExecReload does), which will be able to replace the main service process correctly (systemd-notify with NotifyAccess=exec should help, I hope), and with the ability to pass arguments/env/anything to it. E.g. like:

systemctl reload service -- --arg=1 somearg
ENVVAR=123 systemctl reload service

Or any other way.

ExecReload command is executed in a clean environment and also is not a child of systemctl process - so I can't use simple tmp files based on PIDs or similar to pass args because of possible race conditions (as I see - I can't find from ExecReload= command the actual process which calls systemctl reload)

King regards,
Vadim

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux