[systemd-devel] systemctl how to stop a service
Andrei Borzenkov
arvidjaar at gmail.com
Mon May 16 10:53:06 UTC 2016
16.05.2016 13:28, Reindl Harald пишет:
>
>
> Am 16.05.2016 um 08:58 schrieb Andrei Borzenkov:
>> 16.05.2016 09:01, liuxueping пишет:
>>> Do you mean to say that systemctl will return a value when the process
>>> is still at terminate gracefully?
>>>
>>
>> By default systemctl should wait for stop job to complete. What may
>> happen - if it takes more time than JobTimeout, job is canceled while
>> systemd is still trying to terminate unit. At least so is my
>> understanding
>
> IT DON'T RELIEABLE - my harddisks still making a lot of nosie by
> suspending 3 VMware guests on a RAOD10 with 4 different disks and i have
> observed similar behavior for single services too
>
> [root at srv-rhsoft:~]$ time systemctl stop vmware-guest.target
> real 0m2.484s
> user 0m0.007s
> sys 0m0.010s
>
> [root at srv-rhsoft:~]$ systemctl status vmware-guest.target
> vmware-guest.target - VMware Guest Group
> Loaded: loaded (/etc/systemd/system/vmware-guest.target; enabled;
> vendor preset: disabled)
> Active: inactive (dead) since Mo 2016-05-16 12:25:18 CEST; 1min 19s ago
>
> Mai 16 12:25:18 srv-rhsoft.rhsoft.net systemd[1]: Stopped target VMware
> Guest Group.
> Mai 16 12:25:18 srv-rhsoft.rhsoft.net systemd[1]: Stopping VMware Guest
> Group.
> Warning: Journal has been rotated since unit was started. Log output is
> incomplete or unavailable.
>
I am not sure what this example illustrates. Targets do not start or
stop anything; so stopping *target* does indeed happen instantaneously.
Unless stopping target causes services to be stopped *and* target is
configured to be stopped *after* services.
More information about the systemd-devel
mailing list