View previous topic :: View next topic |
Author |
Message |
ReDirEct__ Guru
Joined: 16 Mar 2006 Posts: 300 Location: Nola (NA) - Italy
|
Posted: Tue Aug 15, 2006 2:34 pm Post subject: Problemi con gli init scripts |
|
|
Salve a tutti... di ritorno dalle vacanze ho deciso di aggiornare il sistema. Ma dopo l'aggiornamento (ho aggiornato anche il kernel), ho dei problemi al boot:
1) Ho un router/firewall/modem che ho sulla eth1. Prima dell'aggiornamento, al boot, l'unico messaggio riguardante il collegamento della rete era proprio quello dell'interfaccia eth1 che otteneve l'ip tramite dhcpcd. Nella dir init.d d avevo però sia net.lo che net.eth0. Ora non so perchè, al boot mi da messaggi anche riguardo l'interfaccia net.lo e net.eth0 ma nessun messaggio riguardante la eth1. La cosa pallosa è che tenta di ricevere un indirizzo per la eth0 che tra l'altro non è installato in nessuno dei runlevel (boot, default) e di consegueguenza il pc ci impiega tempo ad avviarsi a meno che non dia ctrl+c. Che è successo? Mi sono perso qualcosa?
2)Ho uno script init che mi fa partire boinc ad ogni avvio. Solo che ora non funziona più. O meglio, lo script non da nessun mess di errore ma il servizio non parte comunque, neanche avviandolo in un secondo mmomento. Prima dell'aggiornamento non avevo problemi. Questo è lo script:
Code: | #!/sbin/runscript
#
# Gentoo Linux start/stop script to run the BOINC client as a daemon
# at system startup, as the boinc user (not root).
#
# chkconfig: 345 71 29
# description: start boinc client at boot time
# processname: boinc
# config: /etc/sysconfig/boinc
#
# Gabor Nagy <nagyga1 at netscape.net> - 18 January 2005
#
# Based on the original Redhat Linux start/stop scrip by:
# Eric Myers <myers at vassar.edu> - 27 July 2004
# Department of Physics and Astronomy, Vassar College, Poughkeepsie NY
# @(#) $Revision: 1.5 $ -- $Date: 2004/07/27 14:43:24 $
#PATH=/sbin:/bin:/usr/sbin:/usr/bin
#export PATH
# Source function library.
#. /etc/rc.d/init.d/functions
# Defaults, which can be overridden by /etc/sysconfig/boinc
BOINCUSER=redirect
BOINCDIR=/home/redirect/boinc
#BUILD_ARCH=i686-pc-linux-gnu
LOGFILE=boinc.log
ERRORLOG=error.log
#BOINCOPTS="-allow_remote_gui_rpc"
if [ -f /etc/sysconfig/boinc ]; then
. /etc/sysconfig/boinc
fi
## Locate the working directory
if [ ! -d $BOINCDIR ]; then
echo "Cannot find boinc directory $BOINCDIR "
exit 1
fi
## Locate the executable with highest version
#BOINCEXE=`/bin/ls -1 $BOINCDIR/boinc_*_$BUILD_ARCH 2>/dev/null | tail -n 1 `
BOINCEXE=$BOINCDIR/boinc_client
if [ ! -x "$BOINCEXE" ]; then
echo "Cannot find/run boinc executable $BOINCEXE "
exit 2
fi
## Functions: start/stop/status/restart
checkconfig() {
cd $BOINCDIR
if [ ! -f client_state.xml ] ; then
eerror "BOINC client requires initialization first."
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting BOINC client as a daemon: "
start-stop-daemon --start --quiet --chuid $BOINCUSER --exec $BOINCEXE -- $BOINCOPTS >>$BOINCDIR/$LOGFILE 2>>$BOINCDIR/$ERRORLOG & |
Spero sappiate aiutarmi... non so davvero cosa sia successo... |
|
Back to top |
|
|
ReDirEct__ Guru
Joined: 16 Mar 2006 Posts: 300 Location: Nola (NA) - Italy
|
Posted: Tue Aug 15, 2006 3:04 pm Post subject: |
|
|
Per quanto riguarda il secondo punto ho provato questo script:
Code: | #!/bin/sh
#
# BOINC - start and stop the BOINC client daemon on Unix
#
# Unix start/stop script to run the BOINC client as a daemon at
# system startup, as the 'boinc' user (not root!).
#
# This version works on Red Hat Linux, Fedora Core, Mandrake,
# and Slackware Linux, and should work on generic Linux systems
# provided they have 'pidof'. Metadata for chkconfig and the SUSE
# equivalent INIT info are included below.
#
# Usage: boinc { start | stop | status | restart }
#
###
# chkconfig: 345 71 29
# description: This script starts the local BOINC client as a daemon
# For more information about BOINC (the Berkeley Open Infrastructure
# for Network Computing) see http://boinc.ssl.berkeley.edu
# processname: boinc
# config: /etc/sysconfig/boinc
#
### BEGIN INIT INFO
# Provides: boinc
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Description: This script starts the local BOINC client as a daemon
# For more information about BOINC (the Berkeley Open Infrastructure
# for Network Computing) see http://boinc.ssl.berkeley.edu
### END INIT INFO
#
# Eric Myers <myers@vassar.edu> - 27 July 2004
# Department of Physics and Astronomy, Vassar College, Poughkeepsie NY
# @(#) $Id: boinc,v 3.0 2005/07/18 22:16:24 myers Exp $
########################################################################
# Defaults, which can be overridden in /etc/sysconfig/boinc
BOINCUSER=redirect
BOINCDIR=/home/redirect/boinc
#BUILD_ARCH=i686-pc-linux-gnu
BOINCEXE=/home/redirect/boinc_client
# Log and error files (you should rotate these occasionally)
LOGFILE=boinc.log
ERRORLOG=error.log
# Mandrake 10.1 really wants a lock file...
LOCKDIR=/var/lock/subsys
# BOINC options:
#BOINCOPTS="-allow_remote_gui_rpc" # opens up your machine to the world!
# Init script function library. This stuff is Red Hat specific,
# but if the functions are not found we create our own simple replacements.
# (The idea for replacing the functions comes from OpenAFS. Thanks guys!)
if [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
function echo_success () { echo -n " [ OK ] " ; }
function echo_failure () { echo -n " [FAILED] " ; }
function echo_warning () { echo -n " [WARNING] " ; }
function killproc() {
PID=`pidof -s -x -o $$ -o $PPID -o %PPID $1`
[ $PID ] && kill $PID ; }
fi
# su on Linux seems to need this to be set to work properly
export TERM dumb
# Look for any local configuration settings:
if [ -f /etc/sysconfig/boinc ]; then
. /etc/sysconfig/boinc
fi
## Locate the working directory
if [ ! -d $BOINCDIR ]; then
echo "Cannot find BOINC directory $BOINCDIR "
exit 7
fi
# Some additional places to look for the client executable
# (Do this after init.d/functions, which sets PATH)
export PATH=$BOINCDIR:/usr/local/bin:$PATH
## Locate the executable, either boinc_client, boinc,
## or boinc_M.mm_.... with highest version number
if [ ! -x $BOINCEXE ]; then
BOINCEXE=`/usr/bin/which boinc_client 2>/dev/null`
if [ ! -x "$BOINCEXE" ]; then
BOINCEXE=`/usr/bin/which boinc 2>/dev/null`
if [ ! -x "$BOINCEXE" ]; then
BOINCEXE=`/bin/ls -1 $BOINCDIR/boinc_*_$BUILD_ARCH 2>/dev/null | tail -1 `
fi
fi
fi
if [ ! -x "$BOINCEXE" ]; then
echo "Cannot find an executable for the BOINC client."
exit 2
fi
## Functions: $1 is one of start|stop|status|restart
case "$1" in
start)
cd $BOINCDIR
if [ -f lockfile ] ; then
echo -n "Another instance of BOINC is running (lockfile exists)."
echo_failure
echo
exit 4
fi
if [ ! -f client_state.xml ] ; then
echo -n "The BOINC client requires initialization."
echo_warning
echo
fi
echo -n "Starting BOINC client as a daemon: "
su $BOINCUSER -c "$BOINCEXE $BOINCOPTS" >>$LOGFILE 2>>$ERRORLOG &
sleep 1
PID=`pidof -s -x -o $$ -o $PPID -o %PPID $BOINCEXE`
if [ $PID ]; then
touch $LOCKDIR/boinc
echo_success
else
echo_failure
fi
echo
;;
stop)
cd $BOINCDIR
if [ ! -f lockfile -a ! -f $LOCKDIR/boinc ] ; then
echo -n "BOINC is not running (no lockfile found)."
echo_success
else
echo -n "Stopping BOINC client daemon: "
killproc $BOINCEXE && echo_success || echo_failure
# clean up in any case
rm -f $BOINCDIR/lockfile
rm -f $LOCKDIR/boinc
fi
echo
;;
restart)
$0 stop
$0 start
;;
status)
PID=`pidof -x -o $$ -o $PPID -o %PPID boinc_client`
if [ "$PID" == "" ]; then
PID=`pidof -x -o $$ -o $PPID -o %PPID $BOINCEXE`
fi
if [ "$PID" != "" ]; then
echo "BOINC client is running (pid $PID)."
else
if [ -f $BOINCDIR/lockfile -o -f $LOCKDIR/boinc ]; then
echo "BOINC is stopped but lockfile exists."
else
echo "BOINC client is stopped."
fi
fi
;;
*)
echo "Usage: boinc {start|stop|restart|status}"
exit 1
esac
exit
#EOF# |
... e pare che funzioni... ma vorrei capire lo stesso perchè quello del post precedente non avvia l'eseguibile... questo invece si... |
|
Back to top |
|
|
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Tue Aug 15, 2006 6:04 pm Post subject: Re: Problemi con gli init scripts |
|
|
ReDirEct__ wrote: | 1) Ho un router/firewall/modem che ho sulla eth1. Prima dell'aggiornamento, al boot, l'unico messaggio riguardante il collegamento della rete era proprio quello dell'interfaccia eth1 che otteneve l'ip tramite dhcpcd. Nella dir init.d d avevo però sia net.lo che net.eth0. Ora non so perchè, al boot mi da messaggi anche riguardo l'interfaccia net.lo e net.eth0 ma nessun messaggio riguardante la eth1. La cosa pallosa è che tenta di ricevere un indirizzo per la eth0 che tra l'altro non è installato in nessuno dei runlevel (boot, default) e di consegueguenza il pc ci impiega tempo ad avviarsi a meno che non dia ctrl+c. Che è successo? Mi sono perso qualcosa? |
Potresti postare /etc/conf.d/net e l'output di
Magari eth0 è dipendenza da qualche altro script di avvio. Prova a guardare se la variabile RC_NET_STRICT_CHECKING in /etc/conf.d/rc fa al caso tuo.
Inoltre in /etc/init.d/ ci sono tutti gli script di avvio, anche quelli non eseguiti. Quelli che vengono eseguiti si trovano in /etc/runlevels (e sono simlink a quelli in /etc/init.d). |
|
Back to top |
|
|
MaTz Apprentice
Joined: 28 Aug 2005 Posts: 166 Location: Genova (IT)
|
Posted: Tue Aug 15, 2006 7:44 pm Post subject: |
|
|
ho lo stesso problema net.eth0 e ne.eth1 vengono startati di default, senza che siano in alcun runlevel o siano dipendenza di un altro servizio
Quote: |
acpid | battery default
alsasound | battery default
apache2 |
atieventsd |
atieventsd.rc6 |
aumix |
bootmisc | boot
checkfs | boot
checkroot | boot
clock | boot
coldplug | boot
consolefont | boot
cpufreqd | battery default
cpufrequtils |
crypto-loop |
cupsd |
esound |
fancontrol |
gpm |
hdparm |
hostname | boot
hotplug | battery default
keymaps | boot
kismet |
lm_sensors |
local | battery default nonetwork
localmount | boot
modules | boot
mpd |
mysql |
net.eth0 |
net.eth1 |
net.lo | boot
netmount |
nscd |
ntop |
numlock |
rmnologin | boot
rsyncd |
sshd |
syndaemon |
syslog-ng | battery default
urandom | boot
vixie-cron | battery default
wpa_supplicant |
xdm |
xfs |
|
Quote: |
RC_NET_STRICT_CHECKING="no"
|
Impostando la variabile a none, il problema permane. |
|
Back to top |
|
|
^Stefano^ Guru
Joined: 20 Nov 2005 Posts: 394 Location: Ferrara
|
Posted: Tue Aug 15, 2006 11:21 pm Post subject: |
|
|
prova sempre in /etc/conf.d/rc ad impostare questa variabile
Code: | RC_PLUG_SERVICES="" |
così
Code: | RC_PLUG_SERVICES="!net.*" |
_________________ 8-09 V-Day con una raccolta firme. Vi aspettiamo
Raccolta Firme
Progetto tRicicloPC con Linux |
|
Back to top |
|
|
ReDirEct__ Guru
Joined: 16 Mar 2006 Posts: 300 Location: Nola (NA) - Italy
|
Posted: Thu Aug 17, 2006 10:27 am Post subject: |
|
|
Per net ho semi-risolto impostando :
Code: | RC_PLUG_SERVICES="net.eth1 !net.*" |
Semi-risolto perchè cmq mi appaiano messaggi riguardanti net.lo che prima dell'aggiornamento non apparivano e non si vedono messaggi riguardanti net.eth1... come faccio a nascondere/togliere i messaggi riguardanti net.lo e ripristinare quelli riguardanti eth1? Come mai si è stravolto tutto?
Per la questione dello script che potete dirmi? Non riesco davvero a capire come mai quello del primo post non funziona mentre il secondo si. Prima dell'aggiornamento filava tutto liscio... ora che è successo? |
|
Back to top |
|
|
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Thu Aug 17, 2006 11:03 am Post subject: |
|
|
ReDirEct__ wrote: | Semi-risolto perchè cmq mi appaiano messaggi riguardanti net.lo che prima dell'aggiornamento non apparivano e non si vedono messaggi riguardanti net.eth1... come faccio a nascondere/togliere i messaggi riguardanti net.lo e ripristinare quelli riguardanti eth1? Come mai si è stravolto tutto? |
Non so quanto possa essere saggio disabilitare net.lo.
Hai aggiunto net.eth1 al runlevel corrente (default)? |
|
Back to top |
|
|
ReDirEct__ Guru
Joined: 16 Mar 2006 Posts: 300 Location: Nola (NA) - Italy
|
Posted: Thu Aug 17, 2006 11:40 pm Post subject: |
|
|
bender86 wrote: | ReDirEct__ wrote: | Semi-risolto perchè cmq mi appaiano messaggi riguardanti net.lo che prima dell'aggiornamento non apparivano e non si vedono messaggi riguardanti net.eth1... come faccio a nascondere/togliere i messaggi riguardanti net.lo e ripristinare quelli riguardanti eth1? Come mai si è stravolto tutto? |
Non so quanto possa essere saggio disabilitare net.lo.
Hai aggiunto net.eth1 al runlevel corrente (default)? | ù
Yesss.... ma cmq non intendo disabilitarlo... solo far scomparire i messaggi al boot... o almeno capire come mai prima non c'erano e adesso si... cmq la eth1 funziona correttamente... l'unica cosa è che non mi visualizza il solito messaggio di "bringing up" tra i messaggi all'avvio... |
|
Back to top |
|
|
^Stefano^ Guru
Joined: 20 Nov 2005 Posts: 394 Location: Ferrara
|
Posted: Fri Aug 18, 2006 2:59 pm Post subject: |
|
|
i messaggi sono portati da baselayout. prova a leggere l'ebuild o se riesci cerca di capire i file che modifica/installa e leggili.
forse già lo script stesso può darti informazioni utili.
Oppure un metodo più brigoso ma efficace è quello di installare il baselayout vecchio (conta che ci sono stati 3 4 aggiornamenti a fila in sti giorni), quando ti verrà chiesto di dare etc-update fai
e poi
Code: | cp /etc/init.d/net.lo /home/$user/net |
successivamente reinstalli il nuovo baselayout e rifai la procedura di etc-update.
Ora puoi fare il cambio di net.lo _________________ 8-09 V-Day con una raccolta firme. Vi aspettiamo
Raccolta Firme
Progetto tRicicloPC con Linux |
|
Back to top |
|
|
ReDirEct__ Guru
Joined: 16 Mar 2006 Posts: 300 Location: Nola (NA) - Italy
|
Posted: Fri Aug 18, 2006 8:23 pm Post subject: |
|
|
mmm... ok proverò in questo modo... per quanto riguarda l'init script di boinc che mi puoi dire??? Non riesco a capire perchè quello del primo post non va mentre quello del secondo si... |
|
Back to top |
|
|
^Stefano^ Guru
Joined: 20 Nov 2005 Posts: 394 Location: Ferrara
|
|
Back to top |
|
|
|