Bug 740724

Summary: High availability with pacemaker does not work, because systemd is not lsb compliant
Product: [openSUSE] openSUSE 12.1 Reporter: template late <another0003>
Component: BasesystemAssignee: Frederic Crozat <fcrozat>
Status: RESOLVED NORESPONSE QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: suse-beta
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description template late 2012-01-11 09:46:38 UTC
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1

The startup of services is done through systemd in openSUSE 12.1. systemd supports old lsb scripts, but is not fully lsb compliant in handling the startup of those. The lsb standard for init scripts forces, that a status call to a service that is not fully running does not return a status of 0, but systemd does so.

For this reason the resource manager pacemaker for high availability systems does not work, because it manages the services through the lsb scripts and they must conform to the lsb standard for the resource monitoring to work. If pacemaker makes a request to check the status of a resource and wants to know if it has to be restarted because it crashed, it will not detect the crash because systemd does continue to report a service status of 0, even if the service has crashed.

In consequence that means that the two provided packages systemd and pacemaker do not work together under openSUSE 12.1

Reproducible: Always

Steps to Reproduce:
The following steps require mysql

opensuse121:~ # rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: inactive (dead) since Wed, 11 Jan 2012 10:33:27 +0100; 21s ago
         Process: 3770 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
         Process: 2315 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
opensuse121:~ # echo $?
3
opensuse121:~ # rcmysql start
redirecting to systemctl
opensuse121:~ # rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: active (running) since Wed, 11 Jan 2012 10:34:02 +0100; 3s ago
         Process: 3770 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
         Process: 3819 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
                  + 3867 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --user=mysql --pid-file=/var/run/mysql/mysqld.pid --socket=/var/run/mysql/mysql.so...
                  + 4194 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log...
opensuse121:~ # echo $?
0
opensuse121:~ # kill 3867 4194
opensuse121:~ # rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: active (exited) since Wed, 11 Jan 2012 10:34:02 +0100; 20s ago
         Process: 3770 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
         Process: 3819 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
opensuse121:~ # echo $?
0
vcs-suse121x64-cl1:~ # mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
opensuse121:~ # rcmysql stop
redirecting to systemctl
opensuse121:~ # rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: inactive (dead) since Wed, 11 Jan 2012 10:34:29 +0100; 3s ago
         Process: 4236 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
         Process: 3819 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
opensuse121:~ # echo $?
3

Actual Results:  
opensuse121:~ # rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: active (exited) since Wed, 11 Jan 2012 10:34:02 +0100; 20s ago
         Process: 3770 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
         Process: 3819 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
opensuse121:~ # echo $?
0

After a crash, still return a status of 0.

Expected Results:  
opensuse121:~ # rcmysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
          Loaded: loaded (/etc/init.d/mysql)
          Active: active (exited) since Wed, 11 Jan 2012 10:34:02 +0100; 20s ago
         Process: 3770 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
         Process: 3819 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/mysql.service
opensuse121:~ # echo $?
3 or 4

Should return a status code that shows up that the service is not running

For Fedora, a related problem has been reported here

https://bugzilla.redhat.com/show_bug.cgi?id=702621

In the following article it is mentioned, that pacemaker wont work with systemd because it is not lsb compliant

http://fedoraproject.org/wiki/Features/pacemaker-cloud
Comment 1 Frederic Crozat 2012-01-12 09:54:23 UTC
this is because the lsb initscript is detected not as a "daemon" service (probably related to bnc#727771), so systemd has no way to detect if if no daemon is running is a "normal" behavior or not.

Could you try adding #X-Systemd-RemainAfterExit: false in the lsb header ?

You could also try with # Pidfile: /var/run/mysql/mysql.pid but it won't work in the multi-mysql case.
Comment 2 Stefan Behlert 2012-06-19 11:54:15 UTC
No answer for several months. Re-open when you have the requested information, thanks.