2 ms·
I can see the rc runner itself will save output to /var/run/rc.log . This is great, as far as shell-based systems go -- of course not as good as systemd/upstart
by theamk 7y ago
I can see the rc runner itself will save output to /var/run/rc.log . This is great, as far as shell-based systems go -- of course not as good as systemd/upstart (which separate by service), but better than many linux's init systems.
Next, I wanted to check if "run_rc_command" suppressed the stdout/stderr of the program it was running. And here is where I hit a first difficulty:
- The rc.subr manpage you referred to does not seem to mention logging it in any way.
- So I looked in the source.. and it is 1300 line shell script [1], with run_rc_command being pretty complex function, with thousands of lines of code.
I found answer to my question (apparently it does not care about stdout/stderr at all), but this was non-trivial.
Compare it to systemd, which just have this information in the official manpages [2].
Are you still claiming shell-based init scripts are simpler?
(Expert level question: you have a third-party Java app, which provides a single sh file for you to run. Can you use it with your "10 line init script"? Why not?)
[1] https://github.com/IIJ-NetBSD/netbsd-src/blob/e4505e0610ceb1b2db8e2a9ed607b4bfa076aa2f/etc/rc.subr https://github.com/IIJ-NetBSD/netbsd-src/blob/e4505e0610ceb1...
[2] https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput= https://www.freedesktop.org/software/systemd/man/systemd.exe...