#47303 start/stop/restart dirsrv scripts should report and error if no instances
Closed: Fixed None Opened 7 years ago by rmeggins.

If there are no instances, and you run e.g. start-dirsrv, you get a very strange output:

Starting instance "*"
Instance admin-serv not found.

or Instance bin or some other strangeness. It should just detect if no instances exist, report so, and exit with an error code.


When I run start-dirsrv(without your fix) from a random directory, it looks for all the files in the current directory. Its seems to be very broken.

[root@localhost BUILD]# start-dirsrv
Starting instance "*"
Instance config.h not found.

[root@localhost ds]# start-dirsrv
Starting instance "*"
Instance 0001-Ticket-332-Fix-usage-in-scripts.patch not found.

[root@localhost ds]# ls

With your fix:

[root@localhost BUILD]# start-dirsrv
No instances found in /root/.dirsrv

Yep, looks like this is broken, if you do a su to root (not su - root):


sh -x sbin/start-dirsrv

  • '[' rich = root ']'
  • initconfig_dir=/root/.dirsrv

echo $USER


echo $HOME



uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
So once again, foiled by depending on the value of $USER to be correct. Working on a patch to use id instead

Note that if you do su - root instead of just a plain "su" the $USER is set correct to root, but we cannot rely on that

No instances found in /root/.dirsrv
is fixed in https://fedorahosted.org/389/ticket/47299

commit a10e433
Author: Rich Megginson rmeggins@redhat.com
Date: Thu Mar 21 13:25:43 2013 -0600

Metadata Update from @rmeggins:
- Issue assigned to rmeggins
- Issue set to the milestone: 1.3.1

3 years ago

Login to comment on this ticket.