Getting work directory from websocket API
Posted: Sun May 04, 2025 1:38 pm
Is there any way, using the websocket API, to find out the location of the work directory? The config state that is sent upon initial connection to the websocket contains a lot of information, but it doesn't contain the configured work directory nor the client's current PID. I've been trying to find some way to determine it without needing to hardcode /var/lib/fah-client in my scripts.
I could send the "log" command and then parse the logs manually to find the lines that start with "CWD", but that only works if there are WUs running.
I tried to find the CWD of the client's PID, and find the client's PID based on the listening port, but it turns out I'd need root to do that when fah-client runs as its own user, which it does. So I'm out of ideas.
I could send the "log" command and then parse the logs manually to find the lines that start with "CWD", but that only works if there are WUs running.
I tried to find the CWD of the client's PID, and find the client's PID based on the listening port, but it turns out I'd need root to do that when fah-client runs as its own user, which it does. So I'm out of ideas.