Bug 521828 - firstboot init script is not LSB compliant - returns 3 instead of 2 when missing arguments
Summary: firstboot init script is not LSB compliant - returns 3 instead of 2 when miss...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: firstboot
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: InitScriptsProject
TreeView+ depends on / blocked
 
Reported: 2009-09-08 13:20 UTC by Alexander Todorov
Modified: 2010-01-19 20:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-15 13:47:07 UTC


Attachments (Terms of Use)
firstboot lsb compliance patch (1.35 KB, patch)
2009-09-15 12:13 UTC, Alexander Todorov
no flags Details | Diff

Description Alexander Todorov 2009-09-08 13:20:55 UTC
Description of problem:

service firstboot ; echo $?
Usage: /etc/init.d/firstboot {start|stop}
3



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


How reproducible:
Always

Steps to Reproduce:
1. service firstboot ; echo $?
2.
3.
  
Actual results:
3

Expected results:
2

Additional info:
See:
https://fedoraproject.org/wiki/Packaging/SysVInitScript#Exit_Codes_for_non-Status_Actions
2:	invalid or excess argument(s)

Comment 2 Chris Lumens 2009-09-09 20:10:56 UTC
I'd prefer one bug for the whole pile of things like this.  I'd even more prefer patches, since I'm busily working on a million other things and won't have time to get to script nitpicking any time soon.

Comment 3 Alexander Todorov 2009-09-10 13:37:38 UTC
--- firstboot.orig      2009-09-10 09:33:32.584803675 -0400
+++ firstboot   2009-09-10 09:33:49.785807178 -0400
@@ -76,6 +76,6 @@
 
     *)
         echo $"Usage: $0 {start|stop}"
-        exit 3
+        exit 2
         ;;
 esac

this one fixes the exit code. I have to look more carefully into the other things (to be sure they are valid bugs) and will post patches here.

Comment 4 Chris Lumens 2009-09-10 15:18:37 UTC
Pulled this fix in - thanks.  I'll wait for the rest before closing this bug.

Comment 5 Alexander Todorov 2009-09-15 12:13:57 UTC
Created attachment 361074 [details]
firstboot lsb compliance patch

Patch is against firstboot-1.109-1.fc12.i686 in rawhide. It does:

- add additional # character for the LSB header start/end lines
- add check if root is running the program
- add check if the program executable exists
- add restart/reload/status, etc actions and exit with 3 - not implemented and print usage
- move the usage statement into a function because it's used twice

Changes follow:
https://fedoraproject.org/wiki/Packaging/SysVInitScript

Sections:
Exit_Codes_for_non-Status_Actions
Required actions

You can close the bug after applying this patch.

Comment 6 Chris Lumens 2009-09-15 13:47:07 UTC
Great, thanks for the patch.


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