Wednesday, 18 September 2013

RaZberry: running as a service

Running as a service means openhab will automatically start when rpi starts up and will shut down when rpi shuts down, it can also be shutdown at any time from the console (for example, to run z-way to pick up new or changed device configurations).

This script is based on the one Victor Belov posted here changed thus:
  1. directory and user names changed (ECLIPSEHOME, RUN_AS)
  2. added to DAEMON_ARGS
  3. simple 3 generation log recycler

Making the daemon

  1. create the file /etc/init.d/openhab with your favourite editor - e.g.
    sudo nano /etc/init.d/openhab
  2. populate with the contents here, amend locations / usernames as appropriate
  3. save the file
  4. set execute permissions:
    sudo chmod a+x openhab
  5. update the startup environment
    sudo update-rc.d openhab defaults
  6. test the service
    sudo service openhab start
  7. after a couple of minutes you can point your browser at your sitemap and see the config you have defined.

Better z-zwave logging

Use the info in the wiki here to send all the z-wave logging to its own log file

Final checks

reboot your rpi to make sure that the service does start automatically and that zwave is logging to its own file

No comments:

Post a Comment