[NON PIU' NECESSARIO]Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
[NON PIU' NECESSARIO]Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Buongiorno e buona domenica! Per via di questo problema http://forum.ubuntu-it.org/viewtopic.php?t=460622 mi chiedevo se è possibile trovare lo script di spegnimento/riavvio del S.O. per poter modificare l'ordine di chiusura di network-manager e metterla per ultima cosa......
Si può fare?
Si può fare?
Ultima modifica di Nede il domenica 16 ottobre 2011, 21:47, modificato 1 volta in totale.
- cristian_c
- Accecante Asceta

- Messaggi: 23422
- Iscrizione: lunedì 29 ottobre 2007, 11:31
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Non so se questo può essere utile: https://help.ubuntu.com/community/BootServices :-\Nede ha scritto: Buongiorno e buona domenica! Per via di questo problema http://forum.ubuntu-it.org/viewtopic.php?t=460622 mi chiedevo se è possibile trovare lo script di spegnimento/riavvio del S.O. per poter modificare l'ordine di chiusura di network-manager e metterla per ultima cosa......
Si può fare?
-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Ciao cri e grazie per l'intervento. Ho installato bum ma sembra che serva principalmente a non far partire determinati servizi all'avvio del S.O.!
Ho paura che il mio problema non sia risolvibile. Leggo molte segnalazioni in rete inerenti con bug vari. Pare che il casino sia partito dalla versione 10.10 di ubuntu.....
(b2b)
Ho paura che il mio problema non sia risolvibile. Leggo molte segnalazioni in rete inerenti con bug vari. Pare che il casino sia partito dalla versione 10.10 di ubuntu.....
(b2b)
- cristian_c
- Accecante Asceta

- Messaggi: 23422
- Iscrizione: lunedì 29 ottobre 2007, 11:31
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Ciao Nede, prova qui: http://tinyurl.com/3m9j5m7Nede ha scritto: Ciao cri e grazie per l'intervento. Ho installato bum ma sembra che serva principalmente a non far partire determinati servizi all'avvio del S.O.!
Ho paura che il mio problema non sia risolvibile. Leggo molte segnalazioni in rete inerenti con bug vari. Pare che il casino sia partito dalla versione 10.10 di ubuntu.....
(b2b)
(volevo tanto fare questa cosa da tanto tempo (rotfl) )
-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Che forte!!!!! Proprio simpatico, bravo! (rotfl)
Il problema stà sempre nel fatto che si parla di avvio e non di spegnimento......
Il problema stà sempre nel fatto che si parla di avvio e non di spegnimento......
- cristian_c
- Accecante Asceta

- Messaggi: 23422
- Iscrizione: lunedì 29 ottobre 2007, 11:31
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Eh, lo so, che sagoma che sono! ;D ... spero tu non abbia usato ironia nella risposta :(Nede ha scritto: Che forte!!!!! Proprio simpatico, bravo! (rotfl)
Il problema stà sempre nel fatto che si parla di avvio e non di spegnimento......
Qui: https://help.ubuntu.com/community/UbuntuBootupHowto
viene mostrato un comando in particolare:Installing custom init-scripts
To install your own script, copy it to /etc/init.d, and make it executable.
sudo cp myscript /etc/init.d
sudo chmod +x /etc/init.d/myscript
To make the script run with the start argument at the end of the start sequence, and run with the stop argument at the beginning of the shutdown sequence:
sudo update-rc.d myscript defaults 98 02
98 and 02 are the start and stop sequence numbers respectively. Both are numbers between 00 and 99 and specify how early or late a service is started or killed. If a service is started late, it should be killed early and vice-versa. A good rule of thumb is to make the stop sequence number equal to 100 minus the start sequence number.
For more information on the usage of update-rc.d
man update-rc.d
IconsPage/IconWarning3.png
Codice: Seleziona tutto
sudo update-rc.d myscript defaults 98 02-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
no no, bello sul serio!!!!!... spero tu non abbia usato ironia nella risposta
penso però di non essere così bravo da riuscire ad ottenerlo!mentre a noi interesserebbe ottenere l'effetto esattamente opposto e speculare. Sono quasi certo che ciò non sia impossibile Yes
Però mi hai dato un'idea, voglio leggere lo script init.d di network manager........
-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Va bhe, volevo fare lo sborone ma NON CI CAPISCO NIENTE :-[ !
/etc/init.d/network-manager
Questo è il file di Ubuntu 11.10. Visto che sulla 10.04 non c'era questo problema qualcuno può postare il file della 10.04? Magari ci sono delle differenze......
/etc/init.d/network-manager
Codice: Seleziona tutto
#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.
set -e
INITSCRIPT="$(basename "$0")"
JOB="${INITSCRIPT%.sh}"
if [ "$JOB" = "upstart-job" ]; then
if [ -z "$1" ]; then
echo "Usage: upstart-job JOB COMMAND" 1>&2
exit 1
fi
JOB="$1"
INITSCRIPT="$1"
shift
else
if [ -z "$1" ]; then
echo "Usage: $0 COMMAND" 1>&2
exit 1
fi
fi
COMMAND="$1"
shift
if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
ECHO=echo
else
ECHO=:
fi
$ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)"
$ECHO "utility, e.g. service $INITSCRIPT $COMMAND"
case $COMMAND in
status)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB"
$COMMAND "$JOB"
;;
start|stop)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB"
if status "$JOB" 2>/dev/null | grep -q ' start/'; then
RUNNING=1
fi
if [ -z "$RUNNING" ] && [ "$COMMAND" = "stop" ]; then
exit 0
elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then
exit 0
fi
$COMMAND "$JOB"
;;
restart)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the stop(8) and then start(8) utilities,"
$ECHO "e.g. stop $JOB ; start $JOB. The restart(8) utility is also available."
if status "$JOB" 2>/dev/null | grep -q ' start/'; then
RUNNING=1
fi
if [ -n "$RUNNING" ] ; then
stop "$JOB"
fi
start "$JOB"
;;
reload|force-reload)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the reload(8) utility, e.g. reload $JOB"
reload "$JOB"
;;
*)
$ECHO
$ECHO "The script you are attempting to invoke has been converted to an Upstart" 1>&2
$ECHO "job, but $COMMAND is not supported for Upstart jobs." 1>&2
exit 1
esac- cristian_c
- Accecante Asceta

- Messaggi: 23422
- Iscrizione: lunedì 29 ottobre 2007, 11:31
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Io sono sulla 10.10:Nede ha scritto: Va bhe, volevo fare lo sborone ma NON CI CAPISCO NIENTE :-[ !
/etc/init.d/network-managerQuesto è il file di Ubuntu 11.10. Visto che sulla 10.04 non c'era questo problema qualcuno può postare il file della 10.04? Magari ci sono delle differenze......Codice: Seleziona tutto
#!/bin/sh -e # upstart-job # # Symlink target for initscripts that have been converted to Upstart. set -e INITSCRIPT="$(basename "$0")" JOB="${INITSCRIPT%.sh}" if [ "$JOB" = "upstart-job" ]; then if [ -z "$1" ]; then echo "Usage: upstart-job JOB COMMAND" 1>&2 exit 1 fi JOB="$1" INITSCRIPT="$1" shift else if [ -z "$1" ]; then echo "Usage: $0 COMMAND" 1>&2 exit 1 fi fi COMMAND="$1" shift if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then ECHO=echo else ECHO=: fi $ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)" $ECHO "utility, e.g. service $INITSCRIPT $COMMAND" case $COMMAND in status) $ECHO $ECHO "Since the script you are attempting to invoke has been converted to an" $ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB" $COMMAND "$JOB" ;; start|stop) $ECHO $ECHO "Since the script you are attempting to invoke has been converted to an" $ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB" if status "$JOB" 2>/dev/null | grep -q ' start/'; then RUNNING=1 fi if [ -z "$RUNNING" ] && [ "$COMMAND" = "stop" ]; then exit 0 elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then exit 0 fi $COMMAND "$JOB" ;; restart) $ECHO $ECHO "Since the script you are attempting to invoke has been converted to an" $ECHO "Upstart job, you may also use the stop(8) and then start(8) utilities," $ECHO "e.g. stop $JOB ; start $JOB. The restart(8) utility is also available." if status "$JOB" 2>/dev/null | grep -q ' start/'; then RUNNING=1 fi if [ -n "$RUNNING" ] ; then stop "$JOB" fi start "$JOB" ;; reload|force-reload) $ECHO $ECHO "Since the script you are attempting to invoke has been converted to an" $ECHO "Upstart job, you may also use the reload(8) utility, e.g. reload $JOB" reload "$JOB" ;; *) $ECHO $ECHO "The script you are attempting to invoke has been converted to an Upstart" 1>&2 $ECHO "job, but $COMMAND is not supported for Upstart jobs." 1>&2 exit 1 esac
Codice: Seleziona tutto
#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.
set -e
INITSCRIPT="$(basename "$0")"
JOB="${INITSCRIPT%.sh}"
if [ "$JOB" = "upstart-job" ]; then
if [ -z "$1" ]; then
echo "Usage: upstart-job JOB COMMAND" 1>&2
exit 1
fi
JOB="$1"
INITSCRIPT="$1"
shift
else
if [ -z "$1" ]; then
echo "Usage: $0 COMMAND" 1>&2
exit 1
fi
fi
COMMAND="$1"
shift
if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
ECHO=echo
else
ECHO=:
fi
$ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)"
$ECHO "utility, e.g. service $INITSCRIPT $COMMAND"
case $COMMAND in
status)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB"
$COMMAND "$JOB"
;;
start|stop|restart)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB"
PID=$(status "$JOB" 2>/dev/null | awk '/[0-9]$/ { print $NF }')
if [ -z "$PID" ] && [ "$COMMAND" = "stop" ]; then
exit 0
elif [ -n "$PID" ] && [ "$COMMAND" = "start" ]; then
exit 0
elif [ -z "$PID" ] && [ "$COMMAND" = "restart" ]; then
start "$JOB"
exit 0
fi
$COMMAND "$JOB"
;;
reload|force-reload)
$ECHO
$ECHO "Since the script you are attempting to invoke has been converted to an"
$ECHO "Upstart job, you may also use the reload(8) utility, e.g. reload $JOB"
reload "$JOB"
;;
*)
$ECHO
$ECHO "The script you are attempting to invoke has been converted to an Upstart" 1>&2
$ECHO "job, but $COMMAND is not supported for Upstart jobs." 1>&2
exit 1
esac-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
- cristian_c
- Accecante Asceta

- Messaggi: 23422
- Iscrizione: lunedì 29 ottobre 2007, 11:31
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
in realtà ti consiglio di provare prima a cercare consiglio su irc in #ubuntu-it sul da farsi (yes)Nede ha scritto: Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Installo subito x-chat!!!!!!!!!!!cristian_c ha scritto:in realtà ti consiglio di provare prima a cercare consiglio su irc in #ubuntu-it sul da farsi (yes)Nede ha scritto: Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
-
Nede
- Scoppiettante Seguace

- Messaggi: 870
- Iscrizione: domenica 5 luglio 2009, 21:22
- Desktop: ubuntu
- Distribuzione: Ubuntu 16.04.2 LTS x86_64
- Sesso: Maschile
- Località: Ciriè
Re: [NON PIU' NECESSARIO]Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Su irc purtroppo non ho avuto risposte ne su irc italia ne su irc internazionale..... :'(
Ad ogni modo ho trovato questi 2 comandi che hanno risolto il problema:
leggendoli da qui: https://help.ubuntu.com/community/MountWindowsSharesPermanently
Per la cronaca, se si legge il mio post qui: http://forum.ubuntu-it.org/viewtopic.php?t=460622 ho iniziato ad avere questo problema su un altro pc quando ho messo 11.04 ma solo per il file system smbfs e i comandi che ho citato in passato non hanno risolto, mentre hanno compiuto la magia adesso! Funziona lo spegnimento/riavvio montando all'avvio tramite fstab n. cartelle sia con file system nfs che smbfs...... :-\
Aggiorno l'altro post con la novità.....
Ad ogni modo ho trovato questi 2 comandi che hanno risolto il problema:
Codice: Seleziona tutto
sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .Per la cronaca, se si legge il mio post qui: http://forum.ubuntu-it.org/viewtopic.php?t=460622 ho iniziato ad avere questo problema su un altro pc quando ho messo 11.04 ma solo per il file system smbfs e i comandi che ho citato in passato non hanno risolto, mentre hanno compiuto la magia adesso! Funziona lo spegnimento/riavvio montando all'avvio tramite fstab n. cartelle sia con file system nfs che smbfs...... :-\
Aggiorno l'altro post con la novità.....
Chi c’è in linea
Visualizzano questa sezione: Bing [Bot] e 5 ospiti