pppd 2.5.0 changed lock path, and nothing creates /run/ppp/lock
Upgrading from alpine 3.17 (pppd 2.4.9) to alpine 3.18 (pppd 2.5.0) breaks our LTE modem connection with pppd failing:
Jul 31 10:12:12 armadillo daemon.info pppd[1863]: Plugin /usr/lib/pppd/2.5.0/nm-pppd-plugin.so loaded.
Jul 31 10:12:12 armadillo daemon.warn pppd[1863]: Warning: couldn't open ppp database /run/ppp/pppd2.tdb
Jul 31 10:12:12 armadillo daemon.notice pppd[1863]: pppd 2.5.0 started by root, uid 0
Jul 31 10:12:12 armadillo daemon.err pppd[1863]: Can't create lock file /run/ppp/lock/LCK..ttyUSB3: No such file or directory
Jul 31 10:12:12 armadillo daemon.info pppd[1863]: Exit.
Creating /run/ppp/lock manually works around the issue; which can also be reproduced with plain pppd (this command used to "work" in 2.4.9 -- as in, it'll fail a bit later because stdin is not a tty, but lock is obtained in /var/lock/LCK..stdin
):
armadillo:~# nohup pppd nodetach lock stdin | cat
nohup: ignoring input and redirecting stderr to stdout
Warning: couldn't open ppp database /run/ppp/pppd2.tdb
Can't create lock file /run/ppp/lock/LCK..stdin: No such file or directory
The difference is likely due to this commit: https://github.com/ppp-project/ppp/commit/66a8c74c3f73d7480a09923a225b56b8829ae790#diff-1917e5d26ef15452c3409c2d846766eee1634dbb04e6cba29bd31fd02e6d2b87L784
The easiest fix would be to just go along with the commit and configure with --with-runtime-dir=/run
-- lock will move from /var/lock to /run/lock but at least that directory exists (PPP_PATH_LOCKDIR
is defined as PPP_PATH_VARRUN "/lock"
on our platform, so setting runtime dir works)
However it's a good thing in general to have a separate rundir -- that'd allow to run pppd as a non-root user.
We don't have a usecase for this so I don't care enough to go through the tmpdirs hole I've already fell in previously, but I figured it's better to bring it up first.
If we go through the 'configure back to /run' path I'll be happy to submit a patch, but that's not the hard part here :)
Thoughts ?