[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: AGX's User Profiles



Sorry for the big quote ... just to remember you about this
talks we had some month ago.


> > Hi to everybody,
> > i'm Antonio Gallo the makers of the Bad Penguin GNU/Linux distribution
> > (www.badpenguin.org).
> > 
> > Before i noticed Debian, 4 years ago i begin linuxing with a Slackware.
> > After i while i start writing some configuration scripts with shell
> > and Dialogs.
> > 
> > I don't want re-invent the wheel ... i appreciated Debian as the only
> > true one Linux distribution and don't want to stay too different from
> > them.
> > 
> > I have a quite lot of configuration script (network,swap,soundcard,X,etc.)
> > i would like to port it to Debian.
> 
> Install a Debian system, if not done already.
> 
> Put your scipts into relevant Packages.
> 
> Test, test, test and let someone else test it again. :)
> 
> If it works and you also changed the documentation and such, make a
> diff between the maintainers version and yours and send that to the
> bug tracking system acomplished with some describing words of what you 
> did (or directly to the maintainer).
> 
> Thats usually the best way to get changes into the Package. If the
> maintainer doesn´t react for some time you can ask on debian-sponsors
> for someone to make a NMU (non maintainer upload) for you, since you
> are probably no Debian developer yet.
> 
> > I would like to start from network configuration,
> > but configuration scripts are spanned across many packages.
> 
> Hmm, what packages? I only know of the base.tgz and pcmcia stuff
> having to deal with the network and the one from base needs working on.
> 
> > How should i proceed ?
> > 
> > Have i to contact any individual package mantainer and convince him to
> > put my script into the package or can i just implement my own package ?
> > But in the last case having two files with the same names is not into
> > the policy.
> 
> No file may be in two packages at any given time. dpkg just won´t
> install the second one because of the conflict.
> 
> > Also, any of my configuration script, include data into as into the
> > following example:
> > 
> > 
> > #!/bin/sh
> > if [ ! -f /etc/sysconfig/network-settings ]; then
> >   echo "Network is not configured "!
> >   exec /usr/local/lib/agx-userprofiles/network-configure.sh
> > fi
> > 
> > # Init vars
> > NETWORKING="NO"
> > 
> > # Get Settings
> > . /etc/sysconfig/network-settings
> > 
> > # Do stuffs with those settings
> > echoc GREEN "Is network enabled ? $NETWORKING"
> > 
> > is there a default dir for those settings ?
> > 
> > I used /etc/sysconfig for general settings and
> > /etc/sysconfig/$PROFILE for hardware profile related settings
> 
> Normaly /etc/ is fine. But for Packages with multiple config files
> /etc/package/ would be a better place.
> 
> Also no binary should be in /etc, so strictly speacking /etc/init.d is 
> illegal alltogether.
> 
> Try to seperate config data and scripts as in the above case. Thats a
> very good thing to do and is not done often enough with the current
> config scripts. Also keep your conig data structured and
> commented. Have dpkg recognise them as config files and use debconf to 
> configure them. This probably means throwing away most of your config
> scripts or means changing them a lot, but debconf should be a must for 
> configuration.
> 
> Also never execute some config program on failure. In the case of a
> crash or some other accident the config program could be called and
> the next person walking by the computer can make the World explode. :)
> OK, OK, he wont be able to blow up the world, but lets not give anyone 
> a chance if you understand what I mean.
> 
> May the Source be with you.
> 			Goswin

Ok, i'am looking into debconf but i didn't like it maybe because it does not
what i need. I explain you about my project.

I have a script called 'controlpanel', this script parse a directory
into the same format of Gnome app bar (/usr/share/gnome/apps)
for each file you can define a long name that is used on the menu
and an app to be executed.

So my controlpanel is arranged in 3 main menu':
	- hardware configuration (modem, mouse, netcards, soundcards, etc.)
	- system configuration (swap, network settings, etc.)
	- system administration (apache, postfix, etc.)

As example, if you choose to configure the mouse i run
	/etc/init.d/mouse.rc configure
that calls with exec
	/usr/local/lib/agx-userprofiles/mouse.sh
this ask you about your mouse and save data into
	/etc/sysconfig/$PROFILE/mouse
this config file is something like
	MOUSE_TYPE=ps2
	MOUSE_DEV=psaux
the it recalls
	/etc/init.d/mouse.rc restart
that close gpm, relink /dev/mouse to /dev/psaux, and restart gpm
there are no recursion due to the use of 'exec'
then finally it returns to the controlpanel.

The network example is similar:
1. you run the controlpanel
2. chose to configure your network settings
   this is done by calling /etc/init.d/network.service configure that 
   calls /usr/local/lib/agx-userprofiles/network-config.sh
3. the list of the configured interfaces are shown, you can also
   add a new interface like eth0:1 eth0:2 if you are an ISP with ip aliasing
4. for each interface you can customize the settings
5. settings are writteng in /etc/sysconfig/$PROFILE/$INTERFACE.interface
   where $PROFILE is the current hardware profiles and
   $INTERFACE is the name of the interface (eth0:2.interface is a legal name)
6. the network settings are reloaded calling /etc/init.d/network.service restart
   this first perform the 'down' of each interface the use ifconfig to
   reconfigure each interface however before to do this /etc/hosts, resolv.conf
   and other files are updated

We are also developing a tool alternative to debconf, its called libgringo
a simple library that let you write programs that run both in ncurses both
under Gtk, this is to develop particular configuration script like current
out usermanger that look very ugly with the dialog interface.

I hope to have some clue from you on how to integrate this things in Debian
if they are goot things.

Regards,
	Antonio Gallo (AGX)
	http://www.badpenguin.org

p.s.
if my english look bad i can send you some source code :-)


Reply to: