My Openhab2 isnt starting since the first installation. For the first runtime it worked, after this is get the following errorlog.
Its running on a Raspberry Pi 3, Raspbian, Snapshot Release
Thats all running on a Raspbee Image togethter with Homegear. It was working an a very old snapshot release, now i tried to port it to a newer release. Can someone help me?
maybe it has something to do with the following post?
syslog
Jan 15 09:00:35 raspberrypi systemd[1]: Starting openHAB 2 - empowering the smart home...
Jan 15 09:00:35 raspberrypi systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 15 09:00:35 raspberrypi start.sh[23099]: Launching the openHAB runtime...
Jan 15 09:00:37 raspberrypi start.sh[23099]: /var/log/openhab2/openhab.log (No such file or directory)
Jan 15 09:00:37 raspberrypi systemd[1]: openhab2.service: main process exited, code=exited, status=255/n/a
Jan 15 09:00:38 raspberrypi stop[23239]: stop: Ignoring predefined value for KARAF_HOME
Jan 15 09:00:39 raspberrypi stop[23239]: Can't connect to the container. The container is not running.
Jan 15 09:00:39 raspberrypi systemd[1]: openhab2.service: control process exited, code=exited status=1
Jan 15 09:00:39 raspberrypi systemd[1]: Unit openhab2.service entered failed state.
Jan 15 09:00:40 raspberrypi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Jan 15 09:00:40 raspberrypi systemd[1]: Stopping openHAB 2 - empowering the smart home...
java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)
sudo /bin/systemctl status openhab2.service -l
â—Ź openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Sun 2017-01-15 08:57:21 CET; 96ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 9142 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, stat us=1/FAILURE)
Main PID: 9294 (karaf)
CGroup: /system.slice/openhab2.service
├─9294 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─9321 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─9323 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─9324 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─9328 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
└─9329 expr lrwxrwxrwx 1 root root 22 Nov 25 18:51 /usr/bin/java -> / etc/alternatives/java : .*-> \(.*\)$
Jan 15 08:57:21 raspberrypi systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 15 08:57:21 raspberrypi start.sh[9294]: Launching the openHAB runtime...
thank you seems to work now. I still have to do some testing but looks good. I didnt thought the error would be so simple, thats why i didnt test this solution by my self.
There seems to be something wrong with the apt installation, because i tried this on two fresh image and i was able to reproduce this error…
yup every restart only the openhab log folder is gone. Every other log folder even the homegear folder is still in place.
Iam not an expert with linux, so how can i fix this exactly? I tried to google this but it confuses me.
No problem, but I would like to mention what that particular line does.
TMPFS stops the files in that directory from being written to disk. It gets written to ram instead, many people using SD cards like to have this feature as SD lifespan is limited to number of writes.
One of the side effects as you have seen is that all info in that folder is lost on reboot, so for programs that need files in there, one will have to run a script at boot to create the directory and handle ownership.
Hope that makes things clearer about what happened.
Removing the last line will solve your boot problem but your log folder will go back to the sdcard reducing drasticaly its lifetime as detailled by @Benjy.
Here is a solution that worked for me (add the folder creation into crontab): sudo crontab -e
add the following lines: @reboot mkdir /var/log/openhab2 @reboot chown -R openhab:openhab /var/log/openhab2