Pagina 1 di 1
[NON PIU' NECESSARIO]Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 14:01
da Nede
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?
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 14:55
da cristian_c
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?
Non so se questo può essere utile:
https://help.ubuntu.com/community/BootServices :-\
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 17:28
da Nede
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)
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 17:54
da cristian_c
Nede 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)
Ciao Nede, prova qui:
http://tinyurl.com/3m9j5m7
(volevo tanto fare questa cosa da tanto tempo (rotfl) )
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 18:12
da Nede
Che forte!!!!! Proprio simpatico, bravo! (rotfl)
Il problema stà sempre nel fatto che si parla di avvio e non di spegnimento......
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 18:21
da cristian_c
Nede ha scritto:
Che forte!!!!! Proprio simpatico, bravo! (rotfl)
Il problema stà sempre nel fatto che si parla di avvio e non di spegnimento......
Eh, lo so, che sagoma che sono! ;D ... spero tu non abbia usato ironia nella risposta :(
Qui:
https://help.ubuntu.com/community/UbuntuBootupHowto
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
viene mostrato un comando in particolare:
mentre a noi interesserebbe ottenere l'effetto esattamente opposto e speculare. Sono quasi certo che ciò non sia impossibile (yes)
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 18:27
da Nede
... spero tu non abbia usato ironia nella risposta
no no, bello sul serio!!!!!
mentre a noi interesserebbe ottenere l'effetto esattamente opposto e speculare. Sono quasi certo che ciò non sia impossibile Yes
penso però di non essere così bravo da riuscire ad ottenerlo!
Però mi hai dato un'idea, voglio leggere lo script init.d di network manager........
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 18:48
da Nede
Va bhe, volevo fare lo sborone ma NON CI CAPISCO NIENTE :-[ !
/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
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......
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 18:52
da cristian_c
Nede ha scritto:
Va bhe, volevo fare lo sborone ma NON CI CAPISCO NIENTE :-[ !
/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
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......
Io sono sulla 10.10:
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
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 18:58
da Nede
Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 19:08
da cristian_c
Nede ha scritto:
Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
in realtà ti consiglio di provare prima a cercare consiglio su irc in #ubuntu-it sul da farsi (yes)
Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 19:10
da Nede
cristian_c ha scritto:
Nede ha scritto:
Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
in realtà ti consiglio di provare prima a cercare consiglio su irc in #ubuntu-it sul da farsi (yes)
Installo subito x-chat!!!!!!!!!!!
Re: [NON PIU' NECESSARIO]Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?
Inviato: domenica 16 ottobre 2011, 21:53
da Nede
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:
Codice: Seleziona tutto
sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .
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à.....