2006/2/1, Chris Robinson <[EMAIL PROTECTED]>:

> BackupPC is working well.  I just need  to know how to start it on power up.
>
> I have put the script into /etc/init.d but it does not work probably
> because it need to run as a user.

Hi,

Try this one (from my Debian system):

#! /bin/sh
# /etc/init.d/backuppc
#
# BackupPC Debian init script
#

set -e

# Do not change the values below ! Read /usr/share/doc/backuppc/README.Debian !
BINDIR=/usr/share/backuppc/bin
DATADIR=/var/lib/backuppc
USER=backuppc
#
NAME=backuppc
DAEMON=BackupPC

test -x $BINDIR/$DAEMON || exit 0

case "$1" in
 start)
   echo -n "Starting $NAME: "
   start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
                           -c $USER --exec $BINDIR/$DAEMON -- -d
   echo "ok."
   ;;
 stop)
   echo -n "Stopping $NAME: "
   start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
                           --oknodo --retry 30
   echo "ok."
     ;;
 restart)
   echo -n "Restarting $NAME: "
   start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
                           --oknodo --retry 30
   start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
                           -c $USER --exec $BINDIR/$DAEMON -- -d
   echo "ok."
   ;;
 reload|force-reload)
   echo "Reloading $NAME configuration files"
   start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid \
                           --signal 1
   ;;
 *)
   echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
   exit 1
   ;;
esac

exit 0

#EOF

chmod 755 /etc/init.d/backuppc
chown root:root /etc/init.d/backuppc

-- Vincent


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to