#48448 dirsrv start-stop fail in certain shell environments.
Closed: Fixed None Opened 3 years ago by firstyear.

We commonly use the pattern:

cd $SERVERBIN_DIR; ./ns-slapd

The issue with this is that under certain shell environments, this fails.

/usr/sbin/start-dirsrv: line 73: ./ns-slapd: No such file or directory

We should change this to:

$SERVERBIN_DIR/ns-slapd

This is explicit and avoids the shell issues that we are experiencing between newer el versions and other linux platforms.

Note: This will need backporting to 1.3.4.X


Looks good to me.

I was wondering any code expects to be in the directory after the "cd $SERVERBIN_DIR" line, but I did not see any. So, it should be safe.

Could you please tell us how to reproduce "./ns-slapd: No such file or directory"?

I can reproduce on gentoo out of the box, all scripts break.

I can reproduce on latest EL7 installing freeipa (ipa fails to install as ldif2db cannot run)

I initially saw this on EL7, but assumed it was a local system issue. When I could reproduce on a second EL7 system, and during my port to gentoo, I decided that it was a more serious shell environment issue, so it should be corrected.

Thanks for the ack!

To ssh://git.fedorahosted.org/git/389/ds.git
257006f..1d4fcea master -> master

commit 1d4fcea

Replying to [comment:3 firstyear]:

I can reproduce on gentoo out of the box, all scripts break.

I can reproduce on latest EL7 installing freeipa (ipa fails to install as ldif2db cannot run)

I initially saw this on EL7, but assumed it was a local system issue. When I could reproduce on a second EL7 system, and during my port to gentoo, I decided that it was a more serious shell environment issue, so it should be corrected.

Whoa. They look serious. What "shell" is being used on them?

EL7 was bash, one was zsh. Gentoo was bash.

I think there is something around how our scripts call to /bin/sh not /bin/bash. It changes the way bash functions.

But it's only recently this has started to break (for me) at least. I think that a defensive solution like this, is the best one.

Pushed to 1.3.4:

To ssh://git.fedorahosted.org/git/389/ds.git
5453bfe..099883c 389-ds-base-1.3.4 -> 389-ds-base-1.3.4

commit 099883c

Metadata Update from @nhosoi:
- Issue assigned to firstyear
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

2 years ago

Login to comment on this ticket.

Metadata