Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#20569 - [netcfg] Can't disconnect ppp

Attached to Project: Arch Linux
Opened by Cláudio (cvalente) - Monday, 23 August 2010, 11:57 GMT
Last edited by Allan McRae (Allan) - Saturday, 28 April 2012, 14:49 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Rémy Oudompheng (remyoudompheng)
Jouke Witteveen (jouke)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
When using netcfg to configure a ppp connection if while the profile is connected pppd exits then disconnecting, connecting or reconnecting the profile becomes impossible because the pid file can't be found.

Steps to reproduce:
Configure a netcfg ppp profile, start it, kill the pppd process associated with this profile and try to disconnect or reconnect the profile.

A possible "solution"/workaround is to replace the function ppp_down in /usr/lib/network/connections/ppp
with:

ppp_down() {
load_profile "$1"

PIDFILE="/var/run/ppp-$(basename $PEER).pid"

if [[ -e $PIDFILE ]]; then
PID=$(head -1 "/var/run/ppp-$(basename $PEER).pid")
[[ -n "$PID" ]] && kill "$(head -1 "/var/run/ppp-$(basename $PEER).pid")"
fi
}
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 28 April 2012, 14:49 GMT
Reason for closing:  Fixed
Additional comments about closing:  ://projects.archlinux.org/netcfg.git/com mit/?id=93fd21fa
Comment by Jesse Young (jlyo) - Tuesday, 26 October 2010, 01:54 GMT
I can confirm this bug, and the solution looks legit. Though "/var/run/ppp-$(basename $PEER).pid" is repeated where PIDFILE could be used.
Comment by Maciej Sitarz (macieks2) - Thursday, 01 September 2011, 23:53 GMT
The fix commited to repository is not working properly.

The last added line is not necessary, we don't want to "kill $PID" if the PIDFILE doesn't exist.
Comment by Harley Laue (losinggeneration) - Monday, 17 October 2011, 17:57 GMT
Also, what's been committed should use the $PID variable in the kill. There's no reason to call $(head -1 $PIDFILE) a second time. In all it should look like this:

ppp_down() {
load_profile "$1"
PIDFILE="/var/run/ppp-$(basename $PEER).pid"

if [[ -e $PIDFILE ]]; then
PID=$(head -1 $PIDFILE)
[[ -n "$PID" ]] && kill "$PID"
fi
}

Loading...