PFclient fails to start due to missing log folder

Flo Kra

New Member
I run PFclient 3.7.1 on an Orange Pi Zero with armbian stable image and realized that - after rebooting the board - pfclient would never start again, so I hat a look on that.

The pfclient init script sets the error log to /var/log/pfclient/error.log - it seems that this directory /var/log/pfclient is created during packet installation. Unfortunately, after a reboot, the /var/log folder is completely empty and the pfclient folder is gone, as armbian redirects /var/log to a RAM disk. Therefore after a reboot pfclient is unable to start due to the fact that the log folder does not exist.
To solve the issue I changed the /var/log/pfclient/error.log to /var/log/pfclient.err in the init script /etc/init.d/pfclient .

Possibly good to know if someone has the same issue, and possibly this could be addressed by the developers in a future version.
 

I found a better way to do it.
Instead of changing location of logfile error.log, I added a line of code which:
Checks if directory "/var/log/pfclient" exists or not.
If the directory exists, this line does nothing further.
If the directory does NOT exists, it creates the directory.
Creation of directory enables creation/saving of both the files "error.log" and "pfclient-log_xxxxxxxxxx.log".

Code:
sudo nano /etc/init.d/pfclient

The above command will open the file /etc/init.d/pfclient for editing.
Add following line just below line "### END INIT INFO"
Code:
[ ! -d "/var/log/pfclient" ] && mkdir -p /var/log/pfclient
Save (Ctrl+o) and close editor (Ctrl+x)


Reboot the Pi for changes to take effect
Code:
sudo reboot


Screenshot from 2017-11-17 13-39-32.png
 
Last edited:
Back
Top