linux.parameters is a convenient way of adding and overwriting environment settings such as
EXTRA_JAVA_OPTS="-Duser.timezone=Europe/Berlin -Xms1500m -Xmx3000m -XX:+ExitOnOutOfMemoryError"
OPENHAB_BACKUPS=/myBackupDirectory
because this file does not get overwritten by any upgrade procedure.
Manual start of openhab
During manual start of openhab this file gets called as follows
Manual start of openhab from command line:
openhab-cli start
this script calls
/usr/share/openhab/start.sh
which calls
/etc/profile.d/openhab.sh
which sets environment variables in the following order:
/etc/default/openhab
/etc/profile.d/openhab.sh
/etc/openhab/linux.parameters
The sequence is clear and you can follow the whole precudure.
Starting openhab by daemon
What I am missing is, how linux.parameters
gets started if openhab is started by daemon:
/etc/systemd/system/openhab.service
has its own set of variables and includes
/etc/default/openhab
and openhab ist started by this command:
/usr/share/openhab/runtime/bin/karaf
in this script and its include files I do not see any reference, that either
/etc/profile.d/openhab.sh
or
/etc/openhab/linux.parameters
is called.
However, I have proof, that the file linux.parameters gets executed because all my backups are stored correctly in the directory provided by linux.parameters.
Can anybody add the missing link how/where karaf
script calls linux.parameters
?
According to my information daemon files do not use environments of an interactive shell, in which case /etc/profile.d/openhab.sh would have been run.
your code goes here