Bug 521195 - psacct initscript review
Summary: psacct initscript review
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: psacct
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: InitScriptsProject
TreeView+ depends on / blocked
 
Reported: 2009-09-04 09:08 UTC by Michal Nowak
Modified: 2013-03-08 02:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-16 07:40:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Nowak 2009-09-04 09:08:44 UTC
Description of problem:

Reviewed psacct's initscript and found few minor caveats or incompatibilities with https://fedoraproject.org/wiki/FCNewInit/Initscripts

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

psacct-6.3.2-53.fc11.x86_64

Actual results:

---[1]---------------------------------------------------------
"""
  *)
        # do not advertise unreasonable commands that there is no reason
        # to use with this device
        echo $"Usage: $0 {start|stop|status|restart|reload}"
        exit 1
"""
Should be better: exit 2, or exit 3
---[2]---------------------------------------------------------
"""
start()
        if [ -r $ACCTFILE ]; then
            ...
        else
            exit 1
        fi
"""
Should be better: exit 4 (aka: 4 user had insufficient privilege)
---[3]---------------------------------------------------------
"""
start()
            if [ $RETVAL -eq 0 ]; then
                ...
            else
                exit 3
            fi
"""
Should be better: exit 7 (aka: 7 program is not running)
---[4]---------------------------------------------------------
"""
stop()
        if [ $RETVAL -eq 0 ]; then
            ...
            exit 3
        else
            exit 0
        fi
"""
Should be better: exit 0 (or no exit at all) and exit 1 (on the second "exit" line), so, stopping service ends with exit code == 0 in case of success.

Comment 1 Ivana Varekova 2009-09-16 07:40:25 UTC
Fixed in psacct-6.3.2-55.


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