+4
Fixed

When using -Duser.dir switch, a few oddities

PhAzE 5 years ago updated 5 years ago 11
When you use the -Duser.dir switch for java to move the working directory, the LOGS directory does not follow the rest of the files.

Also, the webadmin.cred file doesn't know where to go so it ends up in the root directory. Can these be updated to obey that switch? (great app so far!)
Under review
You're right, there is a problem with the webadmin.cred file.
I will probably fix it. However you can easily (and in a more reliable way) ensure that all files will be created in a specific directory by going into this directory before launching Ubooquity.

For instance if Ubooquity.jar is in /home/pi/apps and you want it to create its files in /home/pi/data, just "cd" into "data" before calling java:

cd /home/pi/data
java -jar /home/pi/apps/Ubooquity.jar
Much easier and safe.
Let me know if you have a use case that can not be solved this way (really curious).


Im setting up a plugin for Unraid in which the entire OS resides on a ram drive which is created and destroyed on each boot. I allow users to separate the install directory (where .jar files go) and config dir (where all the other files go) so that they can have the important files stored on a persistent drive so the data will survive the reboot.

Thats where using Duser.dir comes in very handy as users can move those files with ease through my plugin interface. With the cred fike in root, it will be deleted upon reboot of the system, and logs will be lost since it too doesnt use the duser.dir switch. :)
Disclaimer: I don't know anything about Unraid, so my question might be stupid.

Assuming Ubooquity is launched through a script by the plugin, wouldn't it be possible to use a variable for the working directory that would allow the user the same flexibility as an explicit command line argument ?

Something like:
cd $MY_UBOOQUITY_WORK_DIR
...
I'am asking because using the "user.dir" setting is not a completely reliable solution (hence the bugs you encountered). So if there is a real need for a working directory setting, I'll implement it in the code itself. But I really want to be sure that this work is required as for all use cases I have been told about (except perhaps yours, hence my questions), the "cd into another dir" method was enough to solve the problem.

If the script for some reason didn't back out from that cd'd directory (say the script crashes or something) the user will not be able to shut off the array. So as a precaution I tend not to cd into directories in the plugins I make. An official method with a variable scripted in would be ideal. But otherwise I can try to setup symlinks. ;)
Fair enough, I'll try to implement a proper user dir switch. :)
Looking forward to this change so I can finally finish my "ultimate media server"!
Plugin is ready, once the next Ubooquity update is released, I'll verify everything is working as expected then release the plugin for unRAID.
Thanks, I'll have a look and update the plugin tomorrow with the new host feature and working dir command.