Jumpserver之设置开机自启动

  

vi /usr/lib/systemd/system/jms.service
[Unit]
Description=jms
After=network.target mariadb.service redis.service
Wants=mariadb.service redis.service

[Service]
Type=forking
Environment="PATH=/opt/py3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
ExecStart=/opt/jumpserver/jms start all -d
ExecReload=
ExecStop=/opt/jumpserver/jms stop

[Install]
WantedBy=multi-user.target

  

 vi /usr/lib/systemd/system/coco.service
[Unit]
Description=coco
After=network.target jms.service

[Service]
Type=forking
PIDFile=/opt/coco/coco.pid
Environment="PATH=/opt/py3/bin"
ExecStart=/opt/coco/cocod start -d
ExecReload=
ExecStop=/opt/coco/cocod stop

[Install]
WantedBy=multi-user.target

   设置开启自启动

systemctl enable jms
systemctl enable coco

  

posted @ 2019-04-23 10:44  minseo  阅读(1648)  评论(0编辑  收藏  举报