Bug 176321

Summary: [PATCH] net/socat: rc script / daemon changes
Product: Ports & Packages Reporter: Mark Felder <feld>
Component: Individual Port(s)Assignee: Emanuel Haupt <ehaupt>
Status: Closed FIXED    
Severity: Affects Only Me CC: ehaupt
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
socat-1.7.2.1_1.patch none

Description Mark Felder freebsd_committer freebsd_triage 2013-02-21 13:40:00 UTC
Last year when I submitted a patch to make socat properly daemonize I was unaware
of the existence of daemon(8). This patch changes the rc script to 
launch socat using daemon and removes the unnecessary wrapper script.

Removed file(s):
- files/socat_wrapper

Port maintainer (ehaupt@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-02-21 13:40:12 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ehaupt

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-03-08 06:40:21 UTC
Author: ehaupt
Date: Fri Mar  8 06:40:12 2013
New Revision: 313620
URL: http://svnweb.freebsd.org/changeset/ports/313620

Log:
  Change rc script to launch socat using daemon and remove the unnecessary
  wrapper script.
  
  PR:		176321
  Submitted by:	Mark Felder <feld@feld.me>

Deleted:
  head/net/socat/files/socat_wrapper
Modified:
  head/net/socat/Makefile
  head/net/socat/files/socat.in

Modified: head/net/socat/Makefile
==============================================================================
--- head/net/socat/Makefile	Fri Mar  8 06:29:31 2013	(r313619)
+++ head/net/socat/Makefile	Fri Mar  8 06:40:12 2013	(r313620)
@@ -3,6 +3,7 @@
 
 PORTNAME=	socat
 PORTVERSION=	1.7.2.1
+PORTREVISION=	1
 CATEGORIES=	net ipv6
 MASTER_SITES=	http://www.dest-unreach.org/socat/download/ \
 		CRITICAL
@@ -21,7 +22,7 @@ MAKE_JOBS_SAFE=	yes
 PORTSCOUT=	skipv:2.0.0-b2
 
 MAN1=		socat.1
-PLIST_FILES=	bin/filan bin/procan bin/socat sbin/socat_wrapper
+PLIST_FILES=	bin/filan bin/procan bin/socat
 PORTDOCS=	EXAMPLES README SECURITY FAQ
 
 .if ${CC} == clang
@@ -36,7 +37,6 @@ do-install:
 .for f in filan procan socat
 	${INSTALL_PROGRAM} ${WRKSRC}/${f} ${PREFIX}/bin
 .endfor
-	${INSTALL_SCRIPT} ${FILESDIR}/socat_wrapper ${PREFIX}/sbin
 	${INSTALL_MAN} ${WRKSRC}/doc/${MAN1} ${MAN1PREFIX}/man/man1
 .if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${DOCSDIR}

Modified: head/net/socat/files/socat.in
==============================================================================
--- head/net/socat/files/socat.in	Fri Mar  8 06:29:31 2013	(r313619)
+++ head/net/socat/files/socat.in	Fri Mar  8 06:40:12 2013	(r313620)
@@ -22,9 +22,13 @@ load_rc_config $name
 
 : ${socat_enable="NO"}
 
-socat_flags="%%PREFIX%%/bin/socat ${socat_flags} &"
-command="%%PREFIX%%/sbin/socat_wrapper"
-command_interpreter="/bin/sh -T"
-pidfile=/var/run/socat_wrapper.pid
+start_cmd="${name}_start"
+pidfile=/var/run/socat.pid
+command="%%PREFIX%%/bin/socat"
+
+socat_start() {
+	echo "Starting ${name}."
+	/usr/sbin/daemon -f -p ${pidfile} ${command} ${socat_flags}
+}
 
 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 3 Emanuel Haupt freebsd_committer freebsd_triage 2013-03-08 06:40:35 UTC
State Changed
From-To: open->closed

Committed, thanks!