Bug 193728

Summary: [patch] net/serviio - add rc script exit codes for service monitoring daemons
Product: Ports & Packages Reporter: Jason Unovitch <junovitch>
Component: Individual Port(s)Assignee: Alexander Leidinger <netchild>
Status: Closed FIXED    
Severity: Affects Only Me Flags: netchild: maintainer-feedback-
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch adding exit codes to the serviio rc script status function none

Description Jason Unovitch freebsd_committer freebsd_triage 2014-09-18 00:55:57 UTC
Created attachment 147420 [details]
patch adding exit codes to the serviio rc script status function

Serviio's rc script currently always exits with a 0 from the echo lines in its status function.  This confuses service monitoring daemons as it looks like Serviio is actually running.  A patch that has explicit exit codes is attached that should improve the behavior with anything that expects a 0 as meaning the service is working.


##### BEFORE
root@test-serviio:/usr/local/etc/rc.d # service serviio onestatus
serviio is not running
root@test-serviio:/usr/local/etc/rc.d # echo $?
0
root@test-serviio:/usr/local/etc/rc.d # service serviio onestatus
serviio is running as pid 40239
root@test-serviio:/usr/local/etc/rc.d # echo $?
0

##### AFTER
root@test-serviio:/usr/local/etc/rc.d # service serviio onestatus
serviio is running as pid 40743
root@test-serviio:/usr/local/etc/rc.d # echo $?
0
root@test-serviio:/usr/local/etc/rc.d # service serviio onestatus
serviio is not running
root@test-serviio:/usr/local/etc/rc.d # echo $?
1
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-09-18 00:55:57 UTC
Auto-assigned to maintainer netchild@FreeBSD.org
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-10-18 06:28:44 UTC
A commit references this bug:

Author: netchild
Date: Sat Oct 18 06:28:40 UTC 2014
New revision: 371092
URL: https://svnweb.freebsd.org/changeset/ports/371092

Log:
  Improve the status command of the rc script:
   - return error code if not running [1]
   - narrow down which java process to accept as "running"

  PR:		193728 [1]
  Noticed by:	jason.unovitch@gmail.com [1]

Changes:
  head/net/serviio/Makefile
  head/net/serviio/files/serviio.in
Comment 3 Alexander Leidinger freebsd_committer freebsd_triage 2014-10-18 06:30:33 UTC
Something similar (closer to what is used in rc.subr) is committed now.