Summary: | [patch] ports/net-mgmt/arpwatch's rcNG script does not handle 'restart' | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Eugene Grosbein <ports> | ||||
Component: | Individual Port(s) | Assignee: | Johan van Selst <johans> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | ||||||
Priority: | Normal | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Eugene Grosbein
2006-08-28 12:20:22 UTC
State Changed From-To: open->feedback Awaiting maintainers feedback Hi! There is another issue with this rcNG script. Using settings explained in the How-To-Repeat section, the script starts arpwatch without arguments while /etc/rc performes initial boot of the OS, that's bad. Being started manually when $1 is 'start', it starts arpwatch with needed arguments. But during initial boot $1 is 'faststart'. This is because 'arpwatch_interfaces=' at the beginning of the script that erases value set from /etc/rc.conf by rcorder before our script starts. /etc/rc.conf will not be sourced once more when out script runs during initial boot sequence so all /etc/rc.conf settings become lost. Corrected path follows. It does the following: - 'arpwatch_dir' now may be set in /etc/rc.conf and its value won't be redifined by force with %%PREFIX%%/arpwatch/. This makes sense for NanoBSD that generally keep /usr/local/arpwatch/ onto flash that is mounted read-only, so arpwatch_dir needs to be redifined to something like /var/arpwatch; - arpwatch_interfaces now is not ignored during faststart and restart. --- files/arpwatch.sh.in.orig Mon Aug 28 17:38:19 2006 +++ files/arpwatch.sh.in Tue Aug 29 01:23:02 2006 @@ -11,8 +11,7 @@ #arpwatch_enable="YES" # arpwatch_enable=${arpwatch_enable:-"NO"} -arpwatch_dir="%%PREFIX%%/arpwatch/" -arpwatch_interfaces= +arpwatch_dir=${arpwatch_dir:-"%%PREFIX%%/arpwatch/"} . %%RC_SUBR%% @@ -63,15 +62,17 @@ ;; *) - if [ "$1" = "start" ]; then + case "$1" in + *start) for interface in ${arpwatch_interfaces}; do eval options=\$arpwatch_${interface}_options command_args="-i ${interface} ${options} -f arp.${interface}.dat" - pidfile="/var/run/arpwatch-${interface}.pid" run_rc_command "$1" done - else + ;; + *) run_rc_command "$1" - fi + ;; + esac ;; esac http://www.freebsd.org/cgi/query-pr.cgi?pr=102600 I concur with the amended patch, please commit. Thanks. Thomas State Changed From-To: feedback->closed Committed, thanks. Responsible Changed From-To: freebsd-ports-bugs->johans Committed, thanks. johans 2006-09-21 09:27:14 UTC FreeBSD ports repository Modified files: net-mgmt/arpwatch/files arpwatch.sh.in Log: - Fix rcNG script (handle restart, allow $arpwatch_dir setting) PR: ports/102600 Submitted by: Eugene Grosbein Approved by: Thomas Abthorpe (maintainer) Revision Changes Path 1.6 +8 -6 ports/net-mgmt/arpwatch/files/arpwatch.sh.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" |