OpenZWave / qt-openzwave

QT5 Wrapper for OpenZWave
GNU Lesser General Public License v3.0
104 stars 30 forks source link

User directory setting is ignored. #75

Closed kpine closed 4 years ago

kpine commented 4 years ago

If specifying a non-default user path (using --user-dir argument), it is ignored because main.cpp either derives it from the location of options.xml, or in the case of an empty config (first time run), hard-codes it to /.config/. The actual program parameter is never used.

I would like to keep the cache, config, etc. files on a separate volume from the config files.

Here's an execution log (ignore the usb path):

/opt/ozw # USB_PATH=/dev/zero OZW_USER_DIR=/opt/ozw/user /usr/local/bin/startozwdaemon.sh
Executing: /usr/local/bin/ozwdaemon -s /dev/zero --config-dir /opt/ozw/config --user-dir /opt/ozw/user --mqtt-server localhost --mqtt-port 1883 --stop-on-failure --mqtt-instance 1
...
DBPath:  "./config/"
userPath:  "./config/"
...
[20200512 0:51:29.229 UTC] [ozw.manager] [debug]: Database Path:  "./config/"  User Path "./config/"
kpine commented 4 years ago

Looks like the --config-dir argument suffers from a similar issue. If your container has no config files already, and ozwd cannot find an existing possible db path, it overrides the user setting. I would expect that using --config-dir and --user-dir would be unconditional and not be affected by files located elsewhere.

Fishwaldo commented 4 years ago

Should be fixed in the latest builds

kpine commented 4 years ago

Looks to be working for me. Question though, do logs and crash dumps belong in the user or config directory? Currently they are saved in config, but my first reaction is that config is strictly for device config files.

Fishwaldo commented 4 years ago

Yeah, we should probably move them... Crashes are saved to the BP_DB_PATH environment variable, and logs are hardcoded right now (in the allinone).