You are not logged in.

#1 2011-01-01 18:09:54

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

networkmod: initscript's network daemon with hooks

AUR & more info.

This is just a simple modification of the network daemon included in the initscripts package. It adds hooks to runs scripts before and after different actions. For example, I use it to start openntpd after the first interface has been brought up and to stop it when the last interface has been brought down. I also use it to configure hardware addresses before certain interfaces are brought up.

The daemon searches for scripts in subdirectories of /etc/networkmod/, e.g. /etc/networkmod/pre-ifup/, /etc/networkmod/post-ifup/. This is similar to the way scripts can be dropped in /etc/cron.*/ to be run by crond. The location of the main directory may change in the future depending on feedback  and it may even be made configurable via /etc/rc.conf.

Please see the info page for examples including the scripts to start openntpd. You can also find a list of the hooks on that page. The daemon is simple though so you should just look at the code to see what it does. All hooks are run with a function named "run_hooks", so you can just grep the file to find them.


Please help me improve this script if you can. Given its simplicity and utility it may be possible to have the patch applied to the network daemon in the initscripts package.


Before anyone asks why I don't just use netcfg or networkmanager, this is far simpler.

Last edited by Xyne (2011-01-01 18:13:37)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB