freebsd-ports/net/socks5/files/socks5.sh.in
Mikhail Teterin f9752c8ba0 A long-standing issue in the vendor's reimplementation of vsnprintf()
was not only inefficient (writing out to a file and then reading back!),
but also had a bug in its handling of va_args.

The most obvious ill-effect was the daemon crashing shortly after
start-up on amd64. The inefficientcy was less obvious, but still there
on all platforms.

Although log.c contained HAVE_VSNPRINTF ifdef-s, the configure script
does not check for the function's presence and never sets the define.

Add the -DHAVE_VSNPRINTF as a simple work-around... Bump PORTREVISION.

Approved by: maintainer

While here, ditch the ancient socks5.sh.sample in favor of the proper
USE_RC_SUBR script based on the maintainer-supplied code.
2007-04-16 04:26:28 +00:00

33 lines
438 B
Bash

#!/bin/sh
#
#
# PROVIDE: socks5
# REQUIRE: DAEMON
#
# Add the following line to /etc/rc.conf to enable socks5
#
# socks5_enable="YES"
#
socks5_enable=${socks5_enable-"NO"}
. /etc/rc.subr
name=socks5
rcvar=`set_rcvar`
pidfile="/var/run/$name.pid-1080"
command=%%PREFIX%%/bin/socks5
stop_cmd=socks5_stop
socks5_stop()
{
echo "Stopping socks5."
kill -9 `cat ${pidfile}`
rm ${pidfile}
}
load_rc_config ${name}
run_rc_command "$1"