#48144 Add /usr/sbin/status-dirsrv script to get the status of the directory server instance.
Closed: wontfix Opened by amsharma.

Currently, we have these scripts ::
/usr/sbin/start-dirsrv
/usr/sbin/stop-dirsrv
/usr/sbin/restart-dirsrv

It is good to have status-dirsrv script which can give current status of directory server that is it started or stopped.


git patch file (master) -- derived files by autogen
0002-Ticket-48144-Add-usr-sbin-status-dirsrv-script-to-ge.patch

Looks like status_instance() always returns 1, is that correct?

Replying to [comment:4 mreynolds]:

Looks like status_instance() always returns 1, is that correct?
A very good point... That's not right. I'm replacing the patch...

Here's the exit value from the revised code.

status-dirsrv

status-dirsrv

echo $?

0

status-dirsrv bogus

echo $?

1

Can we return a different code for bogus?

This will let us call this and make decisions about if a server:

  • Exists and is running
  • Exists and in stopped
  • Does not exist.

Replying to [comment:8 firstyear]:

Can we return a different code for bogus?

This will let us call this and make decisions about if a server:

  • Exists and is running
  • Exists and in stopped
  • Does not exist.

Are there any standard we should follow?

git patch file (master) -- revised following the comments by William in #comment:8
0001-Ticket-48144-Add-usr-sbin-status-dirsrv-script-to-ge.patch

{{{
$ man status-dirsrv
[...]
EXIST STATUS
status-dirsrv returns 0 if all Directory Server instances are running. Otherwise, a non-
zero failure code returned from systemctl is returned.

If a single Directory Server instance is specified, 0 is returned if the instance is run‐
ning; a non-zero failure code returned from systemctl is returned if the instance is not
running; 255 is returned if the instance does not exist.
}}}

Reviewed by Mark and William (Thank you!!)

Pushed to master:
5e689f8..68659b6 master -> master
commit 44333d1ae7d619fe800ef9a8d8550d2fdcf7c553
commit 68659b64ce8ecb12a62d0984ed026e6dd3fc73ec

Sorry, additional push:
68659b6..6566d89 master -> master
commit 6566d89d975f950b73de12b457ad8c79340101ba

Implement this:
https://bugzilla.redhat.com/show_bug.cgi?id=1209128#c5

Grammatical error in man page:

{{{
represents the number of server instance which is not running.
}}}

It should be:
{{{
represents the number of server instances which are not running.
}}}

Otherwise, ack

git patch file (master) -- additional enhancement for the exit code; revised the grammatical error in man page.
0001-Ticket-48144-Add-usr-sbin-status-dirsrv-script-to-ge.2.patch

Thank you so much, Mark! Fixed the man page.

Thanks to Mark for reviewing the patch.

Pushed to master:
347b3fe..6ec814a master -> master
commit 6ec814a0e5dcfd8cf011f046695cb23b46e92551

Viktor's proposal is reviewed and pushed to master:
f983a59..a8b07cd master -> master
commit a8b07cd2671c82421830ae94584b370436ef3434

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.3.5.0

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1475

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

Metadata