X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/91525dee856951ace940c78b6254a1c7344b4803..325947e719d0c75711aa9b5086bbd4be9e047343:/daemons/daemon-util.in diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in index 2b3d24d..44c39a9 100644 --- a/daemons/daemon-util.in +++ b/daemons/daemon-util.in @@ -39,6 +39,7 @@ _confd_enabled() { if _confd_enabled; then DAEMONS+=( ganeti-confd ) + DAEMONS+=( ganeti-luxid ) fi _mond_enabled() { @@ -52,6 +53,7 @@ fi NODED_ARGS= MASTERD_ARGS= CONFD_ARGS= +LUXID_ARGS= RAPI_ARGS= MOND_ARGS= @@ -80,7 +82,10 @@ _daemon_usergroup() { echo "@GNTMASTERUSER@:@GNTMASTERDGROUP@" ;; confd) - echo "@GNTCONFDUSER@:@GNTDAEMONSGROUP@" + echo "@GNTCONFDUSER@:@GNTCONFDGROUP@" + ;; + luxid) + echo "@GNTLUXIDUSER@:@GNTLUXIDGROUP@" ;; rapi) echo "@GNTRAPIUSER@:@GNTRAPIGROUP@" @@ -228,7 +233,8 @@ start() { local usergroup=$(_daemon_usergroup $plain_name) local daemonexec=$(_daemon_executable $name) - if [[ "$name" == ganeti-confd ]] && ! _confd_enabled; then + if ( [[ "$name" == ganeti-confd ]] || [[ "$name" == ganeti-luxid ]] ) \ + && ! _confd_enabled; then echo 'ganeti-confd disabled at build time' >&2 return 1 fi @@ -318,6 +324,34 @@ stop_all() { done } +# SIGHUP a process to force re-opening its logfiles +rotate_logs() { + if [[ "$#" -lt 1 ]]; then + echo 'Missing daemon name.' >&2 + return 1 + fi + + local name="$1"; shift + local pidfile=$(_daemon_pidfile $name) + local daemonexec=$(_daemon_executable $name) + + if type -p start-stop-daemon >/dev/null; then + start-stop-daemon --stop --signal HUP --quiet \ + --oknodo --pidfile $pidfile + else + _ignore_error killproc \ + -p $pidfile \ + $daemonexec -HUP + fi +} + +# SIGHUP all processes +rotate_all_logs() { + for i in $(list_stop_daemons); do + rotate_logs $i + done +} + # Reloads the SSH keys reload_ssh_keys() { @RPL_SSH_INITD_SCRIPT@ restart