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?
Simple rc.d script for pwd
-----
#!/bin/sh
# PROVIDE: pwd
# REQUIRE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
name="pwd"
rcvar=pwd_enable
db_dir=/var/db/teamspeak
command=/bin/pwd
pwd_chdir=$db_dir
required_dirs="$db_dir"
load_rc_config $name
: ${pwd_enable="NO"}
run_rc_command "$1"
-----
Running on 10.3 shows the expected result
-----
root@amy:~# uname -a
FreeBSD amy.flibble.org 10.3-BETA3 FreeBSD 10.3-BETA3 #3 r296346: Thu Mar 3
15:09:55 GMT 2016 root@amy:/usr/obj/usr/src/sys/GENERIC amd64
root@amy:~# grep FreeBSD /etc/rc.subr
# $FreeBSD: stable/10/etc/rc.subr 292450 2015-12-18 19:58:34Z rilles $
root@amy:~# ls -ld /var/db/teamspeak
drwxr-xr-x 3 teamspeak teamspeak 512 Mar 20 00:23 /var/db/teamspeak
root@amy:~# sum /usr/local/etc/rc.d/pwd
33073 1 /usr/local/etc/rc.d/pwd
root@amy:~# service pwd onestart
Starting pwd.
/var/db/teamspeak
-----
On -current we see that were still in /
-----
root@emily:~# uname -a
FreeBSD emily.flibble.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r297022: Fri Mar
18 15:18:44 UTC 2016 [email protected]:/usr/obj/usr/src/sys/GENERIC
amd64
root@emily:~# grep FreeBSD /etc/rc.subr
# $FreeBSD: head/etc/rc.subr 295949 2016-02-24 01:32:12Z araujo $
root@amy:~# ls -ld /var/db/teamspeak
drwxr-xr-x 3 teamspeak teamspeak 512 Mar 20 00:23 /var/db/teamspeak
root@emily:~# sum /usr/local/etc/rc.d/pwd
33073 1 /usr/local/etc/rc.d/pwd
root@emily:~# service pwd onestart
Starting pwd.
/
-----
--
Tim Preston
[email protected]
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[email protected]"