démon connexion ?

Salut à tous, je fais une application qui a pour but d’installer des mises à jour sur une architecture arm et je me demandais si il existait un moyen (un démon par exemple) pour exécuter une application dès que le système est connecté à Internet ? (ou que la connexion est disponible, par exemple : je branche mon câble ethernet et paf le logiciel se lance …)

Nico

Tu peux peut-être regarder du côté de ifplugd. Et plus particulièrement son option -r (run) :

[quote]Specify program to execute when link status changes (default: /etc/ifplugd/ifplugd.action)
/etc/ifplugd/ifplugd.action: this is the script which will be called by the daemon whenever the state of the interface changes. It takes two areguments: the first is the interface name (eg. eth0), the second either “up” or “down”.[/quote]
0pointer.de/lennart/projects/ifplugd/

Disponible également dans le dépôt stable : packages.debian.org/etch/ifplugd

Tu peux aussi mettre une instruction up <commande à executer> dans la section d’/etc/network/interfaces qui correspond à ton interface. C’est pas idéal pour les interfaces statiques, mais pour les interfaces dhcp, le up ne s’execute que quand l’adresse est attribuée.
Il y a aussi le paquet whereami, un peu plus riche que ifplugd mais plus compliqué à utiliser, et qui peut être utile pour tester les conditions et décider si tu lances ton operation de màj ou pas (ça fait des ping et ça sniffe des choses sur le réseau pour savoir si en plus du link actif, tu as une vraie connection):

[quote]roc@roc:~/public_html/lscomgmt$ aptitude show whereami
Paquet : whereami
Nouveau: oui
État: installé
Automatiquement installé: non
Version : 0.3.34-0.1
Priorité : supplémentaire
Section : net
Responsable : Andrew McMillan debian@mcmillan.net.nz
Taille décompressée : 291k
Dépend: debconf (>= 1.2.9) | debconf-2.0, fping | iputils-ping | netbase | dhcp-client, perl
Recommande: iputils-arping, resolvconf, wireless-tools
Suggère: ethtool, fping, ifplugd, net-tools, pcmcia-cs, squid | oops
Description : Automatically reconfigure your (laptop) system for a new location
whereami is a set of useful scripts and a coordinating system for automatically re-locating your computer within the current (network) environment.

Typically, you would use whereami to automatically detect and re-configure your laptop when you move between a variety of diverse networks and/or docking
environments.

Although whereami will work best if all of your networks assign addresses through dhcp, this is not a pre-requisite and the system allows any technique to
be used to ascertain the new location with as little ongoing user intervention as possible.

Having ascertained the correct location, whereami will run appropriate (user-configured) scripts to adjust the laptop operation to suit the current
environment.

See the man pages for more information. You may also get useful assistance from the debian-laptop mailing list, which is frequented by several of the
users and contributors.

Étiquettes: hardware::laptop, implemented-in::perl, implemented-in::shell, network::configuration, protocol::dhcp, role::program, scope::utility [/quote]