Ciao a tutti, Ho installato su ubuntu 12.04, apache emysql i quali funzionano alla perfezione solo dopo aver uffettuo il primo login (quello dopo il boot) , è possibile modificare la configurazione per permettere l'attivazione di questi due servizi prima del login ?

Grazie a tutti Ciao POLDO

 ls /etc/init.d 
acpid              kerneloops                   rfkill-restore 
acpi-support       killprocs                    rfkill-store 
alsa-restore       lightdm                      rsync 
alsa-store         modemmanager                 rsyslog 
anacron            module-init-tools            saned 
apache2            mysql                        sendsigs 
apparmor           networking                   setvtrgb 
apport             network-interface            single 
atd                network-interface-container  skeleton 
avahi-daemon       network-interface-security   speech-dispatcher 
bluetooth          network-manager              stop-bootlogd 
bootlogd           ondemand                     stop-bootlogd-single 
brltty             passwd                       sudo 
cntlm              plymouth                     udev 
console-setup      plymouth-log                 udev-fallback-graphics 
cron               plymouth-ready               udev-finish 
cups               plymouth-splash              udevmonitor 
dbus               plymouth-stop                udevtrigger 
dmesg              plymouth-upstart-bridge      ufw 
dns-clean          pppd-dns                     umountfs 
failsafe-x         procps                       umountnfs.sh 
friendly-recovery  pulseaudio                   umountroot 
grub-common        rc                           unattended-upgrades 
halt               rc.local                     urandom 
hostname           rcS                          whoopsie 
hwclock            README                       x11-common 
hwclock-save       reboot 
irqbalance         resolvconf

user1@VIIL2:~$ ls -l /etc/rc[0-6].d 
/etc/rc0.d: 
totale 4 
lrwxrwxrwx 1 root root  17 mag 12 17:47 K09apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  29 mag  9 16:33 K10unattended-upgrades -> ../init.d/unattended-upgrades 
lrwxrwxrwx 1 root root  15 mag 14 19:12 K20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  27 mag  9 16:33 K20speech-dispatcher -> ../init.d/speech-dispatcher 
-rw-r--r-- 1 root root 353 lug 26  2012 README 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S20sendsigs -> ../init.d/sendsigs 
lrwxrwxrwx 1 root root  17 mag  9 16:33 S30urandom -> ../init.d/urandom 
lrwxrwxrwx 1 root root  22 mag  9 16:33 S31umountnfs.sh -> ../init.d/umountnfs.sh 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S35networking -> ../init.d/networking 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S40umountfs -> ../init.d/umountfs 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S60umountroot -> ../init.d/umountroot 
lrwxrwxrwx 1 root root  14 mag  9 16:33 S90halt -> ../init.d/halt

/etc/rc1.d: 
totale 4 
lrwxrwxrwx 1 root root  17 mag 12 17:47 K09apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  20 mag  9 16:33 K15pulseaudio -> ../init.d/pulseaudio 
lrwxrwxrwx 1 root root  22 mag  9 16:33 K20acpi-support -> ../init.d/acpi-support 
lrwxrwxrwx 1 root root  15 mag 14 19:12 K20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  20 mag  9 16:33 K20kerneloops -> ../init.d/kerneloops 
lrwxrwxrwx 1 root root  15 mag  9 16:33 K20saned -> ../init.d/saned 
lrwxrwxrwx 1 root root  27 mag  9 16:33 K20speech-dispatcher -> ../init.d/speech-dispatcher 
-rw-r--r-- 1 root root 369 lug 26  2012 README 
lrwxrwxrwx 1 root root  19 mag  9 16:33 S30killprocs -> ../init.d/killprocs 
lrwxrwxrwx 1 root root  19 mag  9 16:33 S70dns-clean -> ../init.d/dns-clean 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S70pppd-dns -> ../init.d/pppd-dns 
lrwxrwxrwx 1 root root  16 mag  9 16:33 S90single -> ../init.d/single

/etc/rc2.d: 
totale 4 
-rw-r--r-- 1 root root 677 lug 26  2012 README 
lrwxrwxrwx 1 root root  15 mag 14 19:12 S20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S20kerneloops -> ../init.d/kerneloops 
lrwxrwxrwx 1 root root  27 mag  9 16:33 S20speech-dispatcher -> ../init.d/speech-dispatcher 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S50pulseaudio -> ../init.d/pulseaudio 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50rsync -> ../init.d/rsync 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50saned -> ../init.d/saned 
lrwxrwxrwx 1 root root  19 mag  9 16:33 S70dns-clean -> ../init.d/dns-clean 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S70pppd-dns -> ../init.d/pppd-dns 
lrwxrwxrwx 1 root root  14 mag 12 16:15 S75sudo -> ../init.d/sudo 
lrwxrwxrwx 1 root root  17 mag 12 17:47 S91apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  22 mag  9 16:33 S99acpi-support -> ../init.d/acpi-support 
lrwxrwxrwx 1 root root  21 mag  9 16:33 S99grub-common -> ../init.d/grub-common 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99ondemand -> ../init.d/ondemand 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99rc.local -> ../init.d/rc.local

/etc/rc3.d: 
totale 4 
-rw-r--r-- 1 root root 677 lug 26  2012 README 
lrwxrwxrwx 1 root root  15 mag 14 19:12 S20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S20kerneloops -> ../init.d/kerneloops 
lrwxrwxrwx 1 root root  27 mag  9 16:33 S20speech-dispatcher -> ../init.d/speech-dispatcher 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S50pulseaudio -> ../init.d/pulseaudio 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50rsync -> ../init.d/rsync 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50saned -> ../init.d/saned 
lrwxrwxrwx 1 root root  19 mag  9 16:33 S70dns-clean -> ../init.d/dns-clean 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S70pppd-dns -> ../init.d/pppd-dns 
lrwxrwxrwx 1 root root  14 mag 12 16:15 S75sudo -> ../init.d/sudo 
lrwxrwxrwx 1 root root  17 mag 12 17:47 S91apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  22 mag  9 16:33 S99acpi-support -> ../init.d/acpi-support 
lrwxrwxrwx 1 root root  21 mag  9 16:33 S99grub-common -> ../init.d/grub-common 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99ondemand -> ../init.d/ondemand 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99rc.local -> ../init.d/rc.local

/etc/rc4.d: 
totale 4 
-rw-r--r-- 1 root root 677 lug 26  2012 README 
lrwxrwxrwx 1 root root  15 mag 14 19:12 S20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S20kerneloops -> ../init.d/kerneloops 
lrwxrwxrwx 1 root root  27 mag  9 16:33 S20speech-dispatcher -> ../init.d/speech-dispatcher 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S50pulseaudio -> ../init.d/pulseaudio 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50rsync -> ../init.d/rsync 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50saned -> ../init.d/saned 
lrwxrwxrwx 1 root root  19 mag  9 16:33 S70dns-clean -> ../init.d/dns-clean 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S70pppd-dns -> ../init.d/pppd-dns 
lrwxrwxrwx 1 root root  14 mag 12 16:15 S75sudo -> ../init.d/sudo 
lrwxrwxrwx 1 root root  17 mag 12 17:47 S91apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  22 mag  9 16:33 S99acpi-support -> ../init.d/acpi-support 
lrwxrwxrwx 1 root root  21 mag  9 16:33 S99grub-common -> ../init.d/grub-common 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99ondemand -> ../init.d/ondemand 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99rc.local -> ../init.d/rc.local

/etc/rc5.d: 
totale 4 
-rw-r--r-- 1 root root 677 lug 26  2012 README 
lrwxrwxrwx 1 root root  15 mag 14 19:12 S20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S20kerneloops -> ../init.d/kerneloops 
lrwxrwxrwx 1 root root  27 mag  9 16:33 S20speech-dispatcher -> ../init.d/speech-dispatcher 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S50pulseaudio -> ../init.d/pulseaudio 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50rsync -> ../init.d/rsync 
lrwxrwxrwx 1 root root  15 mag  9 16:33 S50saned -> ../init.d/saned 
lrwxrwxrwx 1 root root  19 mag  9 16:33 S70dns-clean -> ../init.d/dns-clean 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S70pppd-dns -> ../init.d/pppd-dns 
lrwxrwxrwx 1 root root  14 mag 12 16:15 S75sudo -> ../init.d/sudo 
lrwxrwxrwx 1 root root  17 mag 12 17:47 S91apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  22 mag  9 16:33 S99acpi-support -> ../init.d/acpi-support 
lrwxrwxrwx 1 root root  21 mag  9 16:33 S99grub-common -> ../init.d/grub-common 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99ondemand -> ../init.d/ondemand 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S99rc.local -> ../init.d/rc.local

/etc/rc6.d: 
totale 4 
lrwxrwxrwx 1 root root  17 mag 12 17:47 K09apache2 -> ../init.d/apache2 
lrwxrwxrwx 1 root root  29 mag  9 16:33 K10unattended-upgrades -> ../init.d/unattended-upgrades 
lrwxrwxrwx 1 root root  15 mag 14 19:12 K20cntlm -> ../init.d/cntlm 
lrwxrwxrwx 1 root root  27 mag  9 16:33 K20speech-dispatcher -> ../init.d/speech-dispatcher 
-rw-r--r-- 1 root root 351 lug 26  2012 README 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S20sendsigs -> ../init.d/sendsigs 
lrwxrwxrwx 1 root root  17 mag  9 16:33 S30urandom -> ../init.d/urandom 
lrwxrwxrwx 1 root root  22 mag  9 16:33 S31umountnfs.sh -> ../init.d/umountnfs.sh 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S35networking -> ../init.d/networking 
lrwxrwxrwx 1 root root  18 mag  9 16:33 S40umountfs -> ../init.d/umountfs 
lrwxrwxrwx 1 root root  20 mag  9 16:33 S60umountroot -> ../init.d/umountroot 
lrwxrwxrwx 1 root root  16 mag  9 16:33 S90reboot -> ../init.d/reboot 
user1@VIIL2:~$

user1@VIIL2:~$ cat /etc/rc.local 
#!/bin/sh -e 
# 
# rc.local 
# 
# This script is executed at the end of each multiuser runlevel. 
# Make sure that the script will "exit 0" on success or any other 
# value on error. 
# 
# In order to enable or disable this script just change the execution 
# bits. 
# 
# By default this script does nothing.

exit 0 
user1@VIIL2:~$

chiesto 12 Jun '14, 19:29

paolo's gravatar image

paolo
57131622

modificato 23 Jun '14, 19:01

enzotib's gravatar image

enzotib ♦♦
14.1k113187

1

@paolo: apache lo hai installato da repo?

(12 Jun '14, 23:06) enzotib ♦♦ enzotib's gravatar image

Si, tramite la gestione pacchetti

(13 Jun '14, 22:07) paolo paolo's gravatar image
1

@paolo: se hai installato da repo, allora è già tutto predisposto per la partenza automatica di apache ad ogni boot della macchina. Se questo non avviene allora c'è qualche problema che al momento non immagino.

(14 Jun '14, 07:35) enzotib ♦♦ enzotib's gravatar image
1

Allora, controlliamo se c'è tutto quello che serve, prova a riportare l'output del comando ls /etc/init.d e vediamo se c'è già lo script di lancio, modifica la domanda aggiungendo le informazioni.

(15 Jun '14, 18:11) letizia letizia's gravatar image

Aggiunti !!!

(16 Jun '14, 19:43) paolo paolo's gravatar image
1

In effetti gli script ci sono: apache2 e mysql. Allora vediamo: nel direttorio /etc ci sono dei direttori che si chiamano: rc0.d, rc1.d, rc2.d .... rc6.d in questi direttori sono presenti dei file che si chiamano: K<num>Nome o S<num>Nome. Dobbiamo vedere se ci sono quelli relativi ad apache e mysql, quindi esegui il comando: ls -l /ect/rc[0-6].d | grep apache2 e lo stesso per mysql e riporta il risultato. Se non li trovi, riporta l'output del comando ls -l /etc/rc[0-6].d

(16 Jun '14, 22:42) letizia letizia's gravatar image
1

Da quello che vedo, apache dovrebbe essere mandato in esecuzione già così, mentre mysql no. Potresti riportare anche l'output del comando cat /etc/rc.local? ed anche l'output del comando ls ~/.config/autostart

(21 Jun '14, 17:51) letizia letizia's gravatar image
1

okey, manca solo l'output del comando:

         ls ~/.config/autostart

altrimenti non capisco dove viene attivato mysql :)

(23 Jun '14, 23:27) letizia letizia's gravatar image

Ciao Letizia, sulla mia configurazione la directory autostart non è pesente !!!!

(25 Jun '14, 21:18) paolo paolo's gravatar image
1

mmmh! Prova a vedere se esiste una directory autostart con il comando:

   find / -name autostart

Se dici che mysql funziona dopo il login, dovrebbe esistere un direttorio con quel nome. Intanto verifichiamo con il comando:

   who -r

quale runlevel è in uso, così sapremo quale rcX.d viene utilizzato. Inoltre potresti verificare se dopo il boot e prima del login, apache ti risponde, magari utilizzando un url che risponda senza interrogare/utilizzare mysql

(26 Jun '14, 14:00) letizia letizia's gravatar image

Eccolo :

user1@VIIL2:~$ who -r

     run-level 2  2014-06-25 13:43

user1@VIIL2:~$

Non ho avuto la possibilità di riavviare il PC per verificare se apache rispoda, la verificherò domani o luned' ciao

(27 Jun '14, 17:57) paolo paolo's gravatar image
1

...e riguardo al comando "find / -name autostart", cosa mi dici?

(27 Jun '14, 18:02) letizia letizia's gravatar image

Letizia, scusami tanto per il ritardo nelle mie risposte .

Comunque:

1) prima del login , apache non risponde 2) sotto , ho postato il find di autostart

user1@VI:~$ sudo find / -name autostart /usr/share/gdm/autostart /usr/share/gnome/autostart /etc/xdg/autostart user1@VI:~$

ciao poldo

(04 Jul '14, 22:03) paolo paolo's gravatar image
1

okey, non ti preoccupare, aggiungi su http://paste.ubuntu.com/ l'output di:

    ls  /usr/share/gdm/autostart
    ls /usr/share/gnome/autostart
    ls  /etc/xdg/autostart 
    ls /etc/init
(06 Jul '14, 22:13) letizia letizia's gravatar image

Fatto ciao

(07 Jul '14, 17:15) paolo paolo's gravatar image
1

@paolo, dov'è il link?

(07 Jul '14, 17:16) letizia letizia's gravatar image

Sing !!!! quale link !!!!!!

(07 Jul '14, 17:23) paolo paolo's gravatar image
1

l'output dei comandi che ti ho chiesto di mettere su paste.ubuntu.com, se li hai messi li, dovresti copiare il link dal browser e copiarlo qui, altrimenti non so come poterli vedere :)

(07 Jul '14, 17:25) letizia letizia's gravatar image
(07 Jul '14, 17:28) paolo paolo's gravatar image
1

Scusa le tante domande, ma serve anche l'output del comando:

    cat /etc/init/mysql.conf

Con questa credo ci siamo...

(07 Jul '14, 17:31) letizia letizia's gravatar image

Figurati , te lo invio appena posso ,(credo domani) ciao paolo

(07 Jul '14, 17:39) paolo paolo's gravatar image
(08 Jul '14, 17:57) paolo paolo's gravatar image
1

In effetti, @enzotib ha ragione, non trovo motivi per cui non dovrebbe già essere così. A questo punto dovresti mettere in pastebin anche il log di sistema /var/log/syslog dove dovrebbero esserci le stampe dell'attivazione dei servizi. Così provo a vedere com'è la sequenza. Se non dovesse bastare, si dovrà modificare il log per alzare il livello a debug.

(10 Jul '14, 13:22) letizia letizia's gravatar image

Ecco il link http://paste.ubuntu.com/7776693/ grazie poldo

(10 Jul '14, 21:10) paolo paolo's gravatar image

Ciao Letizia, Ci aggiorniamo fra 15 giorni , parto pel le vacanze. ciao

(11 Jul '14, 21:56) paolo paolo's gravatar image
1

Okey, da quello che ho visto nel log, mi chiedo se per caso non ci siano problemi sulle interfacce l'unico motivo plausibile potrebbe essere che non viene generato l'evento static-network-up, infatti nel log si vede l'evento

    Jul 10 19:39:19 VIIL2 failsafe: Failsafe of 120 seconds reached.

che scatta dopo 2 minuti. Gli script in /etc/rc2.d (quindi anche apache2) sono eseguiti al verificarsi dei due eventi: static-network-up and filesystem oppure dopo due minuti quando si verifica l'evento failsafe.

(11 Jul '14, 23:50) letizia letizia's gravatar image
1

Mi chiedo se semplicemente aspettando 5 min tutto funziona.... Dai, ora ti auguro buone vacanze e quando torni vediamo se riusciamo a risolvere :)

(11 Jul '14, 23:51) letizia letizia's gravatar image
1

Dovremo anche controllare il file /etc/network/interface che è quello che il NetworkManager utilizza per determinare se tutte le interfacce sono OK e generare l'evento static-network-up

(13 Jul '14, 00:18) letizia letizia's gravatar image

Cio Letizia, Ho atteso circa 5 minuti dopo il boot , ma la pagina web non è visibile se non dopo il primo accesso .

Nel file /etc/network/interface sono contenuti i seguenti comandi:

auto lo iface lo inet loopback

ciao poldo :)

(04 Aug '14, 21:02) paolo paolo's gravatar image
1

Ciao Paolo, sono rientrata dalle vacanze :)

Caspita! credevo di aver trovato la soluzione! Beh, ora mi rimetto a vedere se mi viene in mente qualche altra prova da fare.

(01 Sep '14, 23:23) letizia letizia's gravatar image
1

Quando puoi, si potrebbe provare ad effettuare un reboot alzando il livello di stampe a debug con il comando:

  sudo initctl log-priority debug

una volta collegato, per ripristinare la situazione:

 sudo initctl log-priority message

Quindi vediamo se ci sono informazioni più utili in /var/log/syslog e /var/log/kern.log

(01 Sep '14, 23:53) letizia letizia's gravatar image
1

Rileggendo e ripercorrendo tutto quello che abbiamo scritto, mi sono venute alcune domande.

Potresti, per favore, descrivere lo scenario di rete?

Apache è in ascolto su quale interfaccia?

Hai un modem configurato per fare "port forward" e nat dell'indirizzo interno su quello pubblico?

E' così che provi a vedere se apache è "vivo"?

Tentando un accesso da IP pubblico o hai un altro server su una LAN interna?

Grazie e scusa per la "tempesta" di domande.

(01 Sep '14, 23:59) letizia letizia's gravatar image

Letizia, La rete attualmente utilizzata è molto semplice , Tre PC condividono la stressa rete lan tramite un router. Chiamiamo i tre PC: A ,B ,C ,

Su A è installato ubuntu /apache ecc.ecc.

Ho capito che apache non è in esecuzione sul PC A semplicemente sfruttando il browserer di uno degli altri due PC (B o C) il quale non accede alla pagina web (di A) se non dopo aver effettuato la fase di login su A.

Ho deciso di aggiornare (a breve) la versione alla 14.04 e ti farò sapere se il problema persiste.

Grazie 1000 ciao

(03 Sep '14, 21:33) paolo paolo's gravatar image

Peccato, mi rimarrà la curiosità! Alla prossima, ciao.

(04 Sep '14, 00:27) letizia letizia's gravatar image

Per ottenere l'attivazione di un servizio, è necessario "agganciare" uno script di lancio ai run level di ubuntu.

In /etc/init.d è necessario predisporre uno script che preveda come parametri start|stop, questo può essere un link allo script del servizio che vuoi attivare, nel caso di apache "/pathDoveInstallatoApache/apachectl".

A questo punto tramite il domando:

     sudo update-rc.d apachectl default

il sistema richiama lo script /etc/init.d/apachectl start|stop nella fase di init/shotdown del pc.

Analogamente puoi seguire questo approccio anche per mysql.

Il manuale del comando: update-rc.d

coll. permanente

ha risposto 12 Jun '14, 21:53

letizia's gravatar image

letizia
7231519

Grazie 1000 Letizia , Appena posso ,provo a seguire il tuo consiglio. Grazie

(13 Jun '14, 22:04) paolo paolo's gravatar image
La tua risposta
abilita/disabilita anteprima

Segui questa domanda

Via email:

Una volta eseguito l'accesso potrai iscriverti a tutti gli aggiornamenti qui

Via RSS:

Risposte

Risposte e commenti

Basi di markdown

  • *corsivo* o __corsivo__
  • **grassetto** o __grassetto__
  • collegamento:[testo](http://url.com/ "titolo")
  • immagine?![alt testo](/path/img.jpg "titolo")
  • elenco numerato: 1. Foo 2. Bar
  • per aggiungere un'interruzione di riga, aggiungi due spazi a fine riga e premi «Invio»
  • è supportato anche semplice HTML

Tag:

×229
×21

domanda posta: 12 Jun '14, 19:29

domanda visualizzata: 2,810 volte

ultimo aggiornamento: 04 Sep '14, 00:27

Chiedi è un servizio di supporto gestito da Ubuntu-it. Contattaci!

powered by OSQAPostgreSQL database
Ubuntu e Canonical sono marchi registrati da Canonical Ltd.