Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Initscripts: keeping it simple
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Robbins  
View profile  
 More options Jul 8, 5:31 pm
From: Daniel Robbins <drobb...@funtoo.org>
Date: Wed, 8 Jul 2009 15:31:54 -0600
Local: Wed, Jul 8 2009 5:31 pm
Subject: Initscripts: keeping it simple
As I've posted on my blog, I'm looking to move to a simpler setup for
networking initscripts:

http://blog.funtoo.org/2009/06/initscripts-keeping-it-simple.html

The specific changes I'm looking at making (all together) are:

1) Upgrade to OpenRC 0.5.0+
2) Adding OpenResolv to Funtoo Core
3) Moving to minimal initscripts
4) Moving to dhcpcd 5.x

If you are using dhcp, all you need to do for network config is to add
/etc/init.d/dhcpcd
to your default runlevel (I think -- I'll be testing this, please test
dhcpd-5 too :)

Here is a sample net.eth0 (static config) I am using for testing,
which follows the
minimal approach:

#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        provide net
        after net.lo

}

IP=207.66.127.104
NM=255.255.255.0
GW=207.66.127.254
INT=eth0

start() {
        ebegin "Configuring network interface $INT"
        ifconfig $INT $IP netmask $NM up && \
        route add default gw $GW $INT && \
        resolvconf -a $INT << "EOF"
domain funtoo.org
nameserver 129.121.254.1
nameserver 129.121.254.2
EOF
        eend $?

}

stop() {
        ebegin "Shutting down network interface $INT"
        resolvconf -d $INT && \
        route del default gw $GW $INT && \
        ifconfig $INT down
        eend $?

}

As you can see, resolv.conf info is stored in the initscript, and this
works great with openresolv. What this means is that you don't write
directly to /etc/resolv.conf anymore.

Here is a sample net.lo:

#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        provide net

}

start() {
        ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
        route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

}

stop() {
        route del -net 127.0.0.0 netmask 255.0.0.0 dev lo
        ifconfig lo down

}

Looking for feedback...

-Daniel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
drobbins  
View profile  
 More options Jul 8, 5:46 pm
From: drobbins <drobbins.dan...@gmail.com>
Date: Wed, 8 Jul 2009 14:46:25 -0700 (PDT)
Local: Wed, Jul 8 2009 5:46 pm
Subject: Re: Initscripts: keeping it simple
Just to clarify - I want to move to minimal *network* initscripts....

On Jul 8, 3:31 pm, Daniel Robbins <drobb...@funtoo.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Cordero  
View profile  
 More options Jul 8, 6:23 pm
From: Daniel Cordero <theapple...@gmail.com>
Date: Wed, 8 Jul 2009 23:23:01 +0100
Local: Wed, Jul 8 2009 6:23 pm
Subject: Re: Initscripts: keeping it simple

On Wed, Jul 08, 2009 15:31:30 -0600, Daniel Robbins wrote:
> Looking for feedback...

My dhcpcd.conf has:
        nohook resolv.conf
and I leave my /etc/resolv.conf alone (my router incorrectly handles dns
servers).

For me, I don't really care what address my ethernet gets. Letting DHCP
take care of it whenever it is plugged in would be nice (it shouts at me
for not configuring it).
I would like to know (i.e. make it print) the IP address that I get.

For wireless, which I use more, I read that gentoo initscripts try to be
a bit too clever and freak it out. So, I wrote a script that sets it all
up.

        #!/bin/sh
        test "$1" -o -f /var/run/dhcpcd-ra0.pid && dhcpcd -x ra0

        ifconfig ra0 up
        iwconfig ra0 essid $(< ~/Desktop/essid) key $(< ~/Desktop/key) enc open
        dhcpcd -s 192.168.2.2 -m 2 ra0

(Due to a bug in the hardware, I do not need to worry about turning
off the adapter)

I used to be near some WPA spots, in which I beefed up my script to:

        #!/bin/sh
        test "$1" -o -f /var/run/dhcpcd-ra0.pid && dhcpcd -x ra0

        ifconfig ra0 up
        wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -ira0 -Dwext -B \
                || killall -HUP wpa_supplicant
        # wpa_supplicant has to be configured at each access point
        dhcpcd -m 2 ra0

As you can see, I have quite a few variables. In a more generic script,
these variables should go into /etc/conf.d/net (or somewhere
otherwise suitable), because a small change to the initscript will
mean a user (umm... i mean system admin) will need to learn about the
horror of merging in dispatch-conf.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RuanLaB  
View profile  
 More options Jul 11, 5:16 pm
From: RuanLaB <rimplestilhs...@gmail.com>
Date: Sat, 11 Jul 2009 14:16:10 -0700 (PDT)
Local: Sat, Jul 11 2009 5:16 pm
Subject: Re: Initscripts: keeping it simple
Running openrc 0.5.0, gcc 4.4.0 python 2.6.2-r* since end of May with
great success and speed improvements on 2.6.30 and above kernels.
This caused me to get the cold shoulder for not conforming to the
narrow minded dictatorship's of some gentoo distro's.

Would like to get eglibc into funtoo / gentoo if possible to get linux
back to basics / compact fast basis to customize on.

Adding openresolv and other basic usable networking is the way to go ,
too many Linux distro's adding bloatware that only works in Gnome or
KDE and ends up being a major pain to text login and getting it to
connect to wifi WPA or similar dew to lack of useful packages. Some
even lack midnight commander or binutils.

There is a lot of Linux users out there that wants to break away from
the torture tools that linux dictatorships has become and most of them
with a bit of guidance will jump into helping out provided they have
a way to help. Will have to start building up a new base of skilled
linux users before the linux users become extinct.

If there is a way I would like to setup a automated server that can
pull in new source code and build or create a usable up to date gentoo
funtoo tree or similar as gentoo tree is falling behind tremendously.

Very nice to see Daniel/Funtoo still in contact with daily use linux /
daily linux needs and thinking clearly unlike some linux developers
specializing in hiding in closets and building some far-out linux
program that only 100 users might use.

Keep up the good work.

You build it they will come. You are spot on with your ideas and
direction.

Regards
Ruan

***********

On Jul 8, 3:23 pm, Daniel Cordero <theapple...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Cordero  
View profile  
 More options Jul 15, 9:33 am
From: Daniel Cordero <theapple...@gmail.com>
Date: Wed, 15 Jul 2009 14:33:37 +0100
Local: Wed, Jul 15 2009 9:33 am
Subject: Re: Initscripts: keeping it simple

On Sat, Jul 11, 2009 14:15:46 -0700, RuanLaB wrote:
> Would like to get eglibc into funtoo / gentoo if possible to get linux
> back to basics / compact fast basis to customize on.

AFAIK, eglibc is a "glibc distribution", with doesn't make it any easier
or faster than ordinary glibc. Last time I checked, the major difference
is the maintainers and their patch-acceptance policy.

"Back to basics" would involve ANSI C's standard library (and POSIX
extensions optionally available) only, and a cat(1) that can read directories
and not "invisible" characters.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Robbins  
View profile  
 More options Jul 15, 12:39 pm
From: Daniel Robbins <drobb...@funtoo.org>
Date: Wed, 15 Jul 2009 10:39:07 -0600
Local: Wed, Jul 15 2009 12:39 pm
Subject: Re: Initscripts: keeping it simple

On Wed, Jul 15, 2009 at 7:33 AM, Daniel Cordero<theapple...@gmail.com> wrote:
> "Back to basics" would involve ANSI C's standard library (and POSIX
> extensions optionally available) only, and a cat(1) that can read directories
> and not "invisible" characters.

"Back to basics" can be interpreted in many different ways. For my
purposes, "back to basics" is the concept of putting the user in
direct control of their OS, and eliminating intermediate layers of
complexity when they don't add significant value, as these layers end
up becoming liabilities rather than assets over time (you need to
maintain them, they have their own bugs and limitations, etc.) If
significant amounts of code can be eliminated while functionality is
maintained or even improved, this is an indication that there is
bloat. Of course there are other factors to consider when deciding
whether or not to remove code - for Linux users, asking them to see
the commands that set up their network (and have direct control over
them) has other benefits besides just eliminating some unnecessary
code.

-Daniel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google