llinux 自启动 centos7

阅读更多

[Unit]

#服务描述

Description=nexus manager service

#指定服务文档地址

Documentation=https://help.sonatype.com/docs

#指定了在systemd在执行完那些target之后再启动该服务

After=network.target remote-fs.target nss-lookup.target

 

[Service]

#定义Service的运行类型,一般是forking(后台运行)   

Type=forking

#定义PID 文件 ,与 nginx.conf 相同

#PIDFile=/run/nginx.pid

#ExecStartPre=export JAVA_HOME=

ExecStart=/opt/nexus-3.14.0-04/bin/nexus start

ExecReload==/opt/nexus-3.14.0-04/bin/nexus restart

ExecStop=/opt/nexus-3.14.0-04/bin/nexus stop

PrivateTmp=true

 

[Install]

WantedBy=multi-user.target

你可能感兴趣的:(llinux 自启动 centos7)