This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
opencpn.conf gets randomly emptied WALKED AROUND
#8

.pdf   KeepOCPN_conf_Tidy.pdf (Size: 11.17 KB / Downloads: 215)
next and final step :
I have added, as ROOT, that line to /etc/RC.locale :
Code:
/home/pi/KeepOCPN_conf_Tidy
Which makes /etc/RC.locale now like this :
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
 printf "My IP address is %s\n" "$_IP"
fi
/home/pi/KeepOCPN_conf_Tidy
chmod 755 /media/pi
exit 0
note the 3rd line before the bottom of the file.

Let us control its perfect operational condition  :
  1. delete the copy of opencpn.conf from the directory /home/pi/Sauvegardes  (if any)
  2. reboot the RPi, quit OpenCPN if it started ;
  3. check that file opencpn.conf is back in the directory /home/pi/Sauvegardes, its magic ! Smile 
  4. Open in text editor the file /home/pi/.opencpn/opencpn.conf, Select all, delette, save, quit (yes, corrupt opencpn.conf, and check its lengh is Zero.
  5. reboot the RPi
  6. OpenCPN starts like charm ! nothing to reconfigure ...Quit OpenCPN, and check the length of opencpn.conf which should be some k (16k in my case).
Et voilà ... Angel . Should the config be lost, you will not notice it Big Grin 

The only drawback in case of corruption is you will have the configuration of your previous session ..., which is much better than no configuration at all !
I have stamped my desktop with this GOLD rule :
Always quit OpenCPN before stopping the system !



To summarize :
  • create in /home/pi a directory Sauvegardes ; it will accommodate the config file backups
  • copy the file KeepOCPN_conf-Tidy (*) in /home/pi, adjust its properties/access rights in fileman :  Right to execute : everybody
  • copy the file  etc/rc.locale  to etc/rc.locale.orig
  • Add the line in etc/rc.locale as ROOT as explained above
  • Apply above 6 steps control procedure, and you're done !
  • and remember : always quit OpenCPN before stopping the system !
(*) The site's rules prevents me to attach the script file ! Angry

EDIT : see next post
Cordialement
Didier B
Pi4, SSD USB3, OP 3.0 Touch SK 3.2.1 OpenCPN  5.8.4 :  Thank you  Thank you  Thank you


Reply


Messages In This Thread
RE: opencpn.conf gets randomly emptied SOLVED - by Didier B - 2019-05-31, 11:29 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)