更改启动 init.d 脚本以用于新的 ubuntu

更改启动 init.d 脚本以用于新的 ubuntu

这是我的代码。我想将其更改为与新版本的 ubuntu 一起使用。问题是 ubuntu 不再有 chkconfig。我还听说新版 ubuntu 使用 upstart 而不是 init 类型的启动。那么我该如何使用此代码与 ubuntu 13.10 一起使用?

#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

相关内容