Bug 521647

Summary: wrong return codes of init script
Product: [Fedora] Fedora Reporter: Milos Malik <mmalik>
Component: ipsec-toolsAssignee: Paul Wouters <pwouters>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 19CC: dkovalsk, tmraz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-14 04:00:40 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    

Description Milos Malik 2009-09-07 12:45:45 UTC
Description of problem:

excerpt from https://fedoraproject.org/wiki/FCNewInit/Initscripts

If the status action is requested, the init script will return the following exit status codes.

    * 0 program is running or service is OK
    * 1 program is dead and /var/run pid file exists
    * 2 program is dead and /var/lock lock file exists
    * 3 program is not running
    * 4 program or service status is unknown
    * 5-99 reserved for future LSB use
    * 100-149 reserved for distribution use
    * 150-199 reserved for application use
    * 200-254 reserved 

Version-Release number of selected component (if applicable):
ipsec-tools-0.7.1-8.fc11

How reproducible:
always

Steps to Reproduce:
# service racoon status
racoon (pid 3380) is running...
# service racoon stop
Stopping racoon: [  OK  ]
# service racoon status
racoon is stopped
# echo $?
0
# 

Actual results:
last exit code is 0

Expected results:
last exit code is 3

Additional info:

Comment 1 Milos Malik 2009-09-07 12:51:17 UTC
Wrong exit codes are visible if either lock or pid file exists:

# touch /var/lock/subsys/racoon
# ls -l /var/lock/subsys/racoon
-rw-r--r--. 1 root root 0 2009-09-07 08:47 /var/lock/subsys/racoon
# service racoon status
racoon dead but subsys locked
# echo $?
0
#

# touch /var/run/racoon.pid
# ls -l /var/run/racoon.pid
-rw-r--r--. 1 root root 0 2009-09-07 08:49 /var/run/racoon.pid
# service racoon status
racoon dead but pid file exists
# echo $?
0
#

Comment 2 Milos Malik 2009-09-10 13:01:06 UTC
According to LSB 3.2 "force-reload" action is mandatory.

excerpt from http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

The start, stop, restart, force-reload, and status actions shall be supported by all init scripts; the reload and the try-restart actions are optional. Other init-script actions may be defined by the init script.

Comment 4 Bug Zapper 2009-11-16 12:00:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2010-11-04 10:11:28 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2010-12-05 06:28:36 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Fedora End Of Life 2013-04-03 20:18:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 9 Fedora Admin XMLRPC Client 2013-11-13 16:17:38 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Paul Wouters 2013-11-14 04:00:40 UTC
I  checked current systemd support and it shows the status fine.

paul@bofh:~/fedora/ipsec-tools (master)$ sudo systemctl start racoon
paul@bofh:~/fedora/ipsec-tools (master)$ sudo systemctl status racoon
racoon.service - Racoon IKEv1 key management daemon for IPSEC
   Loaded: loaded (/usr/lib/systemd/system/racoon.service; disabled)
   Active: active (running) since Wed 2013-11-13 22:59:52 EST; 1s ago
  Process: 20093 ExecStart=/usr/sbin/racoon (code=exited, status=0/SUCCESS)
 Main PID: 20094 (racoon)
   CGroup: name=systemd:/system/racoon.service
           └─20094 /usr/sbin/racoon

Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fedc:bcff%vnet3[500] used as isakmp port (fd=64)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fedc:bcff%vnet3[4500] used as isakmp port (fd=65)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fe64:6423%vnet4[500] used as isakmp port (fd=66)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fe64:6423%vnet4[4500] used as isakmp port (fd=67)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fe32:6423%vnet5[500] used as isakmp port (fd=68)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fe32:6423%vnet5[4500] used as isakmp port (fd=69)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feee:b5a8%vnet2[500] used as isakmp port (fd=70)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feee:b5a8%vnet2[4500] used as isakmp port (fd=71)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feb9:e3e4%vnet1[500] used as isakmp port (fd=72)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feb9:e3e4%vnet1[4500] used as isakmp port (fd=73)
paul@bofh:~/fedora/ipsec-tools (master)$ echo $?
0
paul@bofh:~/fedora/ipsec-tools (master)$ sudo systemctl stop racoon
paul@bofh:~/fedora/ipsec-tools (master)$ sudo systemctl status racoon
racoon.service - Racoon IKEv1 key management daemon for IPSEC
   Loaded: loaded (/usr/lib/systemd/system/racoon.service; disabled)
   Active: inactive (dead)

Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fe32:6423%vnet5[500] used as isakmp port (fd=68)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc00:ff:fe32:6423%vnet5[4500] used as isakmp port (fd=69)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feee:b5a8%vnet2[500] used as isakmp port (fd=70)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feee:b5a8%vnet2[4500] used as isakmp port (fd=71)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feb9:e3e4%vnet1[500] used as isakmp port (fd=72)
Nov 13 22:59:52 bofh.nohats.ca racoon[20094]: INFO: fe80::fc54:ff:feb9:e3e4%vnet1[4500] used as isakmp port (fd=73)
Nov 13 22:59:59 bofh.nohats.ca systemd[1]: Stopping Racoon IKEv1 key management daemon for IPSEC...
Nov 13 22:59:59 bofh.nohats.ca racoon[20094]: INFO: caught signal 15
Nov 13 22:59:59 bofh.nohats.ca racoon[20094]: INFO: racoon process 20094 shutdown
Nov 13 22:59:59 bofh.nohats.ca systemd[1]: Stopped Racoon IKEv1 key management daemon for IPSEC.
paul@bofh:~/fedora/ipsec-tools (master)$ echo $?
3