Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 13/04/2009, à 14:56

spock

Plus de connection au démarrage

Bonjour à tous,

J'ai un modem Fast 800. La connection automatique ne marche plus.

La commande "sudo /etc/init.d/networking restart" fonctionne sans problème.

Je n'ai pas touché au fichier /etc/rc.local. Le voici :

PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"

# flag file to indicate that the network has been configured.
# see LP: #44194 for details
INIT_FLAG=/var/run/network/initialized

/etc/init.d/networking restart
[ -x /sbin/ifup ] || exit 0

. /lib/lsb/init-functions

net_flag_up () {
	touch $INIT_FLAG
}

net_flag_down () {
	rm -f $INIT_FLAG
}

# helper function to set the usplash timeout. https://launchpad.net/bugs/21617
usplash_timeout () {
	TIMEOUT=$1
	if [ -x /sbin/usplash_write ]; then
	    /sbin/usplash_write "TIMEOUT $TIMEOUT" || true
	fi
}

process_options() {
    [ -e /etc/network/options ] || return 0
    log_warning_msg "/etc/network/options still exists and it will be IGNORED! Read README.Debian of netbase."
}

check_network_file_systems() {
    [ -e /proc/mounts ] || return 0

    exec 9<&0 < /proc/mounts
    while read DEV MTPT FSTYPE REST; do
	case $DEV in
	/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
	    log_warning_msg "not deconfiguring network interfaces: network devices still mounted."
/etc/init.d/networking restart
	    exit 0
	    ;;
	esac
	case $FSTYPE in
	nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2)
	    log_warning_msg "not deconfiguring network interfaces: network file systems still mounted."
/etc/init.d/networking restart
	    exit 0
	    ;;
	esac
    done
    exec 0<&9 9<&-
}

case "$1" in
start)
	process_options

	log_action_begin_msg "Configuring network interfaces"
	usplash_timeout 120
	if [ "$VERBOSE" != no ]; then
	    if ifup -a; then
		log_action_end_msg $?
	    else
		log_action_end_msg $?
	    fi
	else
	    if ifup -a >/dev/null 2>&1; then
		log_action_end_msg $?
	    else
		log_action_end_msg $?
	    fi
	fi
	usplash_timeout 15
	net_flag_up
	;;

stop)
	check_network_file_systems

	log_action_begin_msg "Deconfiguring network interfaces"
	if [ "$VERBOSE" != no ]; then
	    if ifdown -a --exclude=lo; then
		log_action_end_msg $?
	    else
		log_action_end_msg $?
	    fi
	else
	    if ifdown -a --exclude=lo >/dev/null 2>/dev/null; then
		log_action_end_msg $?
	    else
		log_action_end_msg $?
	    fi
	    net_flag_down
	fi
	;;

force-reload|restart)
	process_options

	log_action_begin_msg "Reconfiguring network interfaces"
	ifdown -a --exclude=lo || true
	net_flag_down
	if ifup -a --exclude=lo; then
	    net_flag_up
	    log_action_end_msg $?
	else
	    log_action_end_msg $?
	fi
	;;

*)
	echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
	exit 1
	;;
esac

/etc/init.d/networking restart
exit 0

Hors ligne

#2 Le 14/04/2009, à 17:59

spock

Re : Plus de connection au démarrage

sudo /etc/init.d/networking restart

ou comment lancer cette commande automatiquement au demarrage sans qu'il me demande le mot passe.

Hors ligne