[systemd-devel] Failed to restart ntpd

Reindl Harald h.reindl at thelounge.net
Thu May 12 09:51:13 UTC 2016



Am 12.05.2016 um 11:46 schrieb liuxueping:
> Before i restart ntpd,ntpd process was running:
> ntp       3993  0.0  0.0   7404  4156 ?        Ss   10:21   0:00
> /usr/sbin/ntpd -u ntp:ntp -g
> root      3995  0.0  0.0   7404  2364 ?        S    10:21   0:00
> /usr/sbin/ntpd -u ntp:ntp -g
> so,it should be killed by systemctl and restart a new ntpd process,but
> it failed,i want to know systemd how to judge that a process is killed
> completed to start a new service.

again: systemd monitors all processes part of a service
systemctl itself does nothing, it just invokes commands

when you manually started a ntpd process systemd don't know it should be 
killed and *it should not* get killed just because "systemctl restart ntpd"

so when there is a ntpd process which is not listed in "systemctl 
status" you or something has manually fired up that process - don't do 
that at all - and you need to kill it the same way


[root at rh:~]$ systemctl status ntpd
● ntpd.service - Network Time Service
    Loaded: loaded (/etc/systemd/system/ntpd.service; enabled; vendor 
preset: disabled)
    Active: active (running) since Do 2016-05-12 10:17:54 CEST; 1h 31min ago
  Main PID: 981 (ntpd)
    CGroup: /system.slice/ntpd.service
            └─981 /usr/sbin/ntpd -4 -d -u ntp:ntp -p /var/run/ntpd.pid -g

> 在 2016/5/12 16:51, Reindl Harald 写道:
>>
>> Am 12.05.2016 um 09:17 schrieb liuxueping:
>>> Hi:
>>> It failed when i restarted ntpd service,the log showed:ntpd[3163]:
>>> unable to bind to wildcard address 0.0.0.0 - another process may be
>>> running - EXITING,and the ps command result showed:
>>> ntp       3993  0.0  0.0      0     0 ?        Ds   10:21   0:00 [ntpd]
>>> root      3995  0.0  0.0      0     0 ?        Z    10:21   0:00 [ntpd]
>>> <defunct>
>>> Maybe it failed because a ntpd process was still in system when started
>>> a new ntpd service.If so, how does systemctl judge that a process is
>>> over and start a new process?
>>
>> most likely the running one was not started by ntpd.service and hence is
>> also not killed by systemctl - systemd is not a blind butcher like
>> shell-scripts - it *knows* which processes are part of a
>> service/service-group

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160512/26817348/attachment.sig>


More information about the systemd-devel mailing list