写了一个启动Redmine的开机脚本,redmine文件在/etc/init.d/下
#!/bin/sh ### BEGIN INIT INFO
# Provides: Dean Chen
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redmine
# Description: Redmine+Backlogs server
### END INIT INFO . /lib/lsb/init-functions SPAWN_FCGI=/usr/bin/spawn-fcgi case "$1" in
start)
log_begin_msg "Starting redmine server"
$SPAWN_FCGI -p 9001 -f /root/redmine-2.3/public/dispatch.fcgi
log_end_msg 0
;;
stop)
PID=`ps -ef | grep 'fcgi' | grep -v grep | awk '{print $2}'`
log_begin_msg "Stopping redmine server"
if [ ! -z "$PID" ]; then
kill -15 $PID
fi
log_end_msg 0
;;
restart)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: service redmine {start|stop|restart}"
exit 1
esac exit 0