Bug 524489 - network init script collected problems LSB-compilant
Summary: network init script collected problems LSB-compilant
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: InitScriptsProject
TreeView+ depends on / blocked
 
Reported: 2009-09-20 19:24 UTC by Yulia Kopkova
Modified: 2014-03-17 03:20 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-09-29 15:49:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Yulia Kopkova 2009-09-20 19:24:40 UTC
According to https://fedoraproject.org/wiki/FCNewInit/Initscripts dumpconf init
script have some LSB-compilant problems:

1. LSB Header not complete

2. "start" action for already started service should not fail
now: 1
expected: 0

3. status action should return code "3" for stopped service
   # service network stop
   # service network status ; echo $?
now: 0
expected: 3

3. insufficient rights, there should be return code 4
   # su testuserqa -c "service network restart"; echo $?
now: 0 
expected: 4

4. if network is dead and /var/lock/subsys/network lock file exists then
status action should return code "2".

5. network init script should also support, "condrestart", "try-restart" and
"force-reload" actions.

6. nonexist action should have return code 3 and usage info:
   # service network nonexist ; echo $?   
now: 1
expected: 3 

The reason of filling it is "InitScripts LSB compliance project"

Comment 1 Bill Nottingham 2009-09-21 18:02:24 UTC
(In reply to comment #0)
> 1. LSB Header not complete

Not required -> WONTFIX.

> 2. "start" action for already started service should not fail
> now: 1
> expected: 0

Impractical to fix.

> 3. status action should return code "3" for stopped service
>    # service network stop
>    # service network status ; echo $?
> now: 0
> expected: 3

Breaks historical precedent; not sure it's worth it.

> 3. insufficient rights, there should be return code 4
>    # su testuserqa -c "service network restart"; echo $?
> now: 0 
> expected: 4

Added.

> 4. if network is dead and /var/lock/subsys/network lock file exists then
> status action should return code "2".

Not sensible for this script.

> 5. network init script should also support, "condrestart", "try-restart" and
> "force-reload" actions.

condrestart/try-restart are optional, and not practical here. force-reload added.

> 6. nonexist action should have return code 3 and usage info:
>    # service network nonexist ; echo $?   
> now: 1
> expected: 3 

Fixed.

http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=281379a74c4a22c8c79cd62a90b07867bd9ccbdb

Comment 2 Yulia Kopkova 2009-09-24 12:39:55 UTC
Bill, can you please also fix

6. nonexist action should have return code 3 and usage info:
    # service network nonexist ; echo $?   
 now: 3
 expected: 2


Sorry for that.

Comment 3 Yulia Kopkova 2009-09-29 11:23:42 UTC
3. insufficient rights, there should be return code 4

It returns correct code "4" for "start" and "stop" actions, but "restart" still
return "0".

Comment 4 Bill Nottingham 2009-09-29 15:48:42 UTC
Fixed.


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