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

Installazione, configurazione e uso di programmi e strumenti.
Scrivi risposta
Nede
Scoppiettante Seguace
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?

Messaggio 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?
Ultima modifica di Nede il domenica 16 ottobre 2011, 21:47, modificato 1 volta in totale.
Avatar utente
cristian_c
Accecante Asceta
Accecante Asceta
Messaggi: 23422
Iscrizione: lunedì 29 ottobre 2007, 11:31

Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?

Messaggio 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  :-\
UP! Unreal Project: il futuro inizia qui. Crusade è tra noi
È scienza!
Nede
Scoppiettante Seguace
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?

Messaggio 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)
Avatar utente
cristian_c
Accecante Asceta
Accecante Asceta
Messaggi: 23422
Iscrizione: lunedì 29 ottobre 2007, 11:31

Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?

Messaggio 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 ;D

(volevo tanto fare questa cosa da tanto tempo  (rotfl) )
UP! Unreal Project: il futuro inizia qui. Crusade è tra noi
È scienza!
Nede
Scoppiettante Seguace
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?

Messaggio da Nede »

Che forte!!!!! Proprio simpatico, bravo!  (rotfl)
Il problema stà sempre nel fatto che si parla di avvio e non di spegnimento......
Avatar utente
cristian_c
Accecante Asceta
Accecante Asceta
Messaggi: 23422
Iscrizione: lunedì 29 ottobre 2007, 11:31

Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?

Messaggio 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:

Codice: Seleziona tutto

sudo update-rc.d myscript defaults 98 02
mentre a noi interesserebbe ottenere l'effetto esattamente opposto e speculare. Sono quasi certo che ciò non sia impossibile  (yes)
UP! Unreal Project: il futuro inizia qui. Crusade è tra noi
È scienza!
Nede
Scoppiettante Seguace
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?

Messaggio da Nede »

... spero tu non abbia usato ironia nella risposta
no no, bello sul serio!!!!!  8)
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........
Nede
Scoppiettante Seguace
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?

Messaggio 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......
Avatar utente
cristian_c
Accecante Asceta
Accecante Asceta
Messaggi: 23422
Iscrizione: lunedì 29 ottobre 2007, 11:31

Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?

Messaggio 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
UP! Unreal Project: il futuro inizia qui. Crusade è tra noi
È scienza!
Nede
Scoppiettante Seguace
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?

Messaggio da Nede »

Grazie cri!
Noto che è già diverso!!! Che dici, provo a sostituirlo? (chiaramente previo back-up del file...)
Avatar utente
cristian_c
Accecante Asceta
Accecante Asceta
Messaggi: 23422
Iscrizione: lunedì 29 ottobre 2007, 11:31

Re: Qual'è lo scrip usato per lo spegnimento/riavvio di ubuntu?

Messaggio 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)
UP! Unreal Project: il futuro inizia qui. Crusade è tra noi
È scienza!
Nede
Scoppiettante Seguace
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?

Messaggio 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!!!!!!!!!!!
Nede
Scoppiettante Seguace
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?

Messaggio 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à.....
Scrivi risposta

Ritorna a “Applicazioni”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 2 ospiti