Running BFSMD chrooted (debian oriented)

michielb at michielb at
Wed Feb 4 15:33:30 EST 2004

my setup:
bfsmd + battlefield server running chrooted under user battlefield
in /opt/battlefield/

unpacked bf .run in /<somedir>/battlefield/server/
so bf1942_lnxded.dynamic resides in that dir. Set up bfsmd like u
usualy would in /<somedir>/battlefield/server/

chown battlefield:battlefield /<somedir>/battlefield/server/

/lib/ files:
mkdir /<somedir>/battlefield/lib/
copy the following libs from /lib into that dir

/etc/ files:
mkdir /<somedir>/battlefield/etc/
copy /etc/group into that dir
remove all lines except the battlefield user.

/proc/ files:
mkdir /<somedir>/battlefield/proc/
mount --bind /proc /<somedir>/battlefield/proc/
( might be able to mount it readonly not tryed,
can adding -o ro I thought)

make a softlink from bf1942_lnxded.* to the one you want ( I had to do

I hope I didn't forget anything

I added the /etc/init.d/battlefield file under here.

contact me if you have problems,
michielb at / apex at

<-- PAST /etc/init.d/battlefield -->
# battlefield server setup


case "$1" in
                echo -n "Starting Battlefield Control server: "
                start-stop-daemon --start --pidfile $PID \
                                  --chuid battlefield \
                                  --chroot /opt/battlefield/ \
                        --exec /opt/battlefield/server/bfsmd \
                        --startas /server/bfsmd -- -path /server/ -daemon -restart
                sleep 2
                echo -n "Stopping Battlefield Control server: Battlefield"
                start-stop-daemon --stop --quiet --exec /opt/battlefield/server/bfsmd
                start-stop-daemon --stop --quiet --user battlefield
                echo "."
        restart | force-reload)
                $0 stop
                sleep 2
                $0 start
                if [ "$?" != "0" ]; then
                        exit 1
                echo "Usage: /etc/init.d/battlefield {start|stop|restart|force-reload}"
                exit 1

exit 0

<-- END PAST -->

More information about the Bf1942 mailing list