Skip to content

Commit

Permalink
Exit codes for status command are not compliant
Browse files Browse the repository at this point in the history
See - http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

The status action is required to return an exit code of `0` if the service is running. If the service is not running a non-zero code is required.
  • Loading branch information
ketan committed May 23, 2014
1 parent 0193f72 commit a419a23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/remote_syslog.init.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ status(){

if (is_running); then
echo "found"
RETVAL=0
else
echo "not found"
RETVAL=1

This comment has been minimized.

Copy link
@samhitov

samhitov Jul 28, 2014

According to the link you included, RETVAL should be 3. 1 is for if the pid file exists.

fi
return $RETVAL

This comment has been minimized.

Copy link
@samhitov

samhitov Jul 28, 2014

This line isn't necessary, as the script already exits with RETVAL as the status code.

}

reload(){
Expand Down

0 comments on commit a419a23

Please sign in to comment.