[program:YAPI]
command=node /usr/local/lib/node_modules/yapi-cli/src/commands/my-yapi/vendors/server/app.js
directory=/usr/local/lib/node_modules/yapi-cli/src/commands/my-yapi/vendors/server
user=dell
stdout_logfile=/var/log/YAPI.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT
[Unit]
Description=YAPI接口服务
After= network.target mongod.service
[Service]
ExecStart=/root/.nvm/versions/node/v8.12.0/bin/node /root/my-yapi/vendors/server/app.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
注意:centos下mongodb的服务名叫
mongod
,ubuntu下叫mongodb
[program:maven]
command=/usr/local/nexus-3.14.0-04/bin/nexus run
directory=/usr/local/nexus-3.14.0-04/bin
user=root
stdout_logfile=/var/log/maven.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT
[Unit]
Description=Nexus
After=network.target
[Service]
ExecStart=/home/nexus-3.14.0-04/bin/nexus run
Restart=on-failure
[Install]
WantedBy=multi-user.target
[program:mindoc]
command=/usr/local/mindoc/mindoc_linux_amd64
directory=/usr/local/mindoc/
user=root
stdout_logfile=/var/log/mindoc.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT
[Unit]
Description=MinDoc博客服务
After=network.target mysqld.service
[Service]
ExecStart=/root/mindoc/mindoc_linux_amd64
Restart=on-failure
[Install]
WantedBy=multi-user.target
注意:centos下mysql服务名叫
mysqld
,ubuntu下叫mysql
[Unit]
Description=Jenkins
After=network.target
[Service]
ExecStart=/usr/bin/java -jar /root/yang/jenkins.war --httpPort=8888
Restart=on-failure
[Install]
WantedBy=multi-user.target
注意:
1.java也要指定绝对路径
2.限制jvm大小请在-jar
之前加上参数:-Xms128m -Xmx512m----Xms
表示最小内存,Xmx
表示最大内存
注意:
centos的启动文件路径:/usr/lib/systemd/system
或/lib/systemd/system
,这两个路径中的文件完全同步,选择其中一个即可
ubuntu启动文件路径:/lib/systemd/system
注意:
若mysql和mongodb都在docker中,则上述systemctl启动文件中的mysqld.service
和mongod.service
都要替换成docker.service
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:yapi,nexus,mindoc,jenkins服务启动文件