GNU bug report logs -
#26830
Allow services to implement a 'reload' action
Previous Next
Full log
View this message in rfc822 format
Hello!
ludo <at> gnu.org (Ludovic Courtès) skribis:
> The logical next step of this series will be to have the service upgrade
> code in ‘guix system reconfigure’ invoke this action when it is defined.
> That will be awesome.
>
> Some comments:
>
> + #:actions (make-actions
> + (reload
> + "Reload the service's configuration files."
> + #$(shepherd-service-reload service))))))))
>
> Here I think we should only define the action when it has a non-#f
> value. That way we can distinguish between services that have a useful
> reload/reconfigure/upgrade action and those that don’t; in the latter
> case, we simply use ‘restart’ when upgrading.
>
> Regarding nginx:
>
> + (stop (nginx-action "-s" "stop"))
> + (reload (nginx-action "-s" "reload"))))))))
>
> Is this of any use in practice? The nginx command line is something
> like:
>
> /gnu/store/74kz9m850ycxpzkg6dvn9wbd3xjkwwrb-nginx-1.12.0/sbin/nginx -c /gnu/store/5w11ahw113fndvab3xmwcjzs2rw56sbh-nginx-config/bayfront.conf -p /var/run/nginx
>
> and the configuration file in /gnu/store is immutable, so “nginx -s
> reload” does nothing. If the action took an argument, we could do:
>
> herd reconfigure nginx /gnu/store/…-new-config.conf
>
> which would translate to:
>
> nginx -s reload -c /gnu/store/…-new-config.conf
FWIW, with the patch at <https://bugs.gnu.org/32128>, adding such
actions becomes easy (it’s a generalization of what you did in this
patch series.)
Ludo’.
This bug report was last modified 3 years and 77 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.