brenndorfler Posted September 4, 2015 Posted September 4, 2015 Hi, I'm using the Igor-Image: Linux cubieboard2 4.0.5-cubietruck #12 SMP Thu Jun 11 19:18:02 CEST 2015 armv7l GNU/Linux I installed a program that is using a PID-file, normally under: /var/run/fhem/fhem.pid I created a sub-folder and changed the owner and permissions. With the next reboot, all changes where lost. I noticed that the /var/run is linked to /run and this is a tmpfs. So, is there an option to add a subdirectory permanently to /run? Alternatively I will add a short script, that will do these operations after reboot, but in my opinion, that is not the fancy way... greets brenndorfler
tkaiser Posted September 4, 2015 Posted September 4, 2015 A tmpfs is empty after reboot by design. So unless you populate it eg. from /etc/rc.local (which distro do you use? Wheezy, jessie, trusty?) or use daemons like tmpfs-populate another approach would be to let the PID file reside somewhere else (again: without details which distro you're using it's impossible to help).
brenndorfler Posted September 4, 2015 Author Posted September 4, 2015 which distro do you use? Wheezy, jessie, trusty? Sorry, I only mentioned it in the topic title: It is Debian 8 / Jessie ... Yes, I understand that a tmpfs is empty by default and that it is populated early in the boot-process. But: Where/How is this task normally configured?
tkaiser Posted September 4, 2015 Posted September 4, 2015 Sorry, I only mentioned it in the topic title: It is Debian 8 / Jessie ... Sorry, I've overseen that. If you're using the forking method to start FHEM I would uncomment/adjust $PIDFile in /etc/systemd/system/fhem.service as well set attr global pidfilename /path/to/fhem.pid in fhem.cfg. And let that point to a mountpoint not residing on a tmpfs. Or you add a simple [ -d /var/run/fhem ] || mkdir -p /var/run/fhem to the startscript or in your case systemd service (I assume you're using systemd and not SysV init -- it seems to be possible to use Jessie with the latter too)
brenndorfler Posted September 4, 2015 Author Posted September 4, 2015 I installed the fhem.deb-Package and did an update via the fhem-program itself. This package comes still with SysV init -Script. Thanks for the hint, the init-script is really a good place to create the folder and set the permissions. My /etc/init.d/fhem looks now like: case "$1" in 'start') echo "Starting fhem..." [ -d /var/run/fhem ] || { mkdir -p /var/run/fhem; chmod a+w /var/run/fhem; } Thanks! brenndorfler
Recommended Posts