This page last changed on May 23, 2013 by othmark.
I am trying to start OpenRemote via a crontab process, so that after a reboot the controller comes back up automatically.
The problem is, that I cannot get the ../webapps/controller/controller.xml file loaded when starting OpenRemote from outside the OpenRemote.../bin directory. (Crontab starts at the user home directory). I believe I set PATH and environment variables correct:
The server starts, however the controller definition file ../webapps/controller/../webapps/controller/controller.xml is not loaded. (Of course it is there, and when starting the server from within the OpenRemote.../bin directory everything loads.)
The error message from the server is:
Could not find a controller definition to load at path '../webapps/controller/controller.xml' (for version 2.0)
INFO 2013-05-23 10:33:13,436 : Controller Definition File Watcher for Default Deployer started.
Is there some other environment variable or PATH I need to specify?
I am running OS X 10.8.3, but I assume the problem for Linux would be similar.
Any hint would be appreciated.
I've zero knowledge of crontab: on Linux side the scripts do change to bin directory before starting. Maybe it is necessary for crontab to change the working directory as well? The PATH variable is not used when resolving the location of the controller.xml but it is a relative path instead. This is defined in the config.properties:
# RESOURCE FILE CONFIGURATION:
# The resource path below points to a directory where the controller
# looks for all configuration files (XML files), images and other
# resources for panels and controllers.
# With the default distribution of OpenRemote controller, it is not
# necessary to change this location.
Automated start on linux server
Posted by juha at May 23, 2013 12:12
When using cron to start programs via crontab there is a different PATH variable used. Please study this post http://stackoverflow.com/questions/10129381/crontab-path-and-user
Posted by aktur at May 24, 2013 14:32
thanks for your help. As Juha proposed I am now using a shell script, which is changing to the OR working directory:
This script then I start with crontab at reboot, with its output logging to orReboot.log
@reboot /Users/smarthome/orBoot.sh > /Users/smarthome/orReboot.log 2>&1
Posted by othmark at May 24, 2013 19:14