Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"/etc/init.d/Apache reload" non fa il suo sporco d
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
SpoKKe
n00b
n00b


Joined: 05 Feb 2003
Posts: 43

PostPosted: Fri Apr 16, 2004 3:32 pm    Post subject: "/etc/init.d/Apache reload" non fa il suo sporco d Reply with quote

Salve,

da qualche tempo (più precisamente dall'ultimo aggiornamento di apache) quando lancio il reload di apache tramite init, apache viene semplicemente ucciso senza "risorgere" come dovrebbe fare un bravo demone che si rispetti :)

Al primo reload (che non fa il suo dovere) Viene lasciato il file apache2.pid in /var/run e per restartare apache devo rilandiare nuovamente /etc/init.d/apache2 reload.... se invecie eseguo un restart funziona tutto.

Qualcuno può darmi un aiuto?

Grazie
Spk
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30991
Location: here

PostPosted: Fri Apr 16, 2004 3:41 pm    Post subject: Reply with quote

Non ho capito esattamente il problema.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Fri Apr 16, 2004 4:28 pm    Post subject: Re: "/etc/init.d/Apache reload" non fa il suo spor Reply with quote

SpoKKe wrote:
Al primo reload (che non fa il suo dovere) Viene lasciato il file apache2.pid in /var/run e per restartare apache devo rilandiare nuovamente /etc/init.d/apache2 reload.... se invecie eseguo un restart funziona tutto.


(Se non ho capito male il tuo problema:)

Non ho sottomano il file /etc/init.d/apache2, tuttavia che io sappia l'opzione "reload" per i file di init non esiste.
L'opzione "restart" invece si.

Dal Gentoo Handbook
Quote:

Gli script che il processo rc avvia sono chiamati init script. Ogni script in /etc/init.d può essere eseguito con gli argomenti start, stop, restart, pause, zap, status, ineed, iuse, needsme, usesme o broken.

_________________
Ciao da me!
Back to top
View user's profile Send private message
SpoKKe
n00b
n00b


Joined: 05 Feb 2003
Posts: 43

PostPosted: Fri Apr 16, 2004 4:39 pm    Post subject: Reply with quote

Ci riprovo,

Mettiamo il caso che io abbia apache che funziona regolarmente, faccio una modifica ad un vhost e voglio fare il reload, lancio il comando

"/etc/init.d/apache2 reload"

A questo punto apache invece che fare il reload "muore", non riparte, e rimane il file /var/run/apache2.pid come se il processo fosse attivo, ma non lo è :)

A questo punto se provo ad eseguire

/etc/init.d/apache2 restart

mi da questo errore

* Stopping apache2...
start-stop-daemon: warning: failed to kill 28514: No such process [ ok ]
* Starting apache2... [!!]

e il buoonvecchio apache non riparte fino a quando non cancello il file .pid

se invece rieseguo

"/etc/init.d/apache2 reload"

al posto del restart apache riparte, ma non posso mica fare tutte le volte 2 reload consecutivi per far ripartire apache? :(

MI sono spiegato adesso :?:

Grazie
Spk
Back to top
View user's profile Send private message
nomadsoul
Apprentice
Apprentice


Joined: 14 Mar 2004
Posts: 172

PostPosted: Fri Apr 16, 2004 5:54 pm    Post subject: Reply with quote

infatti.. devi usare restart :D
Back to top
View user's profile Send private message
MyZelF
Bodhisattva
Bodhisattva


Joined: 25 Feb 2003
Posts: 2010
Location: Venice, Italy

PostPosted: Fri Apr 16, 2004 10:14 pm    Post subject: Reply with quote

Hai provato con un

Code:
# killall -HUP apache2


:?:
_________________
"Larry the Cow was a bit frustrated at the current state of Linux Distributions..."
Back to top
View user's profile Send private message
SpoKKe
n00b
n00b


Joined: 05 Feb 2003
Posts: 43

PostPosted: Sat Apr 17, 2004 1:25 am    Post subject: :) Reply with quote

Secondo il file di init.d di apache il reload è possibile

------------------------------------------------------
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/2.0.49/apache2.initd,v 1.4 2004/04/08 19:50:05 stuart Exp $

opts="${opts} reload"

[ "x${SERVERROOT}" != "x" ] && APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
[ "x${CONFIGFILE}" != "x" ] && APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
[ "x${STARTUPERRORLOG}" != "x" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"
# set a default for PIDFILE/RESTARTSTYLE for those that FAILED to follow
# instructiosn and update the conf.d/apache2 file.
# (bug #38787)
[ -z "${PIDFILE}" ] && PIDFILE=/var/run/apache2.pid
[ -z "${RESTARTSTYLE}" ] && RESTARTSTYLE="graceful"

checkconfig() {
local myconf="/etc/apache2/conf/apache2.conf"
if [ "x${CONFIGFILE}" != "x" ]; then
if [ ${CONFIGFILE:0:1} = "/" ]; then
myconf="${CONFIGFILE}"
else
myconf="${SERVERROOT:-/usr/lib/apache2}/${CONFIGFILE}"
fi
fi
if [ ! -r "${myconf}" ]; then
eerror "Unable to read configuration file: ${myconf}"
return 1
fi
if [ -z "${PIDFILE}" ]; then
eerror "\$PIDFILE is not set!"
eerror "Did you etc-update /etc/conf.d/apache2?"
return 1
fi
if [ -z "${RESTARTSTYLE}" ]; then
eerror "\$RESTARTSTYLE is not set!"
eerror "Did you etc-update /etc/conf.d/apache2?"
return 1
fi
/usr/sbin/apache2 -t ${APACHE2_OPTS} 1>/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "Apache2 has detected a syntax error in your configuration files:"
/usr/sbin/apache2 -t ${APACHE2_OPTS}
fi
return $ret
}

depend() {
need net
use mysql dns logger netmount
after sshd
}

start() {
checkconfig || return 1
ebegin "Starting apache2"
[ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
env -i PATH=$PATH /sbin/start-stop-daemon --quiet \
--start --startas /usr/sbin/apache2 \
--pidfile ${PIDFILE} -- -k start ${APACHE2_OPTS}
eend $?
}

stop() {
ebegin "Stopping apache2"
/usr/sbin/apache2ctl stop >/dev/null
start-stop-daemon -o --quiet --stop --pidfile ${PIDFILE}
eend $?
}

reload() {
# restarting apache2 is much easier than apache1. The server handles most of the work for us.
# see http://httpd.apache.org/docs-2.0/stopping.html for more details
ebegin "Restarting apache2"
/usr/sbin/apache2 ${APACHE2_OPTS} -k ${RESTARTSTYLE}
eend $?
}

-------------------------------------------------------------

Come potete vedere l'ultima voce dice appunto "reload" :)

Controllando il sito apache.org si possono notare le "sostanziose" differenze fra un RELOAD e un RESTART, il primo non disconnette le connessioni attive, il secondo si, quindi per modifiche di piccole dimensioni il reload è (a mio avviso) più adatto del restart e meno drastico :wink:

Se utilizzo il "killall -HUP apache2" come consigliato da MyZelF il processo fa lo stesso brutto scherzo del reload da init...muore senza risorgere e lascia il suo bel file apache2.pid sotto /var/run..... e per farlo ripartire devo cancellarlo e rilanciare /etc/init.d/apache2 start :(

Facendo un po di controlli ho notato questo brutto errore nell'error log di apache quando lancio il reload, che sia da init da kill o da apache2ctl

---------------------------------------------------
[Sat Apr 17 03:28:15 2004] [notice] Graceful restart requested, doing restart
[Sat Apr 17 03:28:15 2004] [notice] seg fault or similar nasty error detected in the parent process
---------------------------------------------------

devo forse dedurre che la compilazione o qualche libreria da cui dipende apache faccia le bizze? come posso aumentare il livello di debug? è sufficente aumentarlo nel file di configurazione di apache?

Ciao
SpK
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum