Make us of STATE_DIRECTORY
Currently if the BOLT_DBPATH
env variable is set it will override the compile time database dir (set via config.h
).
Starting with version 240 systemd will set STATE_DIRECTORY
(from the NEWS file):
When the RuntimeDirectory=, StateDirectory=, CacheDirectory=, LogsDirectory=, ConfigurationDirectory= settings are used in a service the executed processes will now receive a set of environment variables containing the full paths of these directories. Specifically, RUNTIME_DIRECTORY=, STATE_DIRECTORY, CACHE_DIRECTORY, LOGS_DIRECTORY, CONFIGURATION_DIRECTORY are now set if these options are used. Note that these options may be used multiple times per service in which case the resulting paths will be concatenated and separated by colons.
I think the if nothing is set, we use the compile time define, if STATE_DIRECTORY
is set we use that plus the BOLT_DBNAME
define and if BOLT_DBPATH
is set, we use that.