Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd service should use /bin/karaf instead of start.sh #72

Merged
merged 1 commit into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions resources/etc/default/openhab2
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ EXTRA_JAVA_OPTS=""
#
#OPENHAB_USER=openhab
#OPENHAB_GROUP=openhab
#
# The Karaf startmode for the openHAB runtime. Only available for systemctl/systemd systems.
# Defaults to daemon when unset here. Multiple options can be used without quotes.
# debug increases log output. daemon launches the Karaf/openHAB processes.
#
#OPENHAB_STARTMODE=debug
15 changes: 11 additions & 4 deletions resources/systemd/openhab2.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ Environment=OPENHAB_CONF=/etc/openhab2
Environment=OPENHAB_RUNTIME=/usr/share/openhab2/runtime
Environment=OPENHAB_USERDATA=/var/lib/openhab2
Environment=OPENHAB_LOGDIR=/var/log/openhab2
Environment=OPENHAB_STARTMODE=daemon
EnvironmentFile=-/etc/default/openhab2

User=openhab
Group=openhab

WorkingDirectory=/usr/share/openhab2
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
ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE
ExecStop=/usr/share/openhab2/runtime/bin/karaf stop

SuccessExitStatus=0 143
RestartSec=5
Restart=on-failure
TimeoutStopSec=120

LimitNOFILE=102642

[Install]
WantedBy=multi-user.target