]> git.proxmox.com Git - pve-manager.git/blob - bin/init.d/spiceproxy
PVE::Replication - pass guest_class to run_replication
[pve-manager.git] / bin / init.d / spiceproxy
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides: spiceproxy
5 # Required-Start: $remote_fs $network $syslog pveproxy
6 # Required-Stop: $remote_fs $network $syslog pveproxy
7 # Default-Start: 2 3 4 5
8 # Default-Stop: 0 1 6
9 # Short-Description: PVE SPICE Proxy Server
10 ### END INIT INFO
11
12 . /lib/lsb/init-functions
13
14 PATH=/sbin:/bin:/usr/bin:/usr/sbin
15 DAEMON=/usr/bin/spiceproxy
16 NAME=spiceproxy
17 DESC="PVE SPICE Proxy Server"
18 RUNDIR=/var/run/pveproxy
19 PIDFILE=${RUNDIR}/spiceproxy.pid
20
21 test -f $DAEMON || exit 0
22
23 # avoid warnings about uninstalled locales when pveproxy executes commands
24 export LC_ALL="C"
25
26 mkdir -p ${RUNDIR} || true
27 chmod 0700 ${RUNDIR} || true
28 chown www-data:www-data ${RUNDIR} || true
29
30 DAEMON_OPTS=""
31
32 # Include defaults if available
33 if [ -f /etc/default/$NAME ] ; then
34 . /etc/default/$NAME
35 fi
36
37 case "$1" in
38 start)
39 log_daemon_msg "Starting $DESC" "$NAME"
40 $DAEMON start
41 log_end_msg $?
42 ;;
43 stop)
44 log_daemon_msg "Stopping $DESC" "$NAME"
45 $DAEMON stop
46 log_end_msg $?
47 ;;
48 restart|force-reload)
49 log_daemon_msg "Restarting $DESC" "$NAME"
50 $DAEMON restart
51 log_end_msg $?
52 ;;
53 *)
54 N=/etc/init.d/$NAME
55 echo "Usage: $N {start|stop|restart|force-reload}"
56 exit 1
57 ;;
58 esac
59
60 exit 0