I had the same issue. Here is what I conjured up following the other recommendations, init.d tutorials, and the existing debian script found on the lsyncd googlecode site link text. Hope this helps others, just copy and paste!
#!/bin/bash
#
# lsyncd This shell script takes care of starting and stopping
# lsyncd (the Live Syncing (Mirror) Daemon)
#
# Author: Randy Reddekopp not-public@usask.ca
#
# chkconfig: 2345 13 87
# description: Lsyncd uses rsync to synchronize local directories with a remote \
# machine running rsyncd. It watches multiple directories trees \
# through inotify. The first step after adding the watches is to \
# rsync all directories with the remote host, and then sync single \
# file by collecting the inotify events. So lsyncd is a light-weight \
# live mirror solution.
# pidfile: /var/run/lsyncd.pid
# processname: lsyncd
# Source function library.
. /etc/init.d/functions
PIDFILE="/var/run/lsyncd.pid"
LSYNCD_DIR="/usr/local/bin/"
start() {
echo -n "Starting Live Syncing Daemon: "
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
echo lsyncd already running: $PID
exit 1;
else
cd $LSYNCD_DIR
daemon ./lsyncd $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/lsyncd
return $RETVAL
fi
}
stop() {
echo -n "Shutting down Live Syncing Daemon: "
echo
killproc lsyncd
echo
rm -f /var/lock/subsys/lsyncd
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status lsyncd
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status|restart}"
exit 1
;;
esac
exit $?
Paste that code into /etc/init.d/lsyncd.
Change file permissions:
chmod 755 /etc/init.d/lsyncd
In your /etc/lsyncd.conf.xml file you need to uncomment the "<pidfile .../>" node and set its filename attribute to "/var/run/lsyncd.pid".
Then you should be set to start the service!
/sbin/service lsyncd start
Cheers,
Randy