openHAB as a Windows Service

1,286 views
Skip to first unread message

James Vincent

unread,
Feb 15, 2015, 4:37:38 PM2/15/15
to ope...@googlegroups.com
I've openHAB configured as a windows service... It starts fine, but if I need/want to restart the service, it fails, without much in the way of a reason... I expect I'm in the minority here when running as a service, so not expecting much in the way of a solution to this, but just wondered if anyone else had seen this?


Windows could not stop the OpenHab Service service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.




install_service.bat;

set ECLIPSEHOME=server

:: set ports for HTTP(S) server
set HTTP_PORT=8080
set HTTPS_PORT=8443
set FOLDER=C:\openHAB
set JAVA_HOME="C:\Program Files (x86)\Java\jdk1.8.0_31"
prunsrv //DS//OpenHab
prunsrv //IS//OpenHab --DisplayName="OpenHab Service" ^
    --ServiceUser .\Administrator --ServicePassword password^
    --Classpath "%FOLDER%\server\plugins\org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar;%FOLDER%\server\plugins\org.eclipse.scada.utils.osgi.daemon_0.1.0.v20140430-1536.jar"^
        --Install=%FOLDER%\prunsrv.exe --Jvm=auto ^
       --StartMode jvm^
        --StartClass org.eclipse.equinox.launcher.Main^
  --StartMethod main^
  --Startup auto^
  ++StartParams -console^
  ++StartParams -consoleLog^
   ++JvmOptions -Dosgi.clean=true#-Declipse.ignoreApp=true#-Dosgi.noShutdown=true#-Djetty.port=%HTTP_PORT%#-Djetty.port.ssl=%HTTPS_PORT%#-Djetty.home=.#-Dlogback.configurationFile=configurations/logback.xml#-Dfelix.fileinstall.dir=addons#-Djava.library.path=lib#-Djava.security.auth.login.config=./etc/login.conf#-Dorg.quartz.properties=./etc/quartz.properties#-Dequinox.ds.block_timeout=240000#-Dequinox.scr.waitTimeOnBlock=60000#-Djava.awt.headless=true#-Dfelix.fileinstall.active.level=4^
  --StopMode jvm^
  --LogPath %FOLDER%\logs
pause

reven

unread,
Feb 16, 2015, 2:21:31 AM2/16/15
to ope...@googlegroups.com
I'm using nssm to install the service (as well as mqttwarn) and I'm able to start/stop/restart it fine.

James Vincent

unread,
Feb 16, 2015, 2:15:33 PM2/16/15
to ope...@googlegroups.com
Well, that was easy. Thanks!!


C:\Program Files (x86)\NSSM\win32>nssm install OpenHAB "C:\openHAB\start.bat"
Service "OpenHAB" installed successfully!
Reply all
Reply to author
Forward
0 new messages