Hacking · Things I've Learned

Bourne Shell Introspection

So I was thinking about how to refactor our custom Linux and Solaris init scripts at work. The way FreeBSD does it is to have the scripts in /etc/rc.d define variables with the commands to execute, e.g., start_cmd=’/usr/sbin/foobard’ stop_cmd=’kill `cat /var/run/foobar.pid`’ run_rc_command “$1″ where $1 is “start”, “stop”, or whatever, and run_rc_command is a function… Continue reading Bourne Shell Introspection