I created systemd service, which runs a script that auto-generates some configuration files if these don't exist, and loads the services depending on them, or loads the services with the existing ones.
I would like to provide some extra functionality, allowing the user to clean previous configurations using the same systemctl service.
I thought in ExecReload
, thinking that it would be called when the user types systemctl restart service_name
, but then I discovered that it is not doing what I thought.
Is there a way to do i? I was checking here and in Freedesktop Systemd doc, but I could not find the way
systemctl
's interface, which means verbs likestart
,stop
, orreload
, which you probably don't want to overload. Are you open to using something besidessystemctl
as the interface to this?ExecReload=
is executed when you runsystemctl reload
, notrestart
(which doessrop
followed bystart
.) I guess it's not completely clear to me what you're trying to accomplish, would you care to give more details, like a more detailed description of what config files you want to generate and which services you want to start/restart/reload from your custom service? That would help us give you a better suggestion on how to accomplish what you're trying to do... Thanks!