rhel7 / systemd -- killing mysqld causes lingering systemd processes
Bug #1396757 reported by
Jay Janssen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
If I have a running mysqld on Centos 7 and it is killed, systemd likes to spawn some garbage:
32246 ? Ss 0:00 /bin/sh /usr/bin/
32680 ? Sl 0:00 \_ /usr/sbin/mysqld --basedir=/usr --datadir=
[root@node1 ~]# killall -9 mysqld
364 ? Ss 0:00 /bin/bash -ue /usr/bin/
408 ? S 0:00 \_ sleep 1
This prevents me from restarting mysql, any subsequent mysql start action hangs until that process is killed.
To post a comment you must log in.
@Jay,
The 'garbage' is due to the fact that mysqld is SIGkilled but its PID file still remains, so the script waits for it upto timeout (900s) and then exits. This is same behavior as 'service mysql stop'. So, removing the stale PID file should also do.
In any case, I have modified it to check for this and mysql-systemd will exit early.
On a long term, this can be fixed by replacing mysqld_safe and calling mysqld directly in unit file. That should avoid any need for these pre/post scripts.