]>
git.proxmox.com Git - pve-cluster.git/blob - debian/init.d
4 # Provides: pve-cluster
5 # Required-Start: $remote_fs $network $syslog $time fuse
6 # Required-Stop: $remote_fs $network $syslog $time fuse
7 # X-Start-Before: apache2
8 # Default-Start: 2 3 4 5
10 # Short-Description: Starts the pve cluster filesystem
11 # Description: Starts and stops the pve cluster filesystem
14 PATH
=/usr
/local
/sbin
:/usr
/local
/bin
:/sbin
:/bin
:/usr
/sbin
:/usr
/bin
16 DAEMON
=/usr
/bin
/pmxcfs
# Introduce the server's location here
17 NAME
=pve-cluster
# Introduce the short server's name here
18 DESC
="pve cluster filesystem" # Introduce a short description here
20 PIDFILE
=/var
/run
/$NAME.pid
22 test -x $DAEMON ||
exit 0
24 .
/lib
/lsb
/init-functions
26 # Default options, these can be overriden by the information
27 # at /etc/default/$NAME
28 DAEMON_OPTS
="-q" # Additional options given to the server
30 # Include defaults if available
31 if [ -f /etc
/default
/$NAME ] ; then
38 # Check if a given process pid's cmdline matches a given name
41 [ -z "$pid" ] && return 1
42 [ ! -d /proc
/$pid ] && return 1
43 cmd
=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
44 # Is this the expected server
45 [ "${cmd##*/}" != "${name##*/}" ] && return 1
50 # Check if the process is running looking at /proc
51 # (works for all users)
53 # No pidfile, probably no daemon present
54 [ ! -f "$PIDFILE" ] && return 1
56 running_pid
$pid $DAEMON ||
return 1
62 start-stop-daemon
--start --quiet --pidfile $PIDFILE --exec $DAEMON -- -q $DAEMON_OPTS
68 start-stop-daemon
--stop --quiet --retry TERM
/2/TERM
/10/KILL
/2 --pidfile $PIDFILE
75 log_daemon_msg
"Starting $DESC " "$NAME"
77 # Check if it's running first
79 log_progress_msg
"apparently already running"
84 start_server || errcode
=$?
85 # try to create required directories. This only works
86 # for a single node setup, because we have no quorum
87 # in a cluster setup. But this doesn't matter, because the
88 # cluster manager creates all needed files (pvecm)
89 if [ $errcode -eq 0 ] ; then
90 /usr
/bin
/pvecm updatecerts
--silent || true
95 log_daemon_msg
"Stopping $DESC" "$NAME"
97 # Only stop the server if we see it running
99 stop_server || errcode
=$?
102 # If it's not running don't do anything
103 log_progress_msg
"apparently not running"
108 restart|force-reload
)
109 log_daemon_msg
"Restarting $DESC" "$NAME"
111 stop_server || errcode
=$?
113 start_server || errcode
=$?
117 log_daemon_msg
"Checking status of $DESC" "$NAME"
119 log_progress_msg
"running"
122 log_progress_msg
"apparently not running"
128 log_warning_msg
"Reloading $NAME daemon: not implemented, as the daemon"
129 log_warning_msg
"cannot re-read the config file (use restart)."
134 echo "Usage: $N {start|stop|restart|force-reload|status}" >&2