Date: Sat, 4 Nov 2006 16:06:25 +0100 (CET) From: Ulrich Spoerlein <uspoerlein@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/105145: [PATCH] add redial function to rc.d/ppp Message-ID: <200611041506.kA4F6PSD015784@roadrunner.q.local> Resent-Message-ID: <200611041751.kA4HpgJe018069@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 105145 >Category: conf >Synopsis: [PATCH] add redial function to rc.d/ppp >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Nov 04 17:51:39 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Ulrich Spoerlein >Release: FreeBSD 6.2-PRERELEASE i386 >Organization: >Environment: >Description: ppp(8) in auto or redial mode can be instructed to redial by sending SIGINT to the process. I always forget, which signal it is and have to look it up. To short-circuit this, teach rc.d/ppp to issue the redial >How-To-Repeat: >Fix: --- ppp.patch begins here --- Index: ppp =================================================================== RCS file: /home/ncvs/src/etc/rc.d/ppp,v retrieving revision 1.12 diff -u -p -r1.12 ppp --- ppp 26 Oct 2006 00:29:43 -0000 1.12 +++ ppp 4 Nov 2006 15:03:37 -0000 @@ -14,6 +14,8 @@ rcvar=`set_rcvar` command="/usr/sbin/${name}" start_precmd="ppp_precmd" start_postcmd="ppp_postcmd" +redial_cmd="ppp_redial" +extra_commands="redial" ppp_precmd() { @@ -46,5 +48,23 @@ ppp_postcmd() /etc/rc.d/pf resync } +ppp_redial() +{ + # Only sent SIGINT when in auto or ddial mode. See ppp(8) + if [ "${ppp_mode}" = "ddial" -o "${ppp_mode}" = "auto" ]; then + if [ -z "$rc_pid" ]; then + if [ -n "$pidfile" ]; then + echo 1>&2 "${name} not running? (check $pidfile)." + else + echo 1>&2 "${name} not running?" + fi + return 1 + fi + + kill -SIGINT $rc_pid + fi + +} + load_rc_config $name run_rc_command "$1" --- ppp.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611041506.kA4F6PSD015784>