Bug 193728 - [patch] net/serviio - add rc script exit codes for service monitoring daemons
Summary: [patch] net/serviio - add rc script exit codes for service monitoring daemons
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexander Leidinger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-18 00:55 UTC by Jason Unovitch
Modified: 2014-10-18 06:30 UTC (History)
0 users

See Also:
netchild: maintainer-feedback-


Attachments
patch adding exit codes to the serviio rc script status function (408 bytes, patch)
2014-09-18 00:55 UTC, Jason Unovitch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.