ports/157873: [PATCH] net/dhcprelay: rc.d script does not work
Hiroto Kagotani
hiroto.kagotani at gmail.com
Tue Jun 14 12:20:10 UTC 2011
>Number: 157873
>Category: ports
>Synopsis: [PATCH] net/dhcprelay: rc.d script does not work
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Jun 14 12:20:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Hiroto Kagotani
>Release: FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD myhost.mydomain 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010
>Description:
The rc.d script does not work because of a syntax error.
After the error is fixed, no arguments are passed to the command line.
The attached sample fix was borrowed from net/dhcprelya.
Port maintainer (edwin at mavetju.org) is cc'd.
Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
Install net/dhcprelay and add following lines to /etc/rc.conf:
dhcprelay_enable="YES"
dhcprelay_server="192.168.0.1" # any address
dhcprelay_ifaces="em0" # any iface
And run:
service dhcprelay start
Then you get:
/usr/local/etc/rc.d/dhcprelay: 25: Syntax error: Unterminated quoted string
>Fix:
--- dhcprelay-1.2_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/net/dhcprelay.orig/files/dhcprelay.in /usr/ports/net/dhcprelay/files/dhcprelay.in
--- /usr/ports/net/dhcprelay.orig/files/dhcprelay.in 2011-05-15 11:49:09.000000000 +0900
+++ /usr/ports/net/dhcprelay/files/dhcprelay.in 2011-06-14 20:45:22.000000000 +0900
@@ -12,6 +12,13 @@
# dhcprelay_server dhcprelay server(s)
# dhcprelay_ifaces ethernet interface(s)
+dhcprelay_enable=${dhcprelay_enable:-"NO"}
+
+dhcprelay_precmd ()
+{
+ rc_flags="${rc_flags} ${dhcprelay_ifaces} ${dhcprelay_server}"
+}
+
. /etc/rc.subr
name=dhcprelay
@@ -19,12 +26,8 @@
pidfile=/var/run/${name}.pid
command=%%PREFIX%%/bin/${name}
-command_args="${dhcprelay_ifaces} ${dhcprelay_server}"
-# echo $rc_flags
+start_precmd=${name}_precmd
load_rc_config ${name}
-
-dhcprelay_enable=${dhcprelay_enable:"NO"}
-
run_rc_command "$1"
--- dhcprelay-1.2_1.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list