Bug 1403959

Summary: condrestart doesn't restart slapd
Product: Red Hat Enterprise Linux 6 Reporter: Stefan Kremen <skremen>
Component: openldapAssignee: Matus Honek <mhonek>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.9CC: pkis
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-19 13:44:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Stefan Kremen 2016-12-12 17:25:58 UTC
Description of problem:
======================
Using "service slapd condrestart" restarts correctly when slapd is running:

# service slapd start
Starting slapd:                                            [  OK  ]

# service slapd condrestart
Stopping slapd:                                            [  OK  ]
Starting slapd:                                            [  OK  ]

# service slapd status
slapd (pid  2527) is running...

# echo $?
0


But condrestart doesn't restart slapd when it is stopped:

# service slapd stop
Stopping slapd:                                            [  OK  ]

# service slapd condrestart
# echo $?
0

# service slapd status
slapd is stopped
# echo $?
3

Version-Release number of selected component (if applicable):
============================================================
openldap-servers-2.4.40-16.el6

How reproducible:
================
always

Steps to Reproduce:
==================
1. service slapd stop
2. service slapd condrestart
3. service slapd status

Actual results:
==============
slapd is stopped

Expected results:
================
slapd is running

Additional info:
===============

Comment 1 Matus Honek 2016-12-19 09:42:50 UTC
Is not this the expected behaviour? I cannot find a manpage for sysV specifically but the systemd's equivalent should be the `try-restart` command of systemctl(1) (of course not to be found in RHEL-6) which has also an (undocumented?) `condrestart` option; quoting the manpage: Restart one or more units specified on the command line if the units are running. This does nothing if units are not running.

Comment 2 Stefan Kremen 2016-12-19 13:44:28 UTC
test case modified to expected behaviour and closing this ticket.