[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PID un chiarimento



On 12/02/2013 09:19, Mario Vittorio Guenzi wrote:

Il 11/02/2013 18:36, dea ha scritto:

.. a questo punto trovo interessante esaminare lo script di start&
stop del tuo demone per capire come funziona :)

Da Wheezy
$ ls -l /var/run
lrwxrwxrwx    /var/run -> /run

da http://www.debian.org/doc/debian-policy/ch-files.html
9.1.4 /run and /run/lock
The directory /run is cleared at boot, normally by being a mount point for a temporary file system. Packages therefore must not assume that any files or directories under /run other than /run/lock exist unless the package has arranged to create those files or directories since the last reboot. Normally, this is done by the package via an init script. See Writing the scripts, Section 9.3.2 for more information.

start-stop-daemon: per gestire i demoni (avvio, terminazione) e il loro pid in /run

$ man start-stop-daemon

ti mando lo script di heartbeat ma il problema si pone anche per
dansguardian samba etc. etc.

non ho installato nessuno di questi, ma ne ho guardati alcuni a caso (es: ssh, gdm3, cups, ...) e tutti usano correttamente start-stop-daemon

ho provato a scaricare il .deb di heartbeat per Wheezy ed in effetti non usa start-stop-daemon, secondo me si potrebbe (dovrebbe) aprire un bug... non ho trovato nulla che dica che bisogna usare start-stop-daemon, ma solo che è la modalità migliore:

http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init

The init.d scripts must ensure that they will behave sensibly (i.e., returning success and not starting multiple copies of a service) if invoked with start when the service is already running, or with stop when it isn't, and that they don't kill unfortunately-named user processes. The best way to achieve this is usually to use start-stop-daemon with the --oknodo option.

### aggiunto da me il 10/02/2013 rimuove il pid per il check della
connessione
     rm -rf /var/run/heartbeat.pid

non penso sia l'operazione corretta

Ciao
Davide

--
Dizionari: http://linguistico.sourceforge.net/wiki
Petizione contro i brevetti software in Europa:
http://petition.stopsoftwarepatents.eu/
Non autorizzo la memorizzazione del mio indirizzo su outlook


Reply to: