将init .conf转换为system .service

时间:2019-04-04 22:59:05

标签: service config systemd init

请帮助我转换。

ubuntu 12.04 /etc/init/MYSERVER.conf到/etc/systemd/system/MYSERVER.service 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

0 个答案:

没有答案
寻找你感兴趣的贴纸↓↓↓
豫ICP备18024241号-1