Skip to content

Commit

Permalink
pppd: make pid directory before create the pid file
Browse files Browse the repository at this point in the history
If multilink feature is not enabled, the '/var/run/pppd' directory
won't be created before adding pid file.

Fixes error message:
'Failed to create pid file /var/run/pppd/pppoe-wan.pid: No such file or directory'

Signed-off-by: Shiji Yang <[email protected]>
  • Loading branch information
DragonBluep authored and 1 committed Nov 21, 2024
1 parent 3102b0b commit 2fb3a94
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pppd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ create_pidfile(int pid)
{
FILE *pidfile;

mkdir_recursive(PPP_PATH_VARRUN);
slprintf(pidfilename, sizeof(pidfilename), "%s/%s.pid",
PPP_PATH_VARRUN, ifname);
if ((pidfile = fopen(pidfilename, "w")) != NULL) {
Expand Down

0 comments on commit 2fb3a94

Please sign in to comment.