systemctl stop与kill的关系
如果一个systemd的服务文件如下
/lib/systemd/system/sysdemo.service
[Unit]
Description=Demo Service
After=syslog.target network.target
[Service]
Restart=always
RestartSec=60
WorkingDirectory=/usr/bin
ExecStart=/usr/bin/sysdemo
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=default.target
那么使用下面这个命令就可以停止sysdemo.service
sudo systemctl stop sysdemo.service
其实就是依据sysdemo.service文件定义,向/usr/bin/sysdemo运行起来的进程发送了kill -s SIGTERM信号(默认信号)
如果要使用core dump得这样,
LimitCORE=infinity
ExecStop=</


700

被折叠的 条评论
为什么被折叠?



