Project

General

Profile

Actions

Bug #14553

closed

systemctl stop rudder-slapd does not actually stop rudder's slapd

Added by François ARMAND over 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
N/A
Assignee:
-
Category:
System integration
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

On centos7, rudder 5.0.9-nightly.
It may have been because my slapd was in some incorrect state, but systemd was totally lying about what he was doing:

[root@server vagrant]# systemctl status rudder-slapd
● rudder-slapd.service - LSB: OpenLDAP
   Loaded: loaded (/etc/rc.d/init.d/rudder-slapd; bad; vendor preset: disabled)
   Active: active (running) since Sat 2019-03-30 20:55:58 UTC; 1s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7898 ExecStop=/etc/rc.d/init.d/rudder-slapd stop (code=exited, status=0/SUCCESS)
  Process: 7943 ExecStart=/etc/rc.d/init.d/rudder-slapd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rudder-slapd.service
           └─7985 /opt/rudder/libexec/slapd -h ldap://localhost:389 -n rudder-slapd -f /opt/rudder/etc/openldap/slapd.conf

Mar 30 20:55:56 server rudder-slapd[7943]: rudder-slapd: [INFO] no db_recover done
Mar 30 20:55:56 server rudder-slapd[7943]: rudder-slapd: [INFO] Launching OpenLDAP...
Mar 30 20:55:56 server rudder-slapd[7943]: rudder-slapd: [OK] file descriptor limit set to 1024
Mar 30 20:55:57 server rudder-slapd[7984]: @(#) $OpenLDAP: slapd 2.4.46 (Mar 30 2019 04:36:47) $
                                                   root@localhost.localdomain:/usr/src/rudder-packages/package/BUILD/openldap-source/servers/slapd
Mar 30 20:55:57 server rudder-slapd[7984]: daemon: bind(7) failed errno=98 (Address already in use)
Mar 30 20:55:57 server rudder-slapd[7984]: daemon: bind(7) failed errno=98 (Address already in use)
Mar 30 20:55:57 server rudder-slapd[7985]: slapd starting
Mar 30 20:55:58 server rudder-slapd[7943]: rudder-slapd: [OK] OpenLDAP started on port 389 and 636
Mar 30 20:55:58 server rudder-slapd[7943]: rudder-slapd: [INFO] Prefetching data for cache warmup
Mar 30 20:55:58 server systemd[1]: Started LSB: OpenLDAP.

[root@server vagrant]# systemctl stop rudder-slapd
[root@server vagrant]# systemctl status rudder-slapd
● rudder-slapd.service - LSB: OpenLDAP
   Loaded: loaded (/etc/rc.d/init.d/rudder-slapd; bad; vendor preset: disabled)
   Active: inactive (dead) since Sat 2019-03-30 21:07:57 UTC; 6s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 11209 ExecStop=/etc/rc.d/init.d/rudder-slapd stop (code=exited, status=0/SUCCESS)
  Process: 7943 ExecStart=/etc/rc.d/init.d/rudder-slapd start (code=exited, status=0/SUCCESS)

Mar 30 21:07:56 server rudder-slapd[11209]: rudder-slapd: [INFO] Halting OpenLDAP...
Mar 30 21:07:56 server rudder-slapd[7985]: daemon: shutdown requested and initiated.
Mar 30 21:07:56 server rudder-slapd[7985]: slapd shutdown: waiting for 0 operations/tasks to finish
Mar 30 21:07:56 server rudder-slapd[7985]: slapd stopped.
Mar 30 21:07:57 server rudder-slapd[11209]: rudder-slapd: [OK] OpenLDAP stopped after 1 seconds
Mar 30 21:07:57 server rudder-slapd[11209]: rudder-slapd: [INFO] Launching OpenLDAP database backup...
Mar 30 21:07:57 server rudder-slapd[11209]: rudder-slapd: [OK] data save in /var/rudder/ldap/backup/openldap-data-20190330210756.ldif
Mar 30 21:07:57 server rudder-slapd[11209]: rudder-slapd: [INFO] Halting OpenLDAP replication...
Mar 30 21:07:57 server rudder-slapd[11209]: rudder-slapd: [INFO] no replica found in configuration, aborting stopping slurpd
Mar 30 21:07:57 server systemd[1]: Stopped LSB: OpenLDAP.
[root@server vagrant]# ldapsearch  -o ldif-wrap=no -h localhost -p 389 -LLL -x -D "cn=Manager,cn=rudder-configuration" -w c2375d179110 -b "ou=Nodes,cn=rudder-configuration" -s one
dn: nodeId=root,ou=Nodes,cn=rudder-configuration
objectClass: rudderPolicyServer
objectClass: rudderNode
objectClass: top
cn: root
nodeId: root
description: the policy server
isSystem: TRUE
isBroken: FALSE

dn: nodeId=a81c4150-974f-4155-a9b9-3cd2c38dbf96,ou=Nodes,cn=rudder-configuration
nodeId: a81c4150-974f-4155-a9b9-3cd2c38dbf96
objectClass: rudderNode
objectClass: top
cn: a81c4150-974f-4155-a9b9-3cd2c38dbf96
state: enabled
isSystem: FALSE

[root@server vagrant]# ps aux | grep slapd
root      2495  0.0  0.6 105174488 6888 ?      Ssl  20:24   0:01 /opt/rudder/libexec/slapd -h ldap://localhost:389 -n rudder-slapd -f /opt/rudder/etc/openldap/slapd.conf
root     11281  0.0  0.0 112708   972 pts/0    S+   21:09   0:00 grep --color=auto slapd

At least, service doesn't lie:

[root@server vagrant]# [root@server vagrant]# service rudder-slapd stop
rudder-slapd: [INFO] Using /etc/default/rudder-slapd for configuration
rudder-slapd: [OK] virtual memory limit set to unlimited
rudder-slapd: [INFO] Halting OpenLDAP...
rudder-slapd: [INFO] can't read slapd PID file (/var/rudder/run/slapd.pid), to stop rudder-slapd try: /etc/init.d/rudder-slapd forcestop
rudder-slapd: [INFO] Halting OpenLDAP replication...
rudder-slapd: [INFO] no replica found in configuration, aborting stopping slurpd
[root@server vagrant]# ps aux | grep slapd
root      2495  0.0  0.6 105174488 7088 ?      Ssl  20:24   0:01 /opt/rudder/libexec/slapd -h ldap://localhost:389 -n rudder-slapd -f /opt/rudder/etc/openldap/slapd.conf
root     11797  0.0  0.0 112708   968 pts/0    S+   21:14   0:00 grep --color=auto slapd
[root@server vagrant]# service rudder-slapd forcestop
rudder-slapd: [INFO] Using /etc/default/rudder-slapd for configuration
rudder-slapd: [OK] virtual memory limit set to unlimited
rudder-slapd: [INFO] Killing OpenLDAP with force...
rudder-slapd: [OK] all rudder-slapd process killed with force
rudder-slapd: [INFO] Killing OpenLDAP replication with force...
rudder-slapd: [INFO] Found no slurpd process running

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #14558: Errors and warnings while upgrading from 4.3 to 5.0 on centos7RejectedActions
Actions #1

Updated by François ARMAND over 5 years ago

The problem is on our slapd init script which always returns 0, and should not.

Actions #2

Updated by François ARMAND over 5 years ago

  • Related to Bug #14558: Errors and warnings while upgrading from 4.3 to 5.0 on centos7 added
Actions #3

Updated by Nicolas CHARLES over 5 years ago

i do have an exit code 1

root@server:/home/vagrant# /etc/init.d/rudder-slapd restart
rudder-slapd: [INFO] Using /etc/default/rudder-slapd for configuration
rudder-slapd: [OK] virtual memory limit set to unlimited
rudder-slapd: [INFO] Halting OpenLDAP...
rudder-slapd: [INFO] can't read slapd PID file (/var/rudder/run/slapd.pid), to stop rudder-slapd try: /etc/init.d/rudder-slapd forcestop
rudder-slapd: [INFO] Halting OpenLDAP replication...
rudder-slapd: [INFO] no replica found in configuration, aborting stopping slurpd
rudder-slapd: [INFO] Launching OpenLDAP configuration test...
rudder-slapd[12648]: [INFO] Using /etc/default/rudder-slapd for configuration
rudder-slapd: [OK] OpenLDAP configuration test successful
rudder-slapd: [INFO] Launching OpenLDAP replication...
rudder-slapd: [INFO] no replica found in configuration, aborting lauching slurpd
rudder-slapd: [INFO] no db_recover done
rudder-slapd: [INFO] Launching OpenLDAP...
rudder-slapd: [OK] file descriptor limit set to 1024
rudder-slapd[12665]: [ALERT] no PID file for rudder-slapd
root@server:/home/vagrant# echo $?
1

Actions #4

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.9 to 5.0.10
Actions #5

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.10 to 5.0.11
Actions #6

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.11 to 5.0.12
Actions #7

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.12 to 5.0.13
Actions #8

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.13 to 5.0.14
Actions #9

Updated by Vincent MEMBRÉ about 5 years ago

  • Target version changed from 5.0.14 to 5.0.15
Actions #10

Updated by Vincent MEMBRÉ about 5 years ago

  • Target version changed from 5.0.15 to 5.0.16
Actions #11

Updated by Alexis Mousset almost 5 years ago

  • Target version changed from 5.0.16 to 5.0.17
Actions #12

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.17 to 5.0.18
Actions #13

Updated by Alexis Mousset over 4 years ago

Init script is no more as of 6.0, closing.

Actions #14

Updated by François ARMAND over 4 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF