Bug 169591 - net/serviio rc needs status
Summary: net/serviio rc needs status
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alexander Leidinger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-02 08:40 UTC by Ivan Sy
Modified: 2013-01-28 20:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Sy 2012-07-02 08:40:07 UTC
net/serviio port's rc does not come with "status"

Fix: 

load_rc_config $name
+status_cmd="${name}_status"

 serviio_user=${serviio_user-"dlna"}

@@ -24,6 +25,15 @@
 start_precmd="mkdir -p $_dirs; chown $serviio_user $_dirs"
 command_args="$serviio_args &"

+serviio_status() {
+       serviio_pid=`ps -U ${serviio_user} | grep serviio | grep -v 'grep' | awk '{print $1}'`
+       if [ -n "${serviio_pid}" ]; then
+               echo "$name is running as ${serviio_pid}"
+       else
+               echo "$name is not running"
+       fi
+}
+
 stop_cmd="$command -stop"

 run_rc_command $1--xtp996z9xskdZgcAdXasLpSwVxqU3B5yuhCpYBBWZGbc7stO
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- files/serviio.in.orig       2012-07-02 01:27:37.000000000 -0600
+++ files/serviio.in    2012-07-02 01:29:16.000000000 -0600
@@ -17,6 +17,7 @@
 command=%%PREFIX%%/sbin/serviiod
How-To-Repeat: install net/serviio
execute... /usr/local/etc/rc.d/serviio status

shows "is not running" although it is running...
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-02 08:40:25 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mi

mi@aldan.algebra.com => mi@ (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-02 08:40:29 UTC
Maintainer of net/serviio,

Please note that PR ports/169591 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/169591

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-02 08:40:32 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2013-01-23 03:40:35 UTC
Responsible Changed
From-To: mi->netchild

Over to new maintainer.
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-01-28 19:56:57 UTC
Author: netchild
Date: Mon Jan 28 19:56:45 2013
New Revision: 311134
URL: http://svnweb.freebsd.org/changeset/ports/311134

Log:
  Add support for the status command in the rc script. The change is
  inspired by the patch in the PR.
  
  PR:		ports/169591
  Submitted by:	Ivan Sy <ivan.sy@shaw.ca>

Modified:
  head/net/serviio/Makefile
  head/net/serviio/files/serviio.in

Modified: head/net/serviio/Makefile
==============================================================================
--- head/net/serviio/Makefile	Mon Jan 28 18:07:31 2013	(r311133)
+++ head/net/serviio/Makefile	Mon Jan 28 19:56:45 2013	(r311134)
@@ -3,6 +3,7 @@
 
 PORTNAME=	serviio
 PORTVERSION=	1.1
+PORTREVISION=	1
 CATEGORIES=	net multimedia java www
 MASTER_SITES=	http://download.serviio.org/releases/
 EXTRACT_SUFX=	-linux.tar.gz

Modified: head/net/serviio/files/serviio.in
==============================================================================
--- head/net/serviio/files/serviio.in	Mon Jan 28 18:07:31 2013	(r311133)
+++ head/net/serviio/files/serviio.in	Mon Jan 28 19:56:45 2013	(r311134)
@@ -26,4 +26,14 @@ command_args="$serviio_args &"
 
 stop_cmd="$command -stop"
 
+status_cmd=${name}_status
+serviio_status() {
+	serviio_pid=$(ps -aU ${serviio_user} | awk '/java/ {print $1}')
+	if [ -n "${serviio_pid}" ]; then
+		echo "${name} is running as pid ${serviio_pid}"
+	else
+		echo "${name} is not running"
+	fi
+}
+
 run_rc_command $1
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Alexander Leidinger freebsd_committer freebsd_triage 2013-01-28 19:57:20 UTC
State Changed
From-To: feedback->closed

A modified version of the patch is committed.