autostart bzflag

All things BZFlag - no [OT] here please
Post Reply
1veedo
Private First Class
Private First Class
Posts: 184
Joined: Sat Feb 05, 2005 1:26 am
Location: usa

autostart bzflag

Post by 1veedo »

Is there any way I can start bzflag, in a consol (not in the background), and contain paramaters as well: like -world and -conf.

Code: Select all

[root@localhost ~]# chkconfig "bzfs -world /home/azevedo/map/dogfight/AerialDogfight.bzw -conf /home/azevedo/bzfs/conf -d -d -d" on
error reading information on service bzfs -world /home/azevedo/map/dogfight/AerialDogfight.bzw -conf /home/azevedo/bzfs/conf -d -d -d: No such file or directory
Of course, that didnt work. :wink:
1veedo (libcurl.so.2) I have version 3!
User avatar
wegstar
Private First Class
Private First Class
Posts: 127
Joined: Sun Dec 26, 2004 4:33 am
Location: Good ol' California
Contact:

Post by wegstar »

you mean bzfs ;)
Try this err...:

Code: Select all

"bzfs" -world /home/azevedo/map/dogfight/AerialDogfight.bzw -conf /home/azevedo/bzfs/conf -d -d -d 
Formerly "nader"
---
Microsoft broke Volkswagen's world record: Volkswagen only made 22 million bugs!
-----
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham
1veedo
Private First Class
Private First Class
Posts: 184
Joined: Sat Feb 05, 2005 1:26 am
Location: usa

Post by 1veedo »

Ok, I did some research but I'm a little weary.

I hear you can add scritps to

Code: Select all

$home/.kde/Autostart/
in this manner:

Code: Select all

#!/bin/bash
/usr/bin/xmms
:lol-old:

I dont know if I want to try

/.../bzfs [commands]

Would that work? I'm also tryign to start a couple other things...like music! I know that works though :wink:

I found a couple other folders designated to autostart, but I think the above id ideal?

PS, nader, putting quotes around something doesn't make it autostart. chkconfig is used to autostart services like web, ftp, mail etc on startup. I was hopping there was another command that would let me run standard scripts instead of actual services. Config files are starting to look more and more familiar to me though. So I'll just stick w/ what I've found so far.

Anybody know anything about autostarting apps? If I add a line after the script will KDE boot properly? I highly dobt a little syntax error on that level in the OS could really kill my computer but "rm -rf" has happeend to me in the past so I'm very skeptical when I dont know what I'm doing.

Of course, I never reboot my computer (it is Linux, right?) but it would still be cool. If somebody can confirm the above would work, I'm going to make XMMS start playing on boot. It would be the coolest rig I've ever put together.
1veedo (libcurl.so.2) I have version 3!
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

crontab

Post by Tim Riker »

I use a crontab entry to do this:

Code: Select all

@reboot $HOME/bin/loopbzfs5153 </dev/null >/dev/null 2>/dev/null&
and then the script looks like this:

Code: Select all

#!/bin/sh -x
ulimit -c 1000000
ulimit -n 40
worldfile=hix.bzw
world=~/bzflag/misc/$worldfile
host=one.BZFlag.org
port=5153
logdir=$HOME/log
serverdir=$HOME/$port
keeplogs=5
prog=$HOME/bzflag/src/bzfs/bzfs
while [ -x $prog ] ; do
  time=`date '+%Y%m%d-%H:%M:%S'`
  log=$logdir/bzfs${port}.$time
  exec < /dev/null >> $log 2>>$log
  set -x
  cd $serverdir
  # -publiclist bzflist://127.0.0.1/ -requireudp
  # -publiclist http://db.bzflag.org/test.php
  msg="($time) $worldfile - registration required - CVS build - Tim@Rikers.org"
  $prog \
	-conf bzfs.conf \
	-d -d -d \
	-i $host \
	-p $port \
	-public "$msg" \
	-publicaddr $host:$port \
	-srvmsg "$msg" \
	-world $world
  echo exit code: $?
  numlogs=`ls $logdir/bzfs${port}* | wc -l`
  dellogs=`expr $numlogs - $keeplogs`
  if [ $dellogs -gt 0 ] ; then
    rm `ls $logdir/bzfs${port}* | head -n $dellogs`
  fi
  sleep 5
done
If your cron daemon supports it, the "@reboot" entries get run at system startup.
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
Post Reply