Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907311 - net-misc/netifrc with net-dialup/ppp-2.5.0-r2: net.ppp0: did not create a valid pid in `/run/ppp-ppp0.pid' after upgrade
Summary: net-misc/netifrc with net-dialup/ppp-2.5.0-r2: net.ppp0: did not create a val...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: netifrc Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 906089
Blocks: 907274
  Show dependency tree
 
Reported: 2023-05-28 18:49 UTC by Nick Soveiko
Modified: 2023-05-29 00:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Soveiko 2023-05-28 18:49:24 UTC
apparently net-dialup/ppp-2.5.0-r2 writes a pid file under a filename different from what the init script is expecting. ppp0 actually starts, but openrc thinks that it didn't and does not start any services that depend on connectivity.

Reproducible: Always

Steps to Reproduce:
1. emerge =net-dialup/ppp-2.5.0-r2
2. rc-service start net.ppp0
3.
Actual Results:  
May 28 14:22:05 alerik pppd[16521]: Plugin pppoe.so loaded.
May 28 14:22:05 alerik pppd[16521]: PPPoE plugin from pppd 2.5.0
May 28 14:22:05 alerik pppd[16521]: Plugin passwordfd.so loaded.
May 28 14:22:05 alerik pppd[16521]: pppd 2.5.0 started by root, uid 0
May 28 14:22:05 alerik pppd[16521]: Access-Concentrator: *********
May 28 14:22:05 alerik pppd[16521]: Cookie: *********
May 28 14:22:05 alerik pppd[16521]: AC-Ethernet-Address: **********
May 28 14:22:05 alerik pppd[16521]: --------------------------------------------------
May 28 14:22:10 alerik pppd[16521]: PPP session is 4701
May 28 14:22:10 alerik pppd[16521]: Connected to ************ via interface eno1
May 28 14:22:10 alerik pppd[16521]: Using interface ppp0
May 28 14:22:10 alerik pppd[16521]: Connect: ppp0 <--> eno1
May 28 14:22:14 alerik pppd[16521]: PAP authentication succeeded
May 28 14:22:14 alerik pppd[16521]: peer from calling number ******* authorized
May 28 14:22:14 alerik pppd[16521]: local  IP address **.**.**.**
May 28 14:22:14 alerik pppd[16521]: remote IP address ***.***.***.***
May 28 14:22:14 alerik pppd[16521]: primary   DNS address ***.***.***.***
May 28 14:22:14 alerik pppd[16521]: secondary DNS address ***.***.***.**
May 28 14:22:14 alerik pppd[16530]: IPv6 socket creation failed: Address family not supported by protocol
May 28 14:22:14 alerik last message buffered 1 times
May 28 14:22:14 alerik /etc/init.d/net.ppp0[16520]: start-stop-daemon: did not create a valid pid in `/run/ppp-ppp0.pid'
May 28 14:22:14 alerik /etc/init.d/net.ppp0[16364]: ERROR: net.ppp0 failed to start

Expected Results:  
run without errors

/etc/conf.d/net:

------------------------------------------------------------------------------
config_eno1="192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255"
config_ppp0="ppp"
link_ppp0="eno1"
plugins_ppp0="pppoe"
username_ppp0="********@*******"
password_ppp0="**********"
pppd_ppp0="defaultroute
        lcp-echo-interval 3
        lcp-echo-failure 3
        pppoe-verbose 255
        persist
        updetach
        usepeerdns"
rc_net_ppp0_need="firewall !net.usb0"
rc_net_ppp0_provide="internet"
------------------------------------------------------------------------------
Comment 1 Mike Gilbert gentoo-dev 2023-05-28 19:38:32 UTC
net-dialup/ppp does not supply an init script.

/etc/init.d/net.ppp0 is probably a symlink to an init script provided by netifrc.
Comment 2 Nick Soveiko 2023-05-28 19:46:45 UTC
(In reply to Mike Gilbert from comment #1)
> net-dialup/ppp does not supply an init script.
> 
> /etc/init.d/net.ppp0 is probably a symlink to an init script provided by
> netifrc.

you're right.

$ ls -l /etc/init.d/net.ppp0
lrwxrwxrwx 1 root root 6 Nov 22  2021 /etc/init.d/net.ppp0 -> net.lo
$ equery b /etc/init.d/net.lo 
 * Searching for /etc/init.d/net.lo ... 
net-misc/netifrc-0.7.4 (/etc/init.d/net.lo)
Comment 3 Mike Gilbert gentoo-dev 2023-05-28 20:14:24 UTC
If able, please give this patch a try.

https://github.com/gentoo/netifrc/pull/45
Comment 4 Nick Soveiko 2023-05-28 20:34:38 UTC
(In reply to Mike Gilbert from comment #3)
> If able, please give this patch a try.
> 
> https://github.com/gentoo/netifrc/pull/45

same result.

i've checked what ppp-2.5 actually creates in /run:
# ll /run/ppp*
-rw-r--r-- 1 root root 8.0K May 28 14:31 /run/pppd2.tdb
-rw-r--r-- 1 root root   11 May 28 16:28 /run/pppdppp-ppp0.pid
-rw-r--r-- 1 root root    6 May 28 16:28 /run/pppdppp0.pid

/run/pppd:
total 0
drwxr-xr-x  2 root root   60 May 28 14:11 .
drwxr-xr-x 23 root root 1.1K May 28 16:28 ..
lrwxrwxrwx  1 root root    7 May 28 14:11 lock -> ../lock
Comment 5 Mike Gilbert gentoo-dev 2023-05-28 20:46:14 UTC
Ugh, it seems there's a bug that fails to insert a "/" between "/run/pppd" and the pid filename.
Comment 6 Larry the Git Cow gentoo-dev 2023-05-28 21:25:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdeaefbbdb36dfdf8bd040fb3f11fd99bea5136e

commit fdeaefbbdb36dfdf8bd040fb3f11fd99bea5136e
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2023-05-28 21:16:18 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-05-28 21:25:54 +0000

    net-dialup/ppp: fix pidfile path
    
    Bug: https://bugs.gentoo.org/907311
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 net-dialup/ppp/files/ppp-2.5.0-pidfile.patch |  37 +++++++++
 net-dialup/ppp/ppp-2.5.0-r3.ebuild           | 115 +++++++++++++++++++++++++++
 2 files changed, 152 insertions(+)
Comment 7 Mike Gilbert gentoo-dev 2023-05-28 21:26:36 UTC
Please test ppp-2.5.0-r3 with this netifrc PR applied.

https://github.com/gentoo/netifrc/pull/46
Comment 8 Nick Soveiko 2023-05-28 21:34:28 UTC
(In reply to Mike Gilbert from comment #7)
> Please test ppp-2.5.0-r3 with this netifrc PR applied.
> 
> https://github.com/gentoo/netifrc/pull/46

will do, as soon as it propagates down the mirrors.

another thought: shouldn't then net-dialup/ppp depend on the proper version of net-misc/netifrc?
Comment 9 Mike Gilbert gentoo-dev 2023-05-28 21:40:37 UTC
(In reply to Nick Soveiko from comment #8)
> another thought: shouldn't then net-dialup/ppp depend on the proper version
> of net-misc/netifrc?

net-dialup/ppp does not require net-misc/netifrc, so we cannot add such a dependency.
Comment 10 Nick Soveiko 2023-05-28 21:45:41 UTC
(In reply to Mike Gilbert from comment #9)

> net-dialup/ppp does not require net-misc/netifrc, so we cannot add such a
> dependency.

how come it doesn't require if net-misc/netifrc supplies the init script for it?
Comment 11 Mike Gilbert gentoo-dev 2023-05-28 21:51:41 UTC
pppd can be started directly, or via a program like NetworkManager. Neither of these uses care about the init script.
Comment 12 Nick Soveiko 2023-05-28 21:54:06 UTC
sounds to me like a perfect case for a USE flag, no?
Comment 13 Mike Gilbert gentoo-dev 2023-05-28 21:56:22 UTC
Nope.
Comment 14 Mike Gilbert gentoo-dev 2023-05-28 21:58:49 UTC
Such a USE flag is banned by Gentoo policy.

https://projects.gentoo.org/qa/policy-guide/dependencies.html#pg0001
Comment 15 Mike Gilbert gentoo-dev 2023-05-28 22:20:52 UTC
I was able to test this locally in an OpenRC container, and it seems to work with both ppp-2.4.9-r9 and ppp-2.5.0-r3.
Comment 16 Nick Soveiko 2023-05-28 22:56:10 UTC
i'm pleased to confirm that net-dialup/ppp-2.5.0-r3 together with /lib/netifrc/net/ppp.sh patched as in 

https://raw.githubusercontent.com/gentoo/netifrc/2663baa79654c0059eccb27847eabe877eb0330e/net/pppd.sh

work and produce no errors.

thank you!
Comment 17 Mike Gilbert gentoo-dev 2023-05-28 22:57:51 UTC
Thanks for testing!
Comment 18 Larry the Git Cow gentoo-dev 2023-05-29 00:17:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=0ac293faa15b49f08830120e7b5fa1e4523f19e5

commit 0ac293faa15b49f08830120e7b5fa1e4523f19e5
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2023-05-28 20:07:47 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-05-28 22:49:02 +0000

    Update pidfile path for ppp-2.5.0
    
    Bug: https://bugs.gentoo.org/907311
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 net/pppd.sh | 38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)