Entra

View Full Version : ESECUZIONE AUTOMATICA


valethedoctor
28-02-2008, 16:55
Ciao a tutti mi presento sono Riccardo e mi sto cimentando con suse.

Ho installato suse e piano piano sto cercando di capire come funziona, adesso sono riuscito a creare un server per giocare in rete con call of duty ma ho un piccolo problema ......avrei bisogno che si avviasse in automatico questo server quando accendo il computer

la riga di comando è la seguente

/home/callofduty/cod4/./cod4_lnxded +map mp_crash

Mi potreste dire come posso fare ??

Ciao e grazie Ricky

Gimli[2BV!2B]
28-02-2008, 21:48
Avevo voglia di vedere come sono fatti gli script di avvio in Suse:
#! /bin/sh

# Check for missing binaries
BIN=/home/callofduty/cod4/cod4_lnxded
test -x $BIN || { echo "$BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }

case "$1" in
start)
echo -n "Starting Call of Duty 4 Server "
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
startproc $BIN +map mp_crash

# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Call of Duty 4 Server "
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.

killproc -TERM $BIN

# Remember status and be verbose
rc_status -v
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start

# Remember status and be quiet
rc_status
;;
*)
## If no parameters are given, print which are avaiable.
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac

Ora:

Crea un file di testo, chiamalo per esempio cod4server.
Copiaci dentro il codice.
Rendilo eseguibile (chmod +x cod4server, oppure cerca nel dialogo di proprietà del file).
Copialo nella cartella /etc/init.d (necessari permessi amministrativi).
Provalo: da amministratore /etc/init.d/cod4server start oppure rccod4server start.
Se funziona puoi renderlo attivo all'avvio con innserv /etc/init.d/cod4server.
Se non lo vuoi più puoi disattivarlo con innserv -r /etc/init.d/cod4server.


Però ci sono un paio di incognite...

Il tuo comando ha uno "strano" aspetto.
Mi sono basato solo su informazioni in rete e non posso testare quel che ho scritto (non ho Suse).