openhab / openhab-linuxpkg

Repo for Linux packages
Eclipse Public License 2.0
18 stars 33 forks source link

Upgrade fails to launch #20

Closed JohnInHVL closed 7 years ago

JohnInHVL commented 7 years ago

I am new to openHAB world and I have worked with it a little on my pine64. I had the server working for a while. Until I decided to upgrade from my openHAB 2 - offline to the recently released openhab2 713. It has not gone well. And I am at a loss as to how to correct the permission problems I appear to have. Any help would be appreciated. Here is the problem:

● openhab2.service - openHAB 2 - empowering the smart home Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2017-01-10 16:15:57 EST; 13min ago Docs: http://docs.openhab.org https://community.openhab.org Process: 11392 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3) Process: 11214 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=255) Main PID: 11214 (code=exited, status=255)

Jan 10 16:15:54 pine64 start.sh[11214]: Unable to update instance pid: /usr/share/openhab2/runtime/instances/instance.properties (Permission denied) Jan 10 16:15:55 pine64 start.sh[11214]: /var/log/openhab2/openhab.log (Permission denied) Jan 10 16:15:55 pine64 start.sh[11214]: Unable to update instance pid: /usr/share/openhab2/runtime/instances/instance.properties (Permission denied) Jan 10 16:15:55 pine64 systemd[1]: openhab2.service: Main process exited, code=exited, status=255/n/a Jan 10 16:15:55 pine64 stop[11392]: stop: Ignoring predefined value for KARAF_HOME Jan 10 16:15:57 pine64 stop[11392]: /var/lib/openhab2/tmp/port shutdown port file doesn't exist. The container is not running. Jan 10 16:15:57 pine64 systemd[1]: openhab2.service: Control process exited, code=exited status=3 Jan 10 16:15:57 pine64 systemd[1]: Stopped openHAB 2 - empowering the smart home. Jan 10 16:15:57 pine64 systemd[1]: openhab2.service: Unit entered failed state. Jan 10 16:15:57 pine64 systemd[1]: openhab2.service: Failed with result 'exit-code'.

Here is what I did: openhab2 user has admin privileges.

sudo apt-get purge openhab2 sudo rm /etc/apt/sources.list.d/openhab2.list echo 'deb http://dl.bintray.com/openhab/apt-repo2 unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -

sudo apt-get update sudo apt-get install openhab2 sudo reboot

Sudo systemctl start openhab2.service

It failed due to permissions, so I tried….

sudo chown openhab2:openhab2 /usr/share/openhab2 sudo chown openhab2:openhab2 /etc/openhab2 sudo chown openhab2:openhab2 /var/log/openhab2 sudo chown openhab2:openhab2 /var/lib/openhab2

Which resulted in: openhab2@pine64:~$ ls -l /usr/share/openhab2 total 32 drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 15:34 addons drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 15:33 bin -rw-rw-r-- 1 openhab2 openhab2 11232 Jan 9 18:18 LICENSE.TXT drwxrwxr-x 7 openhab2 openhab2 4096 Jan 10 15:52 runtime -rwxr-xr-x 1 openhab2 openhab2 73 Jan 9 18:18 start_debug.sh -rwxrwxr-x 1 openhab2 openhab2 116 Jan 9 18:18 start.sh

openhab2@pine64:~$ ls -l /etc/openhab2 total 48 drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 17:54 Demo files drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 html drwxrwxr-x 3 openhab2 openhab2 4096 Jan 8 17:06 icons drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 items drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 persistence drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 rules drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 scripts drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 services drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 sitemaps drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 sounds drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 things drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:08 transform

openhab2@pine64:~$ ls -l /var/log/openhab2 total 0 -rwxr-xr-x 1 openhab2 openhab2 0 Jan 9 18:18 Readme.txt

openhab2@pine64:~$ ls -l /var/lib/openhab2 total 28 drwxr-xr-x 6 openhab2 openhab2 4096 Jan 9 10:38 config drwxrwxr-x 2 openhab2 openhab2 4096 Jan 10 11:26 etc drwxr-xr-x 2 openhab2 openhab2 4096 Jan 9 10:35 hueemulation drwxr-xr-x 3 openhab2 openhab2 4096 Jan 9 10:40 jsondb drwxr-xr-x 2 openhab2 openhab2 4096 Jan 8 17:10 log drwxr-xr-x 5 openhab2 openhab2 4096 Jan 10 11:08 persistence drwxr-xr-x 2 openhab2 openhab2 4096 Jan 10 11:26 tmp

BClark09 commented 7 years ago

Try again with openhab:openhab, as these are the true user and group names needed by openhab, it looks like your username is openhab2.

JohnInHVL commented 7 years ago

Thank you, that got me up...

still have a status 3 showing, but I may not understand what that means. Will check the logs

screen shot 2017-01-10 at 8 46 43 pm

BClark09 commented 7 years ago

Hi @JohnInHVL, glad you got it working! That looks normal to me, I wouldn't worry about it.