]>
Commit | Line | Data |
---|---|---|
b92400b6 DM |
1 | #!/bin/sh |
2 | ||
3 | ### BEGIN INIT INFO | |
4 | # Provides: pve-manager | |
6675a064 DM |
5 | # Required-Start: $remote_fs pveproxy qemu-server pvestatd |
6 | # Required-Stop: $remote_fs pveproxy qemu-server 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 | ||
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 | ||
18cc1430 WL |
20 | # Include defaults if available |
21 | if [ -f /etc/default/pve-manager ] ; then | |
22 | . /etc/default/pve-manager | |
23 | fi | |
24 | ||
b92400b6 DM |
25 | case "$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) | |
eab837c4 | 34 | echo "Stopping running Backup" |
8682f6fc | 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 | ;; | |
47 | esac | |
48 | ||
49 | exit 0 |