Issue of RasPi 3B with DietPi OS & PFClient 3.7.20

Discussion in 'ADS-B Software' started by FUNG SAI HOU, Nov 16, 2017.

  1. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hello there,

    I am new in Linux and ADSB.

    I am using DietPi OS on RasPi 3B with updated OS installed. Below is what I got from putty ssh. The pfclient cannot start automatically after each boot. It has to be started manually. I did create folder & log for "/var/log/pfclient/error.log" as per stated. But it still not working after each boot.

    pfclient failed to initiat 01.JPG


    [email protected]:~# sudo service pfclient status
    ‚óŹ pfclient.service - LSB: planefinder.net ads-b decoder
    Loaded: loaded (/etc/init.d/pfclient)
    Active: failed (Result: exit-code) since Thu 2017-11-16 17:12:05 +08; 2min 27s ago
    Process: 455 ExecStart=/etc/init.d/pfclient start (code=exited, status=2)

    Nov 16 17:12:05 DietPi pfclient[455]: Starting pfclient: pfclient/etc/init.d/pfclient: 35: /etc/init.d/pfclient: cannot create /var/log/pfclient/error.log: Directory nonexistent
    Nov 16 17:12:05 DietPi pfclient[455]: failed!
    Nov 16 17:12:05 DietPi systemd[1]: pfclient.service: control process exited, code=exited status=2
    Nov 16 17:12:05 DietPi systemd[1]: Failed to start LSB: planefinder.net ads-b decoder.
    Nov 16 17:12:05 DietPi systemd[1]: Unit pfclient.service entered failed state.
    Hint: Some lines were ellipsized, use -l to show in full.
    [email protected]:~#


    Any experts can help me to solve this issue?

    In the mean time, all other ADSB feeders & ADSB beast are working fine like FlightAware Piaware, Dump1090-fa, Opensky-Feeder & FlightRadar24.

    I wish I can get it fixed as I don't want to use Raspbian Jessie. DietPi is lightweight and the interface is more comfortable to me.

    Thank you and I look forward to hearing from you soon.

    Regards,
    Fung SH
     
  2. Lee Armstrong

    Lee Armstrong Administrator Staff Member

    Is /var/log/ on TempFS and cleared after each reboot by any chance?
     
    FUNG SAI HOU likes this.
  3. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hi Lee Armstrong,

    Thank you for the reply.

    How to access or check on it? Because I am not well familiar with Linux Debian / Raspbian etc. Hope to get more detail on this.

    Would you mind to explain it step by step on it?

    Thank you.
     
  4. Lee Armstrong

    Lee Armstrong Administrator Staff Member

    Hello,

    I would suggest if you are not too familiar with Linux that you stick to Raspbian. This is the OS we support for the client as it just works out of the box. Other distributions work but you are on your own a little bit as there are so many.

    I suspect the issue you have is that the /var/log/pfclient directory is being lost on a reboot.
    • You could change the init script for the pfclient to use a different log location that does not get cleared on a reboot
    • Create the log directory on reboot
    Hope that offers some pointers.
     
    FUNG SAI HOU likes this.
  5. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hi Lee Armstrong,

    Thanks again for the info. The /var/log/pfclient directory is there after reboot.

    I have no idea why only this version of DietPi for Raspberry Pi has issue? I have other Orange Pis with DietPi OS Installed and all the pfclient is working fine.

    I bought these PIs and installed DietPi on the OPI Zero & OPI PC without any issue. The RasPI 3B with Raspbian Jessie can works well but DietPi NOT.

    I hope that there is / are solution(s) to get it fixed in future. I really love the DietPi instead of Raspbian as DietPi OS has lots of user friendly shortcuts but Raspbian doesn't have.

    Anyway, just forget this at this moment. Will try to look for help from others. Thank you again.
     
  6. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hi Lee Armstrong,

    Good news, I finally solved it by refer to the other forum topic.

    https://forum.planefinder.net/threads/pfclient-fails-to-start-due-to-missing-log-folder.1001/

    I modified it as per described. Anyway, hopefully it can fixed in the future.

    pfclient failed to initiate 03 (FIXED).JPG
    Thank you once again.
     
    Last edited: Nov 16, 2017
    Lee Armstrong likes this.
  7. ab cd

    ab cd Senior Member

    Failure of pfclient and lighttpd also happens if installed on Flightradar24 OS "Pi24".

    The reason is that there is a tmpfs entry for /var/log folder in Pi24's /etc/fstab file.
    This entry causes deletion of contents of /var/log folder on reboot.
    Unfortunately both pfclient and lighttpd are unable to recreate their log files on reboot, and crash.

    Couple of months ago, I have raised this issue, as well as posted workaround, in this thread :

    How to Feed Data to Multiple Sites - A Brief Guide

    (raised issue in post#1, provided workaround in post #2, more details in post #3).



     
    Last edited: Nov 16, 2017
    FUNG SAI HOU likes this.
  8. ab cd

    ab cd Senior Member

    This method enables re-generation of error file by pfclient at reboot directly in folder /var/log.
    This prevents crash of pfclient at reboot.

    However this method does not re-create folder /var/log/pfclient.
    The folder pfclient also holds log files "pfclient-log_xxxxxxxxxx.log"

    In the absence of folder pfclient, in which folder the log files "pfclient-log_xxxxxxxxxx.log" are saved/available?
     
    FUNG SAI HOU likes this.
  9. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hi ab cd,

    Thanks fir sharing info on this. Yes, I saw these logs pfclient-log_xxxxxxxxxx.log where xxxxxxxxxx looks like date/time if not mistaken.

    Now at least can start pfclient after each boot / reboot.

    Cheers & Regards.
     
  10. ab cd

    ab cd Senior Member


    Hi FUNG SAI HOU

    I faced similar situation on OrangePi PC with Armbian 5.25. It was for lighttpd, but it should have affected pfclient also (at that time I did not check for pfclient).

    The logs were written to ram, and not on microSD card. As a result contents of folder /var/log were wiped out on reboot. l contacted Igor (the guy who created and maintains Armbian) and based on his advise did following solution (i.e in file /etc/default/log2ram, changed ENABLED=true to ENABLED=false):

    Code:
    sudo nano /etc/default/log2ram
    # configuration values for the log2ram service
    ENABLED=false
    SIZE=50M
    USE_RSYNC=false
    
    Ctrl+o (save), Ctrl+x (close file & nano editor)

    Now reboot
    Code:
     sudo reboot
    
    See these threads:
    (1) https://discussions.flightaware.com/t/run-from-external-hard-drive/20102/2

    (2) https://discussions.flightaware.com...alternative-to-rpi-2-so-far-so-good/17647/240

     
  11. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hi ab cd,

    Yes. Thank you for sharing such a great info.

    I will take note on this once I face this issue in the future.

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

    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: Nov 17, 2017
  13. FUNG SAI HOU

    FUNG SAI HOU New Member

    Hi ab cd,

    I tried on it and it worked. I changed it back to its original with "start-stop-daemon --start --exec $DAEMON -- -d -i $PIDFILE -z $CONFIGFILE -y $LOGFILE $ 2>/var/log/pfclient/error.log" and adding with your "[ ! -d "/var/log/pfclient" ] && mkdir -p /var/log/pfclient" as per instruction, save it and reboot. pfclient can start automatically.

    You saved my day. Thank you for the advise.

    Regards & have a nice weekend.
     
  14. ab cd

    ab cd Senior Member

    @FUNG SAI HOU
    Thank you, and a nice weekend to you too.

    A tip for posting code texts:
    Use
    [*code] above (without *)
    and
    [*/code] below (without *)

    like in this screenshot below

    2017-11-17 18.06.49-R.jpg




    When you post, it will appear like this:
    Code:
    start-stop-daemon --start --exec
    $DAEMON -- -d -i
    $PIDFILE -z
    $CONFIGFILE -y
    $LOGFILE $ 2>/var/log/pfclient/error.log
    

    Code:
    [ ! -d "/var/log/pfclient" ] && mkdir -p /var/log/pfclient
    
     
    Last edited: Nov 18, 2017
    FUNG SAI HOU likes this.
  15. ab cd

    ab cd Senior Member


    FURTHER INVESTIGATIONS
    The DietPi has 4 option to choose from logging system.

    (1) None: Selecting this option will uninstall DietPi-Ramlog, Logrotate, Rsyslog.
    (2) DietPi-Ramlog #1 (Default): Mounts /var/log to RAM. Logfiles are cleared every hour. Does NOT save logfiles to disk.
    (3) DietPi-Ramlog #2: Same as #1, with the added feature of saving logfile contents to disk (/root/logfile_storage/*), before being cleared.
    (4) Full: Mounts /var/log to DISK. Full logging system with Logrotate and Rsyslog.

    Options (2) and (3) cause the failure of pfclient on reboot.
    If you wan to use these options, then edit file /etc/init.d/pfclient as shown in
    my post #12 above.

    Options (1) and (4) DO NOT cause the failure of pfclient on reboot.
    If you want to use these options, there will be no need for any editing of file /etc/init.d/pfclient.


    HOW TO SET/CHANGE LOGGING SYSTEM:
    (1) Give following command.
    Code:
    [email protected]:~# dietpi-software
    
    (2) On the dialog window opened, scroll down to Log System and press Enter key
    Screenshot from 2017-11-18 14-01-43.png

    (3) On the dialog window choose one of 4 options you want to set, and press Enter key. dialog will confirm selection made. Press Enter Key.
    Screenshot from 2017-11-18 14-04-19.png

    (4) On dialog window opened, scroll down to "Install Go >> Start Installation...", and press Enter Key.
    Wait for installation to complete.
    After installation is complete, DietPi will reboot automatically with new settings.
    Screenshot from 2017-11-18 14-09-01.png

     
    Last edited: Nov 18, 2017
    FUNG SAI HOU likes this.
  16. FUNG SAI HOU

    FUNG SAI HOU New Member

    ab cd,

    Yes. I noticed that Dietpi-config has such feature. This is why I choose DietPi for my Primary OS for all these small board PC.

    The only disadvantages for this version of DietPi for OPi PC is the RasPi-Monitor is not available when compared to RasPi 3B or OPi Zero. I managed to install it but somehow the Memory show UNDEFINED. No matter how I look at the other 2 DietPi RasPi-Monitor everything seems to be the same /etc/rpimonitor/template/memory.conf , for this I just leave it there... As the Statistic Page for Memory still working fine.

    Once again, thanks for the great info on this. You are so great and helpful. I will get another OPi PC or NanoPi Neo etc to play around with ADSB.

    Have a great day.
     
    ab cd likes this.

Share This Page