I've started a long running process with nohup and redirected it's output to a log file
Example:
nohup ./bin/zkServer.sh start-foreground > /usr/local/myuser/logs/zkout.log 2>&1 &
I accidentally deleted the zkout.log
file so now I can't see any output from the command.
I'm not interested in recovering the data, but I am wondering if there is a way to 'reattach' the stdout from my long running process to the file without having to kill/restart?
I tried just recreating /usr/local/myuser/logs/zkout.log
but that doesn't work.
I also looked at this question: recovering deleted file held open by apache? but that is talking about recovering the content of the deleted file (which I don't care about). However, I do see the broken link in /proc/$procid/fd; could I just update that link to point to the new file?
gdb
? – thrig Apr 21 '16 at 16:58