#48148 start/stop/restart-dirsrv utilities should ignore admin-serv directory (1.2.11 only)
Closed: wontfix Opened by nhosoi.

Description of problem:
When invoked, {start,stop,restart}-dirsrv utilities are trying to
start/stop/restart admin instance.
Command line utilities start-dirsv, stop-dirsrv and restart-dirsrv should
ignore admin-serv directory.

Steps to Reproduce:
1. yum install 389-ds-base 389-ds-admin
2. setup-ds.pl
3. run start-dirsrv, restart-dirsrv, stop-dirsrv

Actual results:
[root@rhel6ds ~]# start-dirsrv
Starting instance "admin"
/usr/sbin/start-dirsrv: line 63: ./ns-slapd: No such file or directory
Starting instance "rhel6ds"

[root@rhel6ds ~]# restart-dirsrv
Restarting instance "admin"
No ns-slapd PID file found. Server is probably not running
/usr/sbin/start-dirsrv: line 63: ./ns-slapd: No such file or directory
Restarting instance "rhel6ds"

[root@rhel6ds ~]# stop-dirsrv
Stopping instance "admin"
No ns-slapd PID file found. Server is probably not running
Stopping instance "rhel6ds"

Expected results:
Command line utilities start-dirsv, stop-dirsrv and restart-dirsrv should
ignore admin-serv directory

Additional info:
This was fixed in https://fedorahosted.org/389/ticket/47299 for 1.3.x branch.


Thank you for the review, Rich!

Pushed to 389-ds-base-1.2.11:
88ecf0c..37d5696 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 349db8decaff0d3a3b63aafc22c4b1714c4e9573

git patch file (1.2.11 branch) -- additional fix for restart-dirsrv and non-root user
0001-Ticket-48148-start-stop-restart-dirsrv-utilities-sho.2.patch

Could you just do this?
{{{
for i in $initconfig_dir/@package_name@-; do
if [ ! -f "$i" ] ; then break ; fi
regex=s,$initconfig_dir/@package_name@-,,g
inst=echo $i | sed -e $regex
...
}}}
Note that if no files match $initconfig_dir/@package_name@-
, $i will have the literal value '$initconfig_dir/@package_name@-'. Since '' is a shell metacharacter, you should not reference unless it is quoted or escaped. That's why you have to do the -f test with "$i" instead of $i.

A good idea! Thanks, Rich. Verified the change. A new patch is coming...
{{{
+ '[' nhosoi = root ']'
+ initconfig_dir=/home/nhosoi/.dirsrv
+ '[' 0 -eq 0 ']'
+ ret=0
+ for i in '$initconfig_dir/dirsrv-'
+ '[' '!' -f '/home/nhosoi/.dirsrv/dirsrv-
' ']'
+ break
+ exit 0
}}}

git patch file (1.2.11 branch) -- revised: additional fix for restart-dirsrv and non-root user
0001-Ticket-48148-start-stop-restart-dirsrv-utilities-sho.3.patch

Reviewed by Rich (Thank you!!)

Pushed to 389-ds-base-1.2.11:
b97803f..070037a 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 070037a3f9ac880c5c38e38419ad23bf4209eb47

I think you need to remove the opshared.c patch

Replying to [comment:12 rmeggins]:

I think you need to remove the opshared.c patch

Agh... Sorry, I did not notice it... Removing the part...

git patch file (1.2.11 branch) -- fixing coverity defects
0001-Ticket-48148-start-stop-restart-dirsrv-utilities-sho.4.patch

Pushed to 389-ds-base-1.2.11:
commit d49ef9b91ae60799e3c497a907d22400499b33f8

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

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/1479

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