Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User directory setting is ignored. #75

Closed
kpine opened this issue May 12, 2020 · 4 comments
Closed

User directory setting is ignored. #75

kpine opened this issue May 12, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@kpine
Copy link
Contributor

kpine commented May 12, 2020

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/"
@Fishwaldo Fishwaldo added the bug Something isn't working label May 14, 2020
@kpine
Copy link
Contributor Author

kpine commented May 27, 2020

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
Copy link
Member

Should be fixed in the latest builds

@kpine
Copy link
Contributor Author

kpine commented Jun 5, 2020

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
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants