]> git.proxmox.com Git - pve-manager.git/blame - bin/init.d/pve-manager
Fix backup failure at shutdown.
[pve-manager.git] / bin / init.d / pve-manager
CommitLineData
b92400b6
DM
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: pve-manager
7a05d783
DM
5# Required-Start: $remote_fs pveproxy qemu-server +vz pvestatd
6# Required-Stop: $remote_fs pveproxy qemu-server +vz pvestatd
b92400b6
DM
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: PVE VM Manager
10### END INIT INFO
11
12. /lib/lsb/init-functions
13
14PATH=/sbin:/bin:/usr/bin:/usr/sbin
15DESC="PVE Status Daemon"
16PVESH=/usr/bin/pvesh
17
18test -f $PVESH || exit 0
19
18cc1430
WL
20# Include defaults if available
21if [ -f /etc/default/pve-manager ] ; then
22 . /etc/default/pve-manager
23fi
24
b92400b6
DM
25case "$1" in
26 start)
18cc1430
WL
27 if [ "$START" = "no" ]; then
28 exit 0
29 fi
b92400b6
DM
30 echo "Starting VMs and Containers"
31 pvesh --nooutput create /nodes/localhost/startall
32 ;;
33 stop)
8682f6fc
WL
34 echo "Stopping all running Backups"
35 vzdump -stop
b92400b6
DM
36 echo "Stopping VMs and Containers"
37 pvesh --nooutput create /nodes/localhost/stopall
38 ;;
39 reload|restart|force-reload)
40 # do nothing here
41 ;;
42 *)
43 N=/etc/init.d/$NAME
44 echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2
45 exit 1
46 ;;
47esac
48
49exit 0