Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get an lsyncd daemon running. I installed the lsyncd RPM from epel, but it doesn't seem to come with an init.d script. In the lsyncd repository, there's this script that works with Debian. However, when I try to run this under CentOS, I get this message:

/etc/init.d/lsyncd: line 46: log_daemon_msg: command not found

How can I adapt this to work with CentOS?

share|improve this question
From EPEL? Doubt it. – Ignacio Vazquez-Abrams May 12 '10 at 14:11
@Ignacio - You're right. I'm not sure where I got it was from epel from. :-) – Jason Baker May 12 '10 at 14:20

writing from scratch could be easier, depending on how complex the script is. the issue you're running into is this line in the script:

. /lib/lsb/init-functions

which loads all the functions for debian's startup scripts. in that is a function 'log_daemon_msg' which is where your problem is at.

you could look at the init-functions file to figure out what log_daemon_msg does, and replicate on CentOS, or you could step through the Debian script and see what is actually run (probably less than 5 lines of commands)

share|improve this answer

/usr/share/doc/initscripts-*/sysvinitfiles contains a template you can use as a model for modifying the existing script or creating a new one.

share|improve this answer
In other words, it's easier just to write it from scratch using that template? :-) – Jason Baker May 12 '10 at 14:18
Probably, yeah. – Ignacio Vazquez-Abrams May 12 '10 at 14:21

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!

# lsyncd        This shell script takes care of starting and stopping
#               lsyncd (the Live Syncing (Mirror) Daemon)
# Author: Randy Reddekopp
# 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/
# processname: lsyncd

# Source function library.
. /etc/init.d/functions


start() {
        echo -n "Starting Live Syncing Daemon: "
        if [ -f $PIDFILE ]; then
                PID=`cat $PIDFILE`
                echo lsyncd already running: $PID
                exit 1;
                cd $LSYNCD_DIR
                daemon ./lsyncd $OPTIONS
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lsyncd
                return $RETVAL


stop() {
        echo -n "Shutting down Live Syncing Daemon: "
        killproc lsyncd
        rm -f /var/lock/subsys/lsyncd
        return 0

case "$1" in
        status lsyncd
        echo "Usage:  {start|stop|status|restart}"
        exit 1
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/".

Then you should be set to start the service!

/sbin/service lsyncd start

Cheers, Randy

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.