]> git.proxmox.com Git - pve-manager.git/blob - bin/init.d/pve-manager
depend on systemd, add service files
[pve-manager.git] / bin / init.d / pve-manager
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides: pve-manager
5 # Required-Start: $remote_fs pveproxy qemu-server pvestatd
6 # Required-Stop: $remote_fs pveproxy qemu-server pvestatd
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
14 PATH=/sbin:/bin:/usr/bin:/usr/sbin
15 DESC="PVE Status Daemon"
16 PVESH=/usr/bin/pvesh
17
18 test -f $PVESH || exit 0
19
20 # Include defaults if available
21 if [ -f /etc/default/pve-manager ] ; then
22 . /etc/default/pve-manager
23 fi
24
25 case "$1" in
26 start)
27 if [ "$START" = "no" ]; then
28 exit 0
29 fi
30 echo "Starting VMs and Containers"
31 pvesh --nooutput create /nodes/localhost/startall
32 ;;
33 stop)
34 echo "Stopping running Backup"
35 vzdump -stop
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 ;;
47 esac
48
49 exit 0