[systemd-devel] 回复: systemctl can't execute stop actually, whenservice is started by other way

清辰 624001899 at qq.com
Wed Jun 28 08:38:08 UTC 2017


Hi Lennart,


Thank you for your reply.


Is there a way to execute stop actually, even the status is inactive.




------------------ 原始邮件 ------------------
发件人: "Lennart Poettering"<lennart at poettering.net>; 
发送时间: 2017年6月27日(星期二) 下午3:29
收件人: "清辰"<624001899 at qq.com>; 
抄送: "systemd-devel"<systemd-devel at lists.freedesktop.org>; 
主题: Re: [systemd-devel] systemctl can't execute stop actually, whenservice is started by other way



On Tue, 27.06.17 13:48, 清辰 (624001899 at qq.com) wrote:

> for example: service nscd
> 1.execute: systemctl stop nscd.service
>   stop nscd process actually
> 2.execute: /usr/bin/nscd
>   start nscd by shell command
> 3.execute: systemctl status nscd.service
>   inactive(dead)
>   systemctl can't know nscd is running
> 4.excute: systemctl stop nscd.service
>   nscd process still exist, it seems that systemctl does not execute stop actually
> 
> 
> How can I stop nscd.service by systemctl when it is started not by
> systemctl?

You cannot. systemd is a service manager. When you tell it to manage
something that means it will start/stop/introspect/... it for you. But
if you manage the service on your own, outside of it, then it won't do
any of that.

Hence: either let systemd the service and then also stop it for you,
or do it yourself, but you cannot let it stop it for you but not start
it in the first place.

Sorry,

Lennart

-- 
Lennart Poettering, Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170628/5fc515a1/attachment.html>


More information about the systemd-devel mailing list