Bug 522071

Summary: Misbehaved rsyslog init script
Product: [Fedora] Fedora Reporter: Eduard Benes <ebenes>
Component: rsyslogAssignee: Tomas Heinrich <theinric>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: pvrabec, theinric
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 539065 (view as bug list) Environment:
Last Closed: 2009-10-12 10:00:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 521669, 539065    

Description Eduard Benes 2009-09-09 12:04:58 UTC
Description of problem:
Testing init script according to guidelines at [1],[2] shows following results:

== 1 ==
Running start on a service already running sould return successful (0 value), and not 1 as it does now:
<snip>
# service rsyslog stop ; echo $?
Shutting down system logger: [  OK  ]
0
# service rsyslog start ; echo $?
Starting system logger: [  OK  ]
0
# service rsyslog start ; echo $?
Starting system logger: [FAILED]
1
</snip>

== 2 ==
Missing 'status' action in the usage text, e.g. run 'grep -i "usage.*status" /etc/rc.d/init.d/rsyslog' (Expected 0, got 1)

== 3 ==
Would be nice to add support for 'try-restart' as it is really just an alias for 'condrestart'.

== 4 ==
Does not use "common" lock file name. Uses rsyslog instead of $prog which is rsyslogd. Should use rather 'lockfile=/var/lock/subsys/$prog'. Please refer to [2]. And please, also note that is uses following pid file: "/var/run/syslogd.pid"

== 5 ==
Lock file handling issues. Status should return 2, not 3:
<snip>
# service rsyslog stop ; echo $?
Shutting down system logger: [  OK  ]
0
# touch /var/lock/subsys/rsyslog
# service rsyslog status ; echo $?
rsyslogd is stopped
3
----
:: [   PASS   ] :: Running 'service rsyslog status'
:: [   PASS   ] :: Running 'touch /var/lock/subsys/rsyslog'
:: [   FAIL   ] :: Running 'service rsyslog status' (Expected 2, got 3)
</snip>

PID file handling issues. Status should return 1, not 3:
<snip>
# service rsyslog stop ; echo $?
Shutting down system logger: [  OK  ]
0
# echo 123456 > /var/run/syslog.pid
# service rsyslog status ; echo $?
rsyslogd is stopped
3
----
:: [   PASS   ] :: Running 'service rsyslog stop'
:: [   PASS   ] :: Running 'echo 123456 > /var/run/rsyslog.pid'
:: [   FAIL   ] :: Running 'service rsyslog status' (Expected 1, got 3)
</snip>

== 6 == 
Bad exit code for unimplemented action. Running 'service rsyslog hello' should return 3, got 2.

Version-Release number of selected component (if applicable):
4.4.1-1.fc12.i686

Actual results:
Misbehaved init script.

Expected results:
be LSB compliant (see[1],[2],[3]).

Additional info:
[1] - https://fedoraproject.org/wiki/FCNewInit/Initscripts
[2] - https://fedoraproject.org/wiki/Packaging/SysVInitScript
[3] - http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

Comment 1 Tomas Heinrich 2009-09-14 18:30:41 UTC
New rsyslog build is in rawhide.
Note that rsyslog uses a non-standard pid file because of bug 441664.