#!/bin/sh ### BEGIN INIT INFO # Provides: guix-daemon # Required-Start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the guix-daemon # Description: starts guix-daemon using start-stop-daemon ### END INIT INFO # # Author: Sree Harsha Totakura using lightdm script # from Yves-Alexis Perez # # License: # (C) 2014 Sree Harsha Totakura # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 3, or (at your # option) any later version. # # This file is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNUnet; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/local/bin/guix-daemon DAEMON_OPTS="--build-users-group=guix-builder --cores=0" NAME=guixd DESC=guix-daemon test -x $DAEMON || exit 0 set -e . /lib/lsb/init-functions case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --background --make-pidfile \ --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS || true echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON || true echo "$NAME." ;; restart) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON || true sleep 1 start-stop-daemon --start --background --make-pidfile \ --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true echo "$NAME." ;; status) status_of_proc -p /var/run/$NAME.pid "$DAEMON" "$NAME" && exit 0 || exit $? ;; *) echo "Usage: $NAME {start|stop|restart|status}" >&2 exit 1 ;; esac exit 0