From the log files this seems to be the main issue. Any idea what this is and how it can be installed?
Ok, I retried. Took a clean image. How I started:
sudo apt-get update
sudo apt-get remove openhab-runtime
java -version
sudo apt-get install screen mc vim git htop
sudo apt-get install oracle-java8-jdk
sudo echo 'deb http://dl.bintray.com/openhab/apt-repo2 testing main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
sudo apt-get update
sudo reboot
sudo nano ~/emonpi/rc.local_jessieminimal
Changed line 11 openhab to openhab2
Changed line 17 /var/log/openhab to /var/log/openhab2
sudo reboot
sudo nano ~/emonpi/fstab
Changed line 5 /var/lib/openhab to /var/lib/openhab2
added underneath line 5 tmpfs /usr/share/openhab2 tmpfs nodev,nosuid,size=40M,mode=1777 0 0
sudo apt-get install openhab2-offline
sudo systemctl start openhab2.service
sudo systemctl status openhab2.service
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service
sudo reboot
openHAB2 won’t run, also no log file in /var/log/openhab2
pi@emonpi:/ $ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: failed (Result: start-limit) since Mon 2016-10-10 22:23:32 UTC; 3s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 32132 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=203/EXEC)
Process: 32130 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=203/EXEC)
Main PID: 32130 (code=exited, status=203/EXEC)
Oct 10 22:23:32 emonpi systemd[1]: Unit openhab2.service entered failed state.
Oct 10 22:23:32 emonpi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Oct 10 22:23:32 emonpi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Oct 10 22:23:32 emonpi systemd[1]: Starting openHAB 2 - empowering the smart home...
Oct 10 22:23:32 emonpi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Oct 10 22:23:32 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Oct 10 22:23:32 emonpi systemd[1]: Unit openhab2.service entered failed state.
Then again, a sudo reboot and a sudo apt-get upgrade. Same result .
Oh dear, this is not cool.
I can’t see anything useful in the log files. I’m afraid I don’t know the intricacies of how openhab works let alone openhab2 to debug further without better info from the log. Maybe it’s time to ask the openhab forum guys regarding running on R/O FS.
Already a work in progress Trying to install OH 2 beta 4 on OpenEnergyMonitor image - Beginners - openHAB Community
Mmm good conversation on that thread. I’m away this week but when I’m home I will try and install open hab 2 myself. Would be good to get install procedure written up to work with our r/o image.
Have you tried added in a line to rc.local to restart openhab2 after creating the log directory?
E.g
This is my effort so far once openhab2 is installed via deb:
> mount -t tmpfs tmpfs /var/lib/openhab2/cache
mount -t tmpfs tmpfs /var/lib/openhab2/mapdb mount -t tmpfs tmpfs /var/lib/openhab2/tmp mount -t tmpfs tmpfs /var/lib/openhab2/log ln -s /var/lib/openhab2/tmp/port /var/lib/openhab2/port ln -s /var/lib/openhab2/tmp/lock /var/lib/openhab2/lock rm -rf /var/lib/openhab2/persistence && ln -s /mnt/rwdata/openhab2/persistence /var/lib/openhab2/persistence
Did it work?!
- sent from my mobile device
Sorry! Yes it works. Just wanted to add to the thread in case it helps, I’ve got it running fine on a Pi with the above commands. /mnt/rwdata is a writeable usb stick here (there’s quite a lot of persistence data which could probably be stored in a ram disk if you don’t need to store it permanently). It may help to have mapdb on writeable storage because it takes quite a long time to start up openhab when mapdb database needs to be recreated (and it will store any config created via UI rather than stored in config files in /etc/openhab2).
Nice work
I’ll add a link to this thread from the OpenEnergyMonitor OpenHAB git repo
There’s been a few changes with openhab2, not least the change to jsondb (replacing mapdb) for saving configuration through the UI. /mnt/rwdata is a read/write usb key. Any config I wish to save is moved to /etc/openhab2 so I can manage it easily.
Below are the steps I’m currently using:
mount -t tmpfs tmpfs /var/lib/openhab2/cache
mount -t tmpfs tmpfs /var/lib/openhab2/tmp
mount -t tmpfs tmpfs /var/lib/openhab2/log
rm /var/lib/openhab2/port && ln -s /var/lib/openhab2/tmp/port /var/lib/openhab2/port
rm -rf /var/lib/openhab2/lock && ln -s /var/lib/openhab2/tmp/lock /var/lib/openhab2/lock
rm -rf /var/lib/openhab2/persistence && ln -s /mnt/rwdata/openhab2/persistence /var/lib/openhab2/persistence
mv /var/lib/openhab2/etc /etc/openhab2/etc
ln -s /etc/openhab2/etc /var/lib/openhab2/etc
mv /var/lib/openhab2/jsondb /etc/openhab2/jsondb
ln -s /etc/openhab2/jsondb /var/lib/openhab2/jsondb
Quick update on this to autoconfigure this:
Create file /usr/share/openhab2/start_pre.sh:
#!/bin/sh
test -d /var/lib/openhab2/cache || mkdir /var/lib/openhab2/cache
mountpoint -q /var/lib/openhab2/cache || mount -t tmpfs tmpfs /var/lib/openhab2/cache
test -d /var/lib/openhab2/tmp || mkdir /var/lib/openhab2/tmp
mountpoint -q /var/lib/openhab2/tmp || mount -t tmpfs tmpfs /var/lib/openhab2/tmp
test -d /var/lib/openhab2/log || mkdir /var/lib/openhab2/log
mountpoint -q /var/lib/openhab2/log || mount -t tmpfs tmpfs /var/lib/openhab2/log
Modify /usr/lib/systemd/system/openhab2.service:
[Unit]
Description=openHAB 2 - empowering the smart home
Documentation=http://docs.openhab.org
Documentation=https://community.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
EnvironmentFile=/etc/default/openhab2
User=openhab
Group=openhab
WorkingDirectory=/usr/share/openhab2
PermissionsStartOnly=true
ExecStartPre=/usr/share/openhab2/start_pre.sh
ExecStart=/usr/share/openhab2/start.sh server
ExecStop=/usr/share/openhab2/runtime/bin/stop
# Shutdown delay in seconds, before process is tried to be killed with KILL (if configured)
TimeoutStopSec=120
Restart=on-failure
[Install]
WantedBy=multi-user.target
(Note: The PermissionsStartOnly=true is important as the start_pre script needs to run as root).
You still need to run the commands on initial setup:
rm /var/lib/openhab2/port && ln -s /var/lib/openhab2/tmp/port /var/lib/openhab2/port
rm -rf /var/lib/openhab2/lock && ln -s /var/lib/openhab2/tmp/lock /var/lib/openhab2/lock
rm -rf /var/lib/openhab2/persistence && ln -s /mnt/rwdata/openhab2/persistence /var/lib/openhab2/persistence
mv /var/lib/openhab2/etc /etc/openhab2/etc
ln -s /etc/openhab2/etc /var/lib/openhab2/etc
mv /var/lib/openhab2/jsondb /etc/openhab2/jsondb
ln -s /etc/openhab2/jsondb /var/lib/openhab2/jsondb
but don’t need the mount commands as they are taken care of in start_pre.sh each run.
Hi Matthew,
I tried your steps on a clean emonSD image (the latest nov16 release) and removed OH1.8 before installing OH2 (stable branch) and OH2-addons.
pi@emonpi(ro):~$ rpi-rw
Filesystem is unlocked - Write access
type ' rpi-ro ' to lock
pi@emonpi(rw):~$ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: failed (Result: start-limit) since Mon 2017-02-27 11:42:22 UTC; 3min 28s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 1432 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=203/EXEC)
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Feb 27 11:42:22 emonpi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: Starting openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
pi@emonpi(rw):~$ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: failed (Result: start-limit) since Mon 2017-02-27 11:42:22 UTC; 3min 48s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 1432 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=203/EXEC)
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Feb 27 11:42:22 emonpi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: Starting openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
pi@emonpi(rw):~$ sudo systemctl stop openhab2.service
pi@emonpi(rw):~$ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: failed (Result: start-limit) since Mon 2017-02-27 11:42:22 UTC; 4min 1s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 1432 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=203/EXEC)
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Feb 27 11:42:22 emonpi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: Starting openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
Feb 27 11:46:22 emonpi systemd[1]: Stopped openHAB 2 - empowering the smart home.
pi@emonpi(rw):~$ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: failed (Result: start-limit) since Mon 2017-02-27 11:42:22 UTC; 4min 4s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 1432 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=203/EXEC)
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Feb 27 11:42:22 emonpi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: Starting openHAB 2 - empowering the smart home...
Feb 27 11:42:22 emonpi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Feb 27 11:42:22 emonpi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Feb 27 11:42:22 emonpi systemd[1]: Unit openhab2.service entered failed state.
Feb 27 11:46:22 emonpi systemd[1]: Stopped openHAB 2 - empowering the smart home.
I’m also struggling with the same issue. I think it could be that OH2 requires some contents in /var/lib/openhab2. I need to look into this further.
What is the content of your /usr/lib/systemd/system/openhab2.service and /usr/share/openhab2/start_pre.sh files?
It’s the start_pre.sh script that’s failing according to those logs which means openhab won’t try and start. Make sure PermissionsStartOnly=true is set in openhab2.service as the start_pre.sh script must run as root. Check that the start_pre.sh script will run by itself.
/usr/lib/systemd/system/openhab2.service
[Unit]
Description=openHAB 2 - empowering the smart home
Documentation=http://docs.openhab.org
Documentation=https://community.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
EnvironmentFile=/etc/default/openhab2
User=openhab
Group=openhab
WorkingDirectory=/usr/share/openhab2
PermissionsStartOnly=true
ExecStartPre=/usr/share/openhab2/start_pre.sh
ExecStart=/usr/share/openhab2/start.sh server
ExecStop=/usr/share/openhab2/runtime/bin/stop
# Shutdown delay in seconds, before process is tried to be killed with KILL (if configured)
TimeoutStopSec=120
Restart=on-failure
[Install]
WantedBy=multi-user.target
start_pre.sh
#!/bin/sh
test -d /var/lib/openhab2/cache || mkdir /var/lib/openhab2/cache
mountpoint -q /var/lib/openhab2/cache || mount -t tmpfs tmpfs /var/lib/openhab2/cache
test -d /var/lib/openhab2/tmp || mkdir /var/lib/openhab2/tmp
mountpoint -q /var/lib/openhab2/tmp || mount -t tmpfs tmpfs /var/lib/openhab2/tmp
test -d /var/lib/openhab2/log || mkdir /var/lib/openhab2/log
mountpoint -q /var/lib/openhab2/log || mount -t tmpfs tmpfs /var/lib/openhab2/log
Any idea why the start_pre.sh script isn’t “green” ??
It needs to be executable:
chmod +x
start_pre.sh
The new log file:
The file system is in Read Only (RO) mode. If you need to make changes,
use the command 'rpi-rw' to put the file system in Read Write (RW) mode.
Use 'rpi-ro' to return to RO mode. The /home/pi/data directory is always in RW m ode.
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: deactivating (stop) (Result: exit-code) since Mon 2017-02-27 21:55:37 UTC; 1s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 5152 ExecStart=/usr/share/openhab2/start.sh server (code=exited, stat us=255)
Process: 5146 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, stat us=0/SUCCESS)
Main PID: 5152 (code=exited, status=255); : 5313 (karaf)
CGroup: /system.slice/openhab2.service
└─control
├─5313 /bin/bash /usr/share/openhab2/runtime/bin/karaf stop
├─5455 /bin/bash /usr/share/openhab2/runtime/bin/karaf stop
├─5456 /usr/lib/jvm/java-8-oracle/jre/bin/java -version
├─5457 grep -E "([0-9].[0-9]\..*[0-9]).*"
├─5458 awk {print substr($3,2,length($3)-2)}
├─5459 awk {print substr($1, 3, 3)}
└─5460 sed -e s;\.;;g
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:55:43 UTC; 1s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 5657 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 5825 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 5831 (karaf)
CGroup: /system.slice/openhab2.service
├─5831 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
└─5981 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openha...
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2017-02-27 21:55:54 UTC; 89ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 6672 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 6511 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=255)
Process: 6505 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 6511 (code=exited, status=255)
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:55:58 UTC; 540ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7016 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7184 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7190 (karaf)
CGroup: /system.slice/openhab2.service
├─7190 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─7300 /usr/bin/java -version
└─7301 grep ^IBM
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2017-02-27 21:56:01 UTC; 80ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7360 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7190 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=255)
Process: 7184 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7190 (code=exited, status=255)
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:56:01 UTC; 737ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7360 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7548 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7554 (karaf)
CGroup: /system.slice/openhab2.service
├─7554 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─7663 /usr/bin/java -version
└─7664 grep ^IBM
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:56:01 UTC; 1s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7360 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7548 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7554 (karaf)
CGroup: /system.slice/openhab2.service
├─7554 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
└─7712 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openha...
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: deactivating (stop) (Result: exit-code) since Mon 2017-02-27 21:56:03 UTC; 464ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7554 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=255)
Process: 7548 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7554 (code=exited, status=255); : 7732 (karaf)
CGroup: /system.slice/openhab2.service
└─control
├─7732 /bin/bash /usr/share/openhab2/runtime/bin/karaf stop
├─7831 /bin/bash /usr/share/openhab2/runtime/bin/karaf stop
├─7832 /usr/lib/jvm/java-8-oracle/jre/bin/java -version
├─7833 grep -E "([0-9].[0-9]\..*[0-9]).*"
├─7834 awk {print substr($3,2,length($3)-2)}
├─7835 awk {print substr($1, 3, 3)}
└─7836 sed -e s;\.;;g
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: deactivating (stop) (Result: exit-code) since Mon 2017-02-27 21:56:03 UTC; 1s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7554 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=255)
Process: 7548 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7554 (code=exited, status=255); : 7732 (karaf)
CGroup: /system.slice/openhab2.service
└─control
├─7732 /bin/bash /usr/share/openhab2/runtime/bin/karaf stop
└─7896 /usr/lib/jvm/java-8-oracle/jre/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopen...
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:56:05 UTC; 32ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7732 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7915 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7922 (karaf)
CGroup: /system.slice/openhab2.service
├─7922 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─7925 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─7930 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─7931 ls -l karaf
└─7932 awk -F-> {print $2}
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:56:05 UTC; 524ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7732 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7915 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7922 (karaf)
CGroup: /system.slice/openhab2.service
├─7922 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─8039 /usr/bin/java -version
└─8040 grep ^IBM
pi@emonpi(ro):~$ service openhab2 status
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Mon 2017-02-27 21:56:05 UTC; 995ms ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 7732 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
Process: 7915 ExecStartPre=/usr/share/openhab2/start_pre.sh (code=exited, status=0/SUCCESS)
Main PID: 7922 (karaf)
CGroup: /system.slice/openhab2.service
├─7922 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─8073 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
├─8074 /usr/bin/java -version
├─8075 grep -E "([0-9].[0-9]\..*[0-9]).*"
├─8076 awk {print substr($3,2,length($3)-2)}
├─8077 awk {print substr($1, 3, 3)}
└─8078 sed -e s;\.;;g
Good, progress. Now check your logfile for openhab2 at /var/log/openhab2/openhab.log. There’s probably an error there that’s causing openhab to shutdown. Also run journalctl -xn that might give a clue
Lol there is no log file :
pi@emonpi(rw):~$ journalctl -xn
No journal files were found.
pi@emonpi(rw):~$ cd /var/log
pi@emonpi(rw):log$ ls
apache2 daemon.log emonpilcd mosquitto openhab ufw.log
auth.log debug kern.log mqtt_input.log redis wtmp
boot.log emoncms.log logrotate mysql service-runner.log
btmp emonhub messages mysql.log syslog
pi@emonpi(rw):log$