PFclient fails to start due to missing log folder

Discussion in 'Plane Finder' started by Flo Kra, May 10, 2017.

  1. Flo Kra

    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.
    FUNG SAI HOU likes this.
  2. Lee Armstrong

    Lee Armstrong Administrator Staff Member


    Yes indeed it does fail but I will look into seeing if we can get it to create the path if it doesn't exist.

    FUNG SAI HOU likes this.
  3. ab cd

    ab cd Senior Member

    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".

    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"
    [ ! -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
    sudo reboot

    Screenshot from 2017-11-17 13-39-32.png
    Last edited: Nov 17, 2017
    FUNG SAI HOU likes this.

Share This Page