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 <yangshiji66@outlook.com>
  • Loading branch information
DragonBluep authored and 1 committed Nov 17, 2024
1 parent 616102e commit d716aa7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pppd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ create_pidfile(int pid)
{
FILE *pidfile;

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

0 comments on commit d716aa7

Please sign in to comment.