I have one main script which is started as an service.
I can't modify this main script, because it is often updated. This main script starts a program, which echo any log to stdout.
So i can't see any log of this program.
But this main script calls at the beginning an hook-script, that I can modify.
If I redirect the stdout to a file in this hook-script, it works for that script, but not for the main script.
Is it possible to change the stdout for the whole process?
# hook to execute scripts always before enigma2 start if [ -x enigma2_pre_start.sh ]; then enigma2_pre_start.sh fi ... #this logs to stdout /usr/bin/enigma2 ...
exec > /tmp/`date +"%s"`.log exec 2> /tmp/`date +"%s"`_error.log
Is it possible, to attach an tee (or similar) to the main process after it is started? I know the main script is only run once. So i can get the process id with ps.