Cannot Stop YaCy/Change password when using --startup
Epic-Busta opened this issue · 3 comments
Hi. I'd like to run my DATA directory on a different drive since my boot drive is very small, however using the -s or --startup launch options prevents passwd.sh from changing the password and stopYACY.sh from stopping that instance.
In my particular case, the YaCy program is located at /etc/yacy/ (the default install location from DietPi) and I'd like to put the data folder path in /mnt/nvme/yacy/DATA instead of /etc/yacy/DATA. Launching using -s /mnt/nvme/yacy leads to the creation of a data folder in that directory, but the password can't be changed and can't be stopped without using killYACY.sh
There are a couple ramifications, at least for my install. Mainly not being able to access the admin section due to a bug where not setting an admin password using passwd.sh causes an error in the web gui (#544)
After some light reading into the shell scripts passwd.sh, stopYACY.sh and startYACY.sh, I think a discrepancy in variable names has caused an unintentional hardcoding of where passwd.sh and stopYACY.sh expects the DATA directory to be.
startYACY.sh makes reference to "YACY_PARENT_DATA_PATH" as the variable controlling the DATA directory location
passwd.sh and stopYACY.sh make reference to "YACY_DATA_PATH", which is never mentioned in startYACY.sh. This might lead to those scripts only using ./DATA in the YaCy directory.
I'm not familiar with the inner workings of YaCy after discovering this only a couple days ago, but I'll keep looking into this. Would be sweet to get this working.
You have to execute passwd.sh
relative to the YaCy DATA directory. If you set YACY_DATA_PATH
to the correct path beforehand, the script would actually work.
Today I learned how to set variables -_- The more you know. I'll document how I solved this just in-case someone else runs into this.
Before running passwd.sh or stopYACY.sh, YACY_DATA_PATH
needs to be set using export YACY_DATA_PATH=/path/to/yacy/DATA
In my case, it's export YACY_DATA_PATH=/mnt/nvme/yacy/DATA
Then you can run passwd.sh and stopYACY.sh without issues.
A bit of a tangent, but wouldn't it make sense to set this in startYACY.sh? I can only see this causing issues when running multiple instances, but then using docker would make sense. But hey, I didn't know how to set variables. What else don't I know? Anyways, I'll close this now since it's been resolved.