--- pppd.orig 2005-11-10 23:44:22.000000000 +0200 +++ pppd 2005-11-11 01:54:28.960030592 +0200 @@ -16,8 +16,8 @@ # Returns 1 if pppd is installed, otherwise 0 pppd_check_installed() { if [[ ! -x /usr/sbin/pppd ]]; then - ${1:-false} && eerror "For PPP support, emerge net-dialup/ppp" - return 1 + ${1:-false} && eerror "For PPP support, emerge net-dialup/ppp" + return 1 fi return 0 } @@ -101,6 +101,8 @@ # # Returns 0 (true) when successful, otherwise 1 pppd_start() { + ${IN_BACKGROUND} && return 0 + local iface="$1" ifvar=$( bash_variable "$1" ) opts="" link if [[ ${iface%%[0-9]*} != "ppp" ]]; then eerror "PPP can only be invoked from net.ppp[0-9]" @@ -114,8 +116,8 @@ fi # PPP requires a link to communicate over - normally a serial port - # PPPoE communicates over ethernet - # PPPoA communictes over ATM + # PPPoE communicates over Ethernet + # PPPoA communicates over ATM # In all cases, the link needs to be available before we start PPP eval link=\"\$\{link_${ifvar}\}\" if [[ -z ${link} ]]; then @@ -225,6 +227,11 @@ insert_link_in_opts=0 fi + if [[ " ${opts} " == *" plugin pppoatm.so "* ]]; then + # Load the pppoa kernel module - if this fails, we have to hope + # that pppoa support is compiled into the kernel + modprobe pppoatm 2>/dev/null + fi [[ ${insert_link_in_opts} -eq 0 ]] || opts="${link} ${opts}" ebegin "Running pppd" @@ -234,6 +241,8 @@ if [[ " ${opts} " == *" updetach "* ]]; then local addr=$( interface_get_address "${iface}" ) einfo "${iface} received address ${addr}" + else + go_background fi } @@ -244,6 +253,8 @@ # Returns 0 (true) if no process to kill or it terminates successfully, # otherwise non-zero (false) pppd_stop() { + ${IN_BACKGROUND} && return 0 + local iface="$1" pidfile="/var/run/ppp-$1.pid" [[ ! -s ${pidfile} ]] && return 0