On Sun, Mar 20, 2016 at 05:51:30PM +0000, Tim Preston wrote:

> I was having a problem making the audio/teamspeak3-server port start
> fro the rc.d scripts on a  -current box that I’ve just built. I
> eventually traced this down to it not starting in the correct
> directory.

> Looking at the rc.d script I could see that it was attempting to chdir
> to  the correct directory by setting the teamspeak_chdir variable. So
> it looked like this feature was misbehaving in some way.

> To test this I put together an rc.d script for pwd that used
> ${name}_chdir based on how the teamspeak rc.d script was setup.
> Running this on a 10.3 box showed that it was changing to the
> specified directory as expected, but on -current it was not.

> I’ve taken a quick look at rc.subr on both boxes but I can’t
> immediately see what’s breaking this, and I can’t see anything in the
> setup or behaviour of the -current box that would point to it being
> something that I’ve broken somehow there.

> I was wondering if anyone else could reproduce this?

The NAME_chdir variable prepends 'cd $NAME_chdir && ' to the command at
a certain point. Prepending further commands like limits (as added by
SVN r288291) will not work properly. The older $NAME_prepend feature is
broken in the same way. The cd command is having the limits or similar
applied to it while the real command is running without proper limits
and current directory.

The NAME_user and NAME_nice variables use sh -c to avoid this problem
but it introduces double-quoting issues (i.e. using arguments containing
certain special characters requires an additional unexpected level of

Prepending cd at a later time would avoid the problem with limits and
NAME_prepend and allow getting rid of sh -c, but would change the
directory as root so permission problems with NAME_user would be
detected later.

Jilles Tjoelker
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to