systemctl status 命令显示 ExecStop Failure 消息。尽管我的服务已启动并正在运行。
testDB.service - the testDB service
Loaded: loaded (/usr/lib/systemd/system/testDB.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2022-04-27 15:55:38 IST; 7s ago
Process: 946 ExecStop=db/testDB/scripts/testDB.init stop (code=exited, status=1/FAILURE)
Process: 995 ExecStart=db/testDB/scripts/testDB.init start (code=exited, status=0/SUCCESS)
有什么方法可以避免 ExecStop FAILURE 消息?
答案1
从服务的 systemd 单元文件中删除以 开头的行ExecStop
。或者确保脚本testDB.init stop
始终返回退出代码 0