In procd init script, how to put stdout/stderr to a file?

I search the document but only introduce how to out to syslog, the question is the program runs with a lot of logs and it useful for me to track bug or something else, if direct out to syslog it will spam the whole log page and I can't save all log in the long term to audit it.
I tried use "procd_set_param command /bin/program -o option > /tmp/logfile.log", but it not work in procd script. Use ps to check progress only "/bin/program -o option". Looks procd cuts all after '>'.
So any idea? Or some alternate method? This program can't daemonize itself and also no method to write log to external.
BTW I'm new here and don't know post here is correct or not, if I post a wrong place please let me know.

procd_set_param command /bin/sh -c "/bin/program > /tmp/logfile.log"

4 Likes

Thanks for your help!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.