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>
30 lines
518 B
Bash
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"
|