Skip to content

Commit

Permalink
feat(systemd): Allow to customize systemctl reload command (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
znerol committed Jul 4, 2019
1 parent dc6f819 commit 9ea6972
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/certhub-cert-reload@.service.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Environment
Path to a file containing the services to reload. Defaults to:
``/etc/certhub/%i.services-reload.txt``

.. envvar:: CERTHUB_CERT_RELOAD_COMMAND

A systemctl subcommand to execute when a service needs to be reloaded.
Useful values include ``reload``, ``restart``, ``try-restart``,
``reload-or-restart``, ``try-reload-or-restart``. Defaults to ``reload``.


Files
-----
Expand Down
2 changes: 1 addition & 1 deletion lib/systemd/certhub-cert-reload@.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Type=oneshot

ExecStart=/usr/bin/env \
xargs -a ${CERTHUB_CERT_RELOAD_CONFIG} -I{} \
systemctl reload {}
systemctl ${CERTHUB_CERT_RELOAD_COMMAND} {}

SyslogIdentifier=certhub-cert-reload
StandardOutput=syslog
Expand Down
1 change: 1 addition & 0 deletions lib/systemd/certhub-cert-reload@.service.d/reload.conf
8 changes: 8 additions & 0 deletions lib/systemd/dropins/reload.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Service]

# CERTHUB_CERT_RELOAD_COMMAND
# A systemctl subcommand to execute when a service needs to be reloaded.
# Useful values include `reload`, `restart`, `try-restart`,
# `reload-or-restart`, `try-reload-or-restart`
#
Environment=CERTHUB_CERT_RELOAD_COMMAND=reload

0 comments on commit 9ea6972

Please sign in to comment.