Bug 982561 - Syslog-ng init script does not handle error in case of rsyslog PID file existence
Syslog-ng init script does not handle error in case of rsyslog PID file exist...
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: syslog-ng (Show other bugs)
el6
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Douglas E. Warner
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-09 05:59 EDT by Anton Kalgashkin
Modified: 2014-07-18 16:45 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Anton Kalgashkin 2013-07-09 05:59:57 EDT
Description of problem:

I have rsyslog and syslog-ng are installed on the same machine. I tried to run rsyslog and syslog-ng sequentaly.

[root@localhost ~]# service rsyslog start
Starting system logger:                                    [  OK  ]
[root@localhost ~]# 
[root@localhost ~]# service rsyslog status
rsyslogd (pid  9365) is running...
[root@localhost ~]# service syslog-ng start
Plugin module not found in 'module-path'; module-path='/lib64/syslog-ng', module='afsql'
Plugin module not found in 'module-path'; module-path='/lib64/syslog-ng', module='afsql'
                                                           [  OK  ]
[root@localhost ~]# service rsyslog status
rsyslogd (pid  9392) is running...
[root@localhost ~]# service syslog-ng status
syslog-ng (pid  9392) is running...

The main reason of this behavior is in the syslog-ng init script:

start()
{
    verify_config
    echo -n $"Starting syslog-ng: "
    if [ -e $SYSLOGNG_COMPAT_PID ]; then
        failure "PID file for existing syslog daemon exists"
    fi
    daemon syslog-ng $SYSLOGNG_OPTIONS
    ln -sf $SYSLOGNG_PID $SYSLOGNG_COMPAT_PID
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog-ng
    return $RETVAL
}

Init script checks whether other PID file exists but does not take any actions.
Besides, failure function does not take any arguments, so you can't see warning or error.

[root@localhost ~]# netstat -anp | grep syslog
unix  2      [ ]         DGRAM                    85532  9545/syslog-ng      /dev/log
unix  3      [ ]         DGRAM                    85463  9527/rsyslogd       /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     85535  9545/syslog-ng      /var/lib/syslog-ng/syslog-ng.ctl


Version-Release number of selected component (if applicable):

rsyslog-5.8.10-6.el6.x86_64
syslog-ng-3.2.5-3.el6.x86_64

How reproducible:

Always

Steps to Reproduce:
1. See above

Actual results:
1. Syslog-ng starts normaly.

Expected results:
1. Syslog-ng must be terminated with error.

Additional info:

Note You need to log in before you can comment on or make changes to this bug.