3 # Provides: sipb-xen-console
4 # Required-Start: $local_fs $remote_fs
5 # Required-Stop: $local_fs $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: sipb-xen Console Server homedir filesystem
12 # Author: SIPB Xen Project <sipb-xen@mit.edu>
16 # PATH should only include /usr/* if it runs after the mountnfs.sh script
17 PATH=/sbin:/usr/sbin:/bin:/usr/bin
18 DESC="The sipb-xen console server"
20 DAEMON=/usr/bin/sipb-xen-consolefs
21 DAEMON_ARGS="/consolefs"
22 PIDFILE=/var/run/$NAME.pid
23 SCRIPTNAME=/etc/init.d/$NAME
25 # Exit if the package is not installed
26 [ -x "$DAEMON" ] || exit 0
28 # Read configuration variable file if it is present
29 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
31 # Load the VERBOSE setting and other rcS variables
34 # Define LSB log_* functions.
35 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
36 . /lib/lsb/init-functions
41 for i in $(invirt-getconf --ls hosts); do
42 local hostname=$(invirt-getconf hosts.$i.hostname)
43 echo "#include /etc/conserver/conf.d/$hostname"
45 } > /etc/conserver/invirt-hosts.cf
46 local realm=$(invirt-getconf authn.0.realm)
48 for i in $(invirt-getconf --ls hosts); do
49 local hostname=$(invirt-getconf hosts.$i.hostname)
50 echo "host/$hostname@$realm"
52 } > /etc/remctl/acl/invirt-console
54 mako-render /etc/nss-pgsql.conf.mako > /etc/nss-pgsql.conf
56 fmt > /etc/issue.net.no_tkt << EOF
57 You must login to the $(invirt-getconf console.hostname) console server using
58 Kerberos tickets, but your ssh client did not pass a valid ticket to the
64 # Function that starts the daemon/service
69 # 0 if daemon has been started
70 # 1 if daemon was already running
71 # 2 if daemon could not be started
74 daemon --running -n $NAME && return 1
75 daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
79 # Function that stops the daemon/service
84 # 0 if daemon has been stopped
85 # 1 if daemon was already stopped
86 # 2 if daemon could not be stopped
87 # other if a failure occurred
88 daemon --stop -n $NAME
90 [ "$RETVAL" = 2 ] && return 2
91 # Many daemons don't delete their pidfiles when they exit.
100 /etc/init.d/conserver-server reload
105 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
108 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
109 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
113 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
116 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
117 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
121 log_daemon_msg "Reloading $DESC" "$NAME"
126 log_daemon_msg "Restarting $DESC" "$NAME"
133 1) log_end_msg 1 ;; # Old process is still running
134 *) log_end_msg 1 ;; # Failed to start
144 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2