起動rcスクリプト#!/bin/bash # chkconfig: 345 99 15 # description: sample app PATH=/home/taro/bin:$PATH start() { cd /home/taro su taro -c "bin/myserver >/dev/null 2>&1 &" } stop() { killall myserver } case "$1" in start) start ;; stop) killall myserver ;; restart) stop sleep 1 start ;; *) echo USAGE: "$0 {start|stop|restart}" exit 1 esac |
|