[systemd-devel] Failed to restart ntpd
Kai Krakow
hurikhan77 at gmail.com
Sat May 21 09:19:16 UTC 2016
Am Thu, 12 May 2016 11:51:13 +0200
schrieb Reindl Harald <h.reindl at thelounge.net>:
> 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
This situation may also happen, if shell scripts provide services and
try to do funny things like "su - $user" to switch to another user. This
creates a new session, PIDs started there seem not to be tracked by
systemd as part of the service. Reliable teardown by systemd is then
broken.
I had this problem with dccifd whose scripts try to be extraordinary
smart and reinvent the wheel.
--
Regards,
Kai
Replies to list-only preferred.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digitale Signatur von OpenPGP
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160521/5996ef86/attachment-0001.sig>
More information about the systemd-devel
mailing list