起動スクリプトの書き方

# /etc/init.d/httpd start のような感じでプロセスを起動できるようなシェルスクリプトの書き方.

# vim /etc/init.d/httpd
----------
#!/bin/bash
start() {
 echo -n "Starting Apache: "
 /usr/local/bin/httpd
 return 0
}
stop() {
 echo -n "Stoping Apache: "
 killproc httpd
 return 0
}
case "$1" in
 start)
  start
  ;;
 stop)
  stop
  ;;
 restart)
  stop
  start
  ;;
esac
----------

start と stop の記述はパソコン起動時に自動で実行するために必要なので必ず書くこと.