rabbit-fence fails to start on centos7 by systemd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Committed
|
High
|
Wei Hui | ||
Mitaka |
Won't Fix
|
High
|
Oleksiy Molchanov | ||
Newton |
Won't Fix
|
High
|
Oleksiy Molchanov |
Bug Description
Detailed bug description:
systemctl start rabbit-fence fails to brige up rabbit-fence.
[root@node-39 ~]# systemctl status rabbit-fence
● rabbit-
Loaded: loaded (/etc/rc.
Active: failed (Result: exit-code) since Sat 2016-10-15 15:19:51 CST; 3h 25min ago
Docs: man:systemd-
Process: 23654 ExecStop=
Process: 23663 ExecStart=
Oct 15 15:14:51 node-39.fuelnode systemd[1]: Starting SYSV: Starts/Stops RabbitMQ fence daemon...
Oct 15 15:14:51 node-39.fuelnode python[21213]: rabbit-fence 2016-10-15 15:14:51,724 INFO Caught SIGTERM, terminating...
Oct 15 15:14:51 node-39.fuelnode python[21213]: rabbit-fence 2016-10-15 15:14:51,928 ERROR A generic exception caught!
Oct 15 15:14:52 node-39.fuelnode python[23663]: rabbit-fence 2016-10-15 15:14:52,027 INFO Starting rabbit fence script main loop
Oct 15 15:19:51 node-39.fuelnode systemd[1]: rabbit-
Oct 15 15:19:51 node-39.fuelnode python[23663]: rabbit-fence 2016-10-15 15:19:51,702 INFO Caught SIGTERM, terminating...
Oct 15 15:19:51 node-39.fuelnode systemd[1]: rabbit-
Oct 15 15:19:51 node-39.fuelnode systemd[1]: Failed to start SYSV: Starts/Stops RabbitMQ fence daemon.
Oct 15 15:19:51 node-39.fuelnode systemd[1]: Unit rabbit-
Oct 15 15:19:51 node-39.fuelnode systemd[1]: rabbit-
Hint: Some lines were ellipsized, use -l to show in full.
The fuel-rabbit-
#######
[root@node-39 ~]# cat /run/systemd/
# Automatically generated by systemd-
[Unit]
Documentation=
SourcePath=
Description=SYSV: Starts/Stops RabbitMQ fence daemon
Before=
After=network-
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=
ExecStop=
#######
Notice the service Type=forking, which indicates rabbit-fence fork a child process and parent process exit.
But when rabbit-fence.py creates DaemonContext, it does not give arg detach_
the python daemon lib does not fork.
https:/
Steps to reproduce:
systemctl restart rabbit-fence
Expected results:
rabbit-fence begin to run
Actual result:
systemd fail to start rabbit-fence
Reproducibility:
100%
Workaround:
When build fuel-rabbit-fence rpm package, use debian/
or
When create DaemonContext give arg detach_process=True
This problem is not unique to centos7, when ubuntu switchs to systemd, may face the same problem.
In systemd service unit file, Type can be simple, forking, notify....
simple: systemd just start the process.
forking: systemd start the process and wait the process fork a child and exit.
notify: systemd start the process and wait for the procces notify itself that it is ready to work.
forking is much robust then simple, although we can not guarantee the child process will run normally after the fork, at least it has a better percentage of success. While notify is best, but it has to change application code and
use systemd lib code, which is less portable.
So the second solution is better.
Impact:
Fuel deploy failed
Description of the environment:
Operation system: 7.1.1503
Versions of components: fuel 9.0
Reference architecture: x86_64
Changed in fuel: | |
importance: | Undecided → High |
milestone: | none → 10.0 |
Changed in fuel: | |
assignee: | Wei Hui (huiweics) → Maksim Malchuk (mmalchuk) |
tags: | added: area-library |
Changed in fuel: | |
assignee: | Maksim Malchuk (mmalchuk) → Wei Hui (huiweics) |
Changed in fuel: | |
milestone: | 10.0 → 11.0 |
Fix proposed to branch: master /review. openstack. org/387930
Review: https:/