]>
git.proxmox.com Git - pve-cluster.git/blob - debian/init.d
4 # Provides: pve-cluster
5 # Required-Start: $remote_fs $network $syslog $time
6 # Required-Stop: $remote_fs $network $syslog $time
7 # X-Start-Before: cron +ceph
9 # Default-Start: 2 3 4 5
11 # Short-Description: Starts the pve cluster filesystem
12 # Description: Starts and stops the pve cluster filesystem
15 PATH
=/usr
/local
/sbin
:/usr
/local
/bin
:/sbin
:/bin
:/usr
/sbin
:/usr
/bin
17 DAEMON
=/usr
/bin
/pmxcfs
# Introduce the server's location here
18 NAME
=pve-cluster
# Introduce the short server's name here
19 DESC
="pve cluster filesystem" # Introduce a short description here
21 PIDFILE
=/var
/run
/$NAME.pid
23 test -x $DAEMON ||
exit 0
25 .
/lib
/lsb
/init-functions
27 # Default options, these can be overriden by the information
28 # at /etc/default/$NAME
29 DAEMON_OPTS
="-q" # Additional options given to the server
31 # Include defaults if available
32 if [ -f /etc
/default
/$NAME ] ; then
39 # Check if a given process pid's cmdline matches a given name
42 [ -z "$pid" ] && return 1
43 [ ! -d /proc
/$pid ] && return 1
44 cmd
=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
45 # Is this the expected server
46 [ "${cmd##*/}" != "${name##*/}" ] && return 1
51 # Check if the process is running looking at /proc
52 # (works for all users)
54 # No pidfile, probably no daemon present
55 [ ! -f "$PIDFILE" ] && return 1
57 running_pid
$pid $DAEMON ||
return 1
63 if ! grep -qw fuse
/proc
/filesystems
; then
64 modprobe fuse
>/dev
/null
2>&1 || true
67 start-stop-daemon
--start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
73 start-stop-daemon
--stop --quiet --retry TERM
/2/TERM
/10/KILL
/2 --pidfile $PIDFILE
80 log_daemon_msg
"Starting $DESC " "$NAME"
82 # Check if it's running first
84 log_progress_msg
"apparently already running"
90 start_server || errcode
=$?
91 # try to create required directories. This only works
92 # for a single node setup, because we have no quorum
93 # in a cluster setup. But this doesn't matter, because the
94 # cluster manager creates all needed files (pvecm)
95 if [ $errcode -eq 0 ] ; then
96 /usr
/bin
/pvecm updatecerts
--silent || true
101 log_daemon_msg
"Stopping $DESC" "$NAME"
103 # Only stop the server if we see it running
105 stop_server || errcode
=$?
108 # If it's not running don't do anything
109 log_progress_msg
"apparently not running"
114 restart|force-reload
)
115 log_daemon_msg
"Restarting $DESC" "$NAME"
117 stop_server || errcode
=$?
119 start_server || errcode
=$?
123 log_daemon_msg
"Checking status of $DESC" "$NAME"
125 log_progress_msg
"running"
128 log_progress_msg
"apparently not running"
134 log_warning_msg
"Reloading $NAME daemon: not implemented, as the daemon"
135 log_warning_msg
"cannot re-read the config file (use restart)."
140 echo "Usage: $N {start|stop|restart|force-reload|status}" >&2