# This is the init script for starting up the
# Diaspora
#
# chkconfig: 345 91 10
# description: Starts and stops the Diaspora daemon.
#
PROC_NAME=Diaspora
DIASPORA_HOME=/home/diaspora
# Change the user to whichever user you need
RUN_AS_USER=diaspora
startup="cd $DIASPORA_HOME; ./script/server"
# Replace by stop/shutdown command
#shutdown="$DIASPORA_HOME/script/server"
start(){
echo -n $"Starting $PROC_NAME service: "
su -l $RUN_AS_USER -c "$startup"
RETVAL=$?
echo
}
stop(){
echo -n $"Stoping $PROC_NAME service: "
# Uncomment here to allow stop
# su -l $RUN_AS_USER -c "$shutdown"
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
# This is the init script for starting up the
# Diaspora
#
# chkconfig: 345 91 10
# description: Starts and stops the Diaspora daemon.
#
PROC_NAME=Diaspora
DIASPORA_HOME=/home/diaspora
# Change the user to whichever user you need
RUN_AS_USER=diaspora
startup="cd $DIASPORA_HOME; ./script/server"
# Replace by stop/shutdown command
#shutdown="$DIASPORA_HOME/script/server"
start(){
echo -n $"Starting $PROC_NAME service: "
su -l $RUN_AS_USER -c "$startup"
RETVAL=$?
echo
}
stop(){
echo -n $"Stoping $PROC_NAME service: "
# Uncomment here to allow stop
# su -l $RUN_AS_USER -c "$shutdown"
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Then make the file executable:
sudo chmod +x /etc/init.d/diaspora
Then you need to tell Ubuntu to start/stop, usually using the default run levels (assuming you saved the previous script in /etc/init.d/diaspora):
sudo update-rc.d diaspora defaults
Then try it out:
sudo service diaspora start
or
sudo /etc/init.d/diaspora start
If diaspora starts then you're good to go. Else the script might need adjustment.
发布评论
评论(1)
首先你需要创建一个初始化脚本:
然后使文件可执行:
然后你需要告诉 Ubuntu 启动/停止,通常使用默认运行级别(假设你将之前的脚本保存在 /etc/init.d/diaspora 中):
然后尝试一下:
或者
如果散居开始,那么你就可以走了。否则脚本可能需要调整。
First you need to create an init script:
Then make the file executable:
Then you need to tell Ubuntu to start/stop, usually using the default run levels (assuming you saved the previous script in /etc/init.d/diaspora):
Then try it out:
or
If diaspora starts then you're good to go. Else the script might need adjustment.