aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorpgollucci <pgollucci@FreeBSD.org>2009-07-23 01:27:20 +0800
committerpgollucci <pgollucci@FreeBSD.org>2009-07-23 01:27:20 +0800
commit085769af7f552f23ce382de051efce4d1f94b15d (patch)
treeadfae95209fdcf9139148c8959c17fb3489b97ea /net
parent3ea2dd36a05dcaa279bc76c94d0ca71abfce1de3 (diff)
downloadfreebsd-ports-gnome-085769af7f552f23ce382de051efce4d1f94b15d.tar.gz
freebsd-ports-gnome-085769af7f552f23ce382de051efce4d1f94b15d.tar.zst
freebsd-ports-gnome-085769af7f552f23ce382de051efce4d1f94b15d.zip
- USE_RC_SUBR != yes
PR: ports/136846 Approved by: maintainer Submitted by: myself (pgollucci@)
Diffstat (limited to 'net')
-rw-r--r--net/quoted/Makefile7
-rw-r--r--net/quoted/files/patch-quoted.sh.rc.freebsd20
-rw-r--r--net/quoted/files/quoted.in74
3 files changed, 76 insertions, 25 deletions
diff --git a/net/quoted/Makefile b/net/quoted/Makefile
index aa099beb7a51..1185d1ab259b 100644
--- a/net/quoted/Makefile
+++ b/net/quoted/Makefile
@@ -7,6 +7,7 @@
PORTNAME= quoted
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.mrp3.com/webutil/
@@ -18,10 +19,6 @@ MANCOMPRESSED= no
GNU_CONFIGURE= yes
USE_GMAKE= yes
-USE_RC_SUBR= yes
-RC_SUFX= .sh
-
-post-patch:
- @${REINPLACE_CMD} -e "s,/usr/local,${PREFIX},g; s,/etc/rc.subr,${RC_SUBR},g;" ${WRKSRC}/quoted.sh.rc.freebsd
+USE_RC_SUBR= ${PORTNAME}
.include <bsd.port.mk>
diff --git a/net/quoted/files/patch-quoted.sh.rc.freebsd b/net/quoted/files/patch-quoted.sh.rc.freebsd
deleted file mode 100644
index 662491ea6b37..000000000000
--- a/net/quoted/files/patch-quoted.sh.rc.freebsd
+++ /dev/null
@@ -1,20 +0,0 @@
---- quoted.sh.rc.freebsd.orig Thu Dec 2 02:20:30 2004
-+++ quoted.sh.rc.freebsd Wed Jun 1 14:34:54 2005
-@@ -16,7 +16,7 @@
- name="quoted"
- rcvar=`set_rcvar`
- command="${dir}/${name}"
--command_args="-d"
-+command_args="-d -p:17"
- command_plus_args="${command} ${command_args}"
- pidfile="/var/run/${name}.pid"
- required_files="${etc}/quotes"
-@@ -31,7 +31,7 @@
- if [ -e ${required_files} ] ; then
- ${command_plus_args}
- sleep 1
-- pid=`ps -aewx -o "pid,command" | grep -- "${command_plus_args}" | grep -v "grep" | awk '{ print \$1; }'`
-+ pid=`ps ax | awk '{if (match($5, ".*/quoted$") || $5 == "quoted") print $1}`
- if [ -z ${pid} ]; then
- echo "${name} failed to start"
- return 1
diff --git a/net/quoted/files/quoted.in b/net/quoted/files/quoted.in
new file mode 100644
index 000000000000..d9ceb2cec98a
--- /dev/null
+++ b/net/quoted/files/quoted.in
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# PROVIDE: quoted
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+# AUTHOR: Bob Frazier
+
+quoted_enable=${quoted_enable:-"NO"}
+
+user="nobody"
+
+. %%RC_SUBR%%
+
+name="quoted"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/${name}"
+command_args="-d -p:17"
+command_plus_args="${command} ${command_args}"
+pidfile="/var/run/${name}.pid"
+required_files="%%PREFIX%%/etc/quotes"
+
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+
+quoted_start()
+{
+ pid=$(check_pidfile ${pidfile} ${command})
+ if [ -z ${pid} ]; then
+ if [ -e ${required_files} ] ; then
+ ${command_plus_args}
+ sleep 1
+ pid=`ps ax | awk '{if (match($5, ".*/quoted$") || $5 == "quoted") print $1}`
+ if [ -z ${pid} ]; then
+ echo "${name} failed to start"
+ return 1
+ else
+ echo ${pid} >${pidfile}
+ echo "${name} started."
+ pid=$(check_pidfile ${pidfile} ${command})
+ if [ -z ${pid} ]; then
+ echo "Warning: pid file ${pidfile} is corrupt."
+ echo "The ${name} daemon may not stop properly via the rc.d script."
+ fi
+ return 0;
+ fi
+ else
+ echo "Required file(s) ${required_files} missing"
+ fi
+ else
+ echo "${name} is already running"
+ return 0
+ # not an error
+ fi
+
+# if I get here something went wrong
+ return 2
+}
+
+quoted_stop()
+{
+ pid=$(check_pidfile ${pidfile} ${command})
+ if [ -z ${pid} ]; then
+ echo ${name} not running? Check ${pidfile}
+ return 1
+ fi
+ echo "Stopping ${name}"
+ kill -${sig_stop:-TERM} ${pid}
+ [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
+ wait_for_pids ${pid}
+}
+
+load_rc_config $name
+run_rc_command "$1"
+