[systemd-devel] systemd kills mdmon if it was started manually by user
Lennart Poettering
lennart at poettering.net
Tue Nov 8 06:43:37 PST 2011
On Mon, 07.11.11 11:09, Williams, Dan J (dan.j.williams at intel.com) wrote:
> >> What exactly is "kill_all_processes()"? is it SIGTERM or SIGKILL or both
> >> with a gap or ???
> >
> > SIGTERM followed by SIGKILL after 5s if the programs do not react to
> > that in time. But note that this logic only applies to processes which
> > for some reason managed to escape systemd's usual cgroup-based killing
> > logic. Normal services are hence already killed at that time, and only
> > processes which moved themselves out of any cgroup or for which the
> > service files disabled killing might survive to this point.
>
> So I think mdmon should always try to escape itself from cgroup based
> killing. It follows the lifespan of the array, and if the array is
> not stopped by the cgroup exit (or the array lifespan is not
> controlled in a service file), then mdmon must keep running.
Well, I think when it gets killed by the cgroup-based killer then it
should try to tear down its MD device.
In the mdmon service file use SendSIGKILL=no to disable sending of
SIGKILL after the initial SIGTERM. With KillSignal= you chan choose the
signal you first want to be killed with, if you don't want it to be
SIGTERM. With KillMode= you can choose whether only the main process of
the service, all processes of the service, or no processes of the
service shall be killed. With TimeoutSec= you can set the timeout
between the SIGTERM and the SIGKILL. See systemd.service(5) for more
information.
> > You have relatively flexible control of the first step in this code. The
> > second step is then the hammer that tries to fix up what this step
> > didn't accomplish. My suggestion to check argv[0][0] was to avoid the
> > hammer.
>
> I notice that if the rootfs is on a dm or md device systemd/shutdown
> will always fall through to ultimate_send_signal() which will not
> discriminate against processes flagged with '@'. Since we aren't
> stopping the root md device I wonder if ultimate_send_signal() should
> also ignore flagged processes, or whether the failure to stop the root
> device is to be expected and let shutdown skip ultimate_send_signal()
> if the only remaining work is shutting down the rootfs-blockdev. I'm
> leaning towards the latter.
The idea was to skip processes flgged with '@' in both the
ultimate_send_signal() and send_signal() calls.
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list