![Ubuntu 18.04 中的 CONF 文件](https://linux22.com/image/1066218/Ubuntu%2018.04%20%E4%B8%AD%E7%9A%84%20CONF%20%E6%96%87%E4%BB%B6.png)
我有 /etc/init/myserver.conf 文件,ubuntu 12.04 可以运行。
在 ubuntu 18.04 中不起作用。
# masterserver - start master server service
description "Service that starts master.sh"
author "<hadjieff>"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Run before process
pre-start script
# Put bash code here if necessary
end script
# Start the process
script
cd /home/hadjieff/hadjieff/server
sudo java -Djava.security.policy=security.policy -Djava.rmi.server.hostname=192.168.1.91 -cp . -jar Registar.jar --xbee=true --test=false
end script