无坑版,centos7 自定义service

无坑版,centos7 自定义service

cat cdp_demo_back.service
[Unit]  
Description=cdp_back_demo

[Service]
Type=forking
WorkingDirectory=/data/backend/scripts/xops/
ExecStart=/bin/sh cdp-back-demo_start.sh
ExecStop=/bin/netstat -lntup | grep java  | grep 9098 | awk '{print $7}' | sed -e 's/\/java//'|xargs kill -9

[Install]                                                                                          
WantedBy=multi-user.target    
  



posted on 2021-01-25 16:45  石圪节胡德禄  阅读(305)  评论(0编辑  收藏  举报

导航