freebsd-ports/net/socat/files/socat.in
Emanuel Haupt 5bfdda4b31 Fix startup script issue with a wrapper script obtained from www/gatling.
This wrapper tries to emulate part of the functionality usually supplied by
software like daemontools or runit. It is used to start socat which does not
daemonize itself and logs to stdout/stderr. It redirects stdout and stderr to
logger(1) via a fifo.

While here also remove if-statement around PORTDOCS based on NOPORTDOCS since
it's redundant with checks in ports/Mk/bsd.ports.mk.

PR:		166947
Submitted by:	Mark Felder <feld@feld.me>
2012-04-14 19:05:45 +00:00

30 lines
518 B
Bash

#!/bin/sh
#
# Author: Emanuel Haupt <ehaupt@FreeBSD.org>
#
# $FreeBSD$
#
# PROVIDE: socat
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable socat:
# socat_enable="YES"
# socat_flags="<set as needed>"
. /etc/rc.subr
name="socat"
rcvar=socat_enable
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
run_rc_command "$1"