Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcs trying to use systemctl even though sysvinit is the init system #118

Closed
jpraczyk opened this issue Dec 5, 2016 · 3 comments
Closed

Comments

@jpraczyk
Copy link

jpraczyk commented Dec 5, 2016

System: Debian 8 Jessie

In Debian's case it is perfectly fine to have multiple init systemd installed at the same time.
The is_systemctl check performed in lib/external.py assumes that if there are systemd's binaries installed in the system, then it must be running systemd as init system.

Steps to reproduce:

  1. Install sysvinit-core
  2. Reboot the system
  3. Try starting the cluster
  4. Receive the following error when running pcs cluster start:
# pcs cluster start
Starting Cluster...
Failed to get D-Bus connection: Unknown error -1
Error: unable to start corosync
# /etc/init.d/corosync status
corosync is running.

To workaround this issue, one could simply remove systemd from the system, but it's inconvenient.

# apt remove systemd -y
# pcs cluster start
Starting Cluster...

Proposed solutution:
Check if systemd is used as the init system. Sysvinit will always have pid = 1, whereas in systemd's case it appears to be somewhat random:

$ pidof systemd
6906
# pidof systemd
# pidof init
1
@tomjelinek
Copy link
Member

Using pidof is not reliable. On RHEL7 pidof systemd returns 1.

Can you check if /run/systemd/system or /var/run/systemd/system exist when your init system is systemd and not exist when your init system is SysVinit?

@vvidic
Copy link
Contributor

vvidic commented Feb 8, 2017

The standard check for a running systemd in the packaging scripts is:

if [ -d /run/systemd/system ]; then ...

so the same directory check should work in python too.

@tomjelinek
Copy link
Member

Fixed in fbfe34f and 604692f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants