1 --- ganeti-2.6.2/daemons/daemon-util.in~ 2012-12-21 15:38:52.000000000 +0100
2 +++ ganeti-2.6.2/daemons/daemon-util.in 2013-06-01 19:29:38.454569439 +0200
7 -# Meant to facilitate use utilities in /etc/rc.d/init.d/functions in case
8 -# start-stop-daemon is not available.
14 echo "@LOCALSTATEDIR@/run/ganeti/$1.pid"
19 local name="$1"; shift
20 - local pidfile=$(_daemon_pidfile $name)
21 - local daemonexec=$(_daemon_executable $name)
23 - if type -p start-stop-daemon >/dev/null; then
24 - start-stop-daemon --stop --signal 0 --quiet \
27 - _ignore_error status \
31 + /sbin/service $name status >/dev/null 2>&1
38 local name="$1"; shift
39 - # Convert daemon name to uppercase after removing "ganeti-" prefix
40 - local plain_name=${name#ganeti-}
41 - local ucname=$(tr a-z A-Z <<<$plain_name)
42 - local pidfile=$(_daemon_pidfile $name)
43 - local usergroup=$(_daemon_usergroup $plain_name)
44 - local daemonexec=$(_daemon_executable $name)
46 if [[ "$name" == ganeti-confd &&
47 "@CUSTOM_ENABLE_CONFD@" == False ]]; then
52 - # Read $<daemon>_ARGS and $EXTRA_<daemon>_ARGS
53 - eval local args="\"\$${ucname}_ARGS \$EXTRA_${ucname}_ARGS\""
55 @PKGLIBDIR@/ensure-dirs
57 - if type -p start-stop-daemon >/dev/null; then
58 - start-stop-daemon --start --quiet --oknodo \
59 - --pidfile $pidfile \
60 - --startas $daemonexec \
61 - --chuid $usergroup \
64 - # TODO: Find a way to start daemon with a group, until then the group must
66 - _ignore_error daemon \
67 - --pidfile $pidfile \
68 - --user ${usergroup%:*} \
69 - $daemonexec $args "$@"
71 + /sbin/service $name start
73 # FIXME: This is a workaround for issue 477. Remove this once confd does not
74 # mess up the permissions anymore.
78 local name="$1"; shift
79 - local pidfile=$(_daemon_pidfile $name)
81 - if type -p start-stop-daemon >/dev/null; then
82 - start-stop-daemon --stop --quiet --oknodo --retry 30 \
85 - _ignore_error killproc -p $pidfile $name
87 + /sbin/service $name stop
90 # Starts a daemon if it's not yet running
93 # Reloads the SSH keys
95 - @RPL_SSH_INITD_SCRIPT@ restart
96 + /sbin/service sshd restart
99 -# Read @SYSCONFDIR@/rc.d/init.d/functions if start-stop-daemon not available
100 -if ! type -p start-stop-daemon >/dev/null && \
101 - [[ -f @SYSCONFDIR@/rc.d/init.d/functions ]]; then
102 - _ignore_error . @SYSCONFDIR@/rc.d/init.d/functions
105 if [[ "$#" -lt 1 ]]; then
106 echo "Usage: $0 <action>" >&2