I'm trying to setup multiple instances of rsyslog (one for kernel
messages) using lfs-bootscripts-20120116 and running into some
problems.

I'm using rsyslogd 5.8.6, which is designed with multiple instance
support.  I've set up one configuration file (/etc/rsysklog.conf) 
for the kernel logger and one for the system logger (/etc/rsyslog.conf)

rsyslogd's 
        -i flag specifies the pid file used and
        -f specifies the configuration file.

> root:~# source /lib/lsb/init-functions
> 
> root:~# start_daemon -p /run/rsyslogd.pid /sbin/rsyslogd -i /run/rsyslogd.pid 
> -f /etc/rsyslog.conf
> root:~# echo $?
> 0

Now let's check:

> root:~# ps xa | grep rsyslogd
> 8045 ?        Sl   0:00 /sbin/rsyslogd -i /run/rsyslogd/pid -f 
> /etc/rsyslog.conf
> 8131 tty1     s+   0:00 grep rsyslog
> 
> root:~# stausproc -p /run/rsyslogd.pid /rsbin/rsyslogd
> rsyslogd is running with Process ID(s) 8045
> 
> root:# cat /run/rsyslogd.pid
> 8045

So far so good.

But now let's try running the second instance.

> root:~# start_daemon -p /run/rsysklogd.pid /sbin/rsyslogd -i 
> /run/rsysklogd.pid -f /etc/rsysklog.conf
> root:~# echo $?
> 0

and now check:
> root:~# ps xa | grep rsyslogd
>  8045 ?        Sl   0:00 /sbin/rsyslogd -i /run/rsyslogd.pid -f 
> /etc/rsyslog.conf
> 8133 tty1     s+   0:00 grep rsyslog


What?

Note that rsyslog behaves as expected:

> root:~# sbin/rsyslogd -i /run/rsysklogd.pid -f /etc/rsysklog.conf
> root:~# echo $?
> 0
>
> root:~# ps xa | grep rsyslogd
> 8045 ?        Sl   0:00 /sbin/rsyslogd -i /run/rsyslogd.pid -f 
> /etc/rsyslog.conf
> 8149 ?        Sl   0:00 /sbin/rsyslogd -i /run/rsysklogd.pid -f 
> /etc/rsysklog.conf
> 8155 tty1     s+   0:00 grep rsyslog
>
> root:~# cat /run/rsyslogd.pid
> 8045
> root:~# cat /run/rsysklogd.pid
> 8149


So far, I think I've tracked the problem down to statusproc() not correctly
using the pidfile it's given.

Namely: this is correct

> root:~# statusproc -p /run/rsyslogd.pid /sbin/rsyslogd
> rsyslogd is running with Process ID(s) 8045
>
> root:~# cat /run/rsyslogd.pid
> 8045

But this is not
> root:~# statusproc -p /run/rsysklogd.pid /sbin/rsyslogd
> rsyslogd is running with Process ID(s) 8045
>
> root:~# cat /run/rsysklogd.pid
> 8149




BTW: statusproc() defined in /lib/lsb/init-functions has an "exit 1" just after
it prints its Usage statement; shouldn't this be a "return 1" instead?

BTW2: statusproc()'s Usage statement says :
        echo "Usage: [-p pidfile] statusproc {program}"
Shouldn't this be this?
        echo "Usage: statusproc [-p pidfile] {program}"
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to