View previous topic :: View next topic |
Author |
Message |
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sun Aug 11, 2013 7:25 pm Post subject: |
|
|
smartass wrote: | VinzC, I use rfkill because AFAIK it can save power (may not be true for all cards). I recommend you assign a special key you don't use very often to issue rfkill through your WM or DE. |
Not required. IIRC unloading the kernel module (iwlwifi) is enough to stop the wireless adapter (at least on my machine). As far as power is concerned the video adapter (Radeon) consumes far more than the wifi card, alas, which shows a negligible consumption in comparison. [OT: That's why I'm looking forward to 3.11 and DPM for ATI cards. But that's another story.] _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Mon Aug 19, 2013 9:53 am Post subject: |
|
|
I would just like to say thanks to VincZ for documenting and promoting what I originally set out to do with the OpenRC network (not the net.*) script and dhcpcd.
Basically, configure conf.d/network to brink up the link (bridging, bonding, authentication, etc) and let dhcpcd handle everything else.
Of note re wpa_supplicant, dhcpcd-6 will start (and stop) wpa_supplicant if /etc/wpa_supplicant.conf exists by itself.
This is handy because I can now plug and unplug a USB wifi card and It Just Works
No need for udev, ifplugd, NM or anything else. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
smartass Apprentice
Joined: 04 Jul 2011 Posts: 189 Location: right behind you ... (you did turn around, didn't you?)
|
Posted: Mon Aug 19, 2013 11:32 am Post subject: |
|
|
UberLord wrote: |
Of note re wpa_supplicant, dhcpcd-6 will start (and stop) wpa_supplicant if /etc/wpa_supplicant.conf exists by itself.
This is handy because I can now plug and unplug a USB wifi card and It Just Works
No need for udev, ifplugd, NM or anything else. | I appreciate that you've added so many features, but isn't it a bit too far against the unixy way of having one tool do its job well and do only that job?
OTOH, it's incredible that you've managed to this on your own in one tool and the people at RH have been failing to make it so simple and automagic for years
But seriously, isn't it a bit close to reinventing the wheel? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Mon Aug 19, 2013 11:49 am Post subject: |
|
|
smartass wrote: | UberLord wrote: |
Of note re wpa_supplicant, dhcpcd-6 will start (and stop) wpa_supplicant if /etc/wpa_supplicant.conf exists by itself.
This is handy because I can now plug and unplug a USB wifi card and It Just Works
No need for udev, ifplugd, NM or anything else. | I appreciate that you've added so many features, but isn't it a bit too far against the unixy way of having one tool do its job well and do only that job?
|
Not at all, when you view that the job of dhcpcd is just to configure network interfaces - it's not just a DHCP client.
And it does configure network interfaces very very well
OK, interacting so directly with wpa_supplicant is a little out of scope as dhcpcd doesn't really want to manage link configuration BUT it's a great example of how the hook scripts work.
The main reason why I included it is for the benefit of the BSD systems I also use where the user is entirely expected to script hotplugging, unlike say in Gentoo where this is achieved via udev and OpenRC automatically.
Quote: |
OTOH, it's incredible that you've managed to this on your own in one tool and the people at RH have been failing to make it so simple and automagic for years
But seriously, isn't it a bit close to reinventing the wheel? |
Thanks
It's not re-inventing the wheel at all. It's about making the wheel better with less maintenance.
Think about how many different parts other systems have, now think about many different parts dhcpcd has. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Mon Aug 19, 2013 6:26 pm Post subject: |
|
|
UberLord wrote: | I would just like to say thanks to VincZ for documenting and promoting what I originally set out to do with the OpenRC network (not the net.*) script and dhcpcd. [...] |
It's my pleasure, Roy, totally.
Even after hacking the network stack and creating my own set of tools I still felt like I had underused dhcpcd all those years. So I dug a little and decided to share my findings. And I have to admit it is a remarkable tool of simplicity. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
Posted: Tue Sep 17, 2013 10:13 am Post subject: |
|
|
Hello,
I tried the tip, and I would like to migrate preup() and postup() hooks I have in /etc/conf.d/net, especially the SSID variable. But moving preup() and postup() from net to network don't help.
Any idea? _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
smartass Apprentice
Joined: 04 Jul 2011 Posts: 189 Location: right behind you ... (you did turn around, didn't you?)
|
Posted: Tue Sep 17, 2013 11:54 am Post subject: |
|
|
XavierMiller, you could use the hooks framework that dhcpcd offers. See the manual page of according to the ssid variable can be set, so you could add a case construct for that. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
Posted: Tue Sep 17, 2013 12:19 pm Post subject: |
|
|
Thank you, I will take a look tonight _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
Dr.Willy Guru
Joined: 15 Jul 2007 Posts: 547 Location: NRW, Germany
|
Posted: Tue Sep 17, 2013 2:59 pm Post subject: |
|
|
wireless specific actions can also be triggered via "wpa_cli -a <script>" |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
Posted: Tue Sep 17, 2013 6:02 pm Post subject: |
|
|
Hello,
I have an other issue : wpa_supplicant is not run on hotplugged wlan interfaces (usb sticks). If I restart the service, the USB stick is activated. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Sep 17, 2013 6:26 pm Post subject: |
|
|
XavierMiller wrote: | I have an other issue : wpa_supplicant is not run on hotplugged wlan interfaces (usb sticks). If I restart the service, the USB stick is activated. |
Have you installed >=dhcpcd-6.0 ? _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
Posted: Tue Sep 17, 2013 6:30 pm Post subject: |
|
|
Yup, I'm running ~arch
Code: | [ebuild R ] net-misc/dhcpcd-6.0.5-r1 USE="-ipv6" 0 kB |
PS: if I pollute that thread, I could open a new one. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Thu Sep 19, 2013 11:26 am Post subject: |
|
|
IMHO the bug is not needed as it looks like a configuration parameter. Try setting wpa_supplicant_conf in dhcpcd.conf to the real path and see how it works. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
Posted: Thu Sep 19, 2013 11:38 am Post subject: |
|
|
it also works
For the moment, I write my hook to set-up some hostpot scripts and other stuff, and it seems to work.
EDIT: it works ! _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6068 Location: Removed by Neddy
|
Posted: Fri Sep 20, 2013 12:35 pm Post subject: |
|
|
one question. Why? _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8720 Location: ~Brussels - Belgique
|
Posted: Fri Sep 20, 2013 12:44 pm Post subject: |
|
|
Because I don't want to need nice GUIs, which are unnecessary to configure 2-3 networks. And so, I avoid unnecessary bullshit that change every 2 years (HAL, Systemd, *kit).
And I need to configure 2 things depending on the discovered network
- set DISTCC features at home, when the distcc server is up and running
- execute a logon script on hotspot used at work
Because KISS. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Fri Sep 20, 2013 1:59 pm Post subject: |
|
|
Naib wrote: | one question. Why? |
XavierMiller wrote: | Because I don't want to need nice GUIs, which are unnecessary to configure 2-3 networks. And so, I avoid unnecessary bullshit that change every 2 years (HAL, Systemd, *kit).
[...]
Because KISS. |
Ditto. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
Incomplet n00b
Joined: 12 Apr 2012 Posts: 43
|
Posted: Sat Mar 22, 2014 5:16 pm Post subject: |
|
|
dhcpcd is perhaps the most awesome piece of software that I've ever come across. It's awesome even if you don't configure it, and more awesome when you do. It's also the most reliable network manager that I have ever used, free or otherwise. The network manager on OSX would randomly stop working and if the network went screwy there was no chance of bringing it back without a restart (or two). On windows the manager does screwy things sometimes, and you never know what kind of garbage MS has in the pipe at any time. dhcpcd, on the other hand, has always "just worked" for me, no matter what (although the rest of my system is another story..). The wind will knock out all my powerlines and bring my machine down before dhcpcd will give me problems, and I can hardly blame it for not working then.
The mere fact that it's still being improved astounds me. If only gnome had that sort of accountability.. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
Incomplet n00b
Joined: 12 Apr 2012 Posts: 43
|
Posted: Sat Mar 22, 2014 9:26 pm Post subject: |
|
|
aand, now testing with no net.* scripts, and it looks to be working as advertised. At first I thought it hadn't worked, since with background and quiet I couldn't even see the entry in openrc. But no, fully automagical.
How on earth did you do that, anyway? Test driven development? Magic? (the only options I can come up with) |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Sat Mar 22, 2014 11:41 pm Post subject: |
|
|
Magic is not depending on the FOTM middleware. dhcpcd communicates only via libc and listens only via the kernel (ok, dhcpcd does have a udev plugin so that udev can do its pointless device naming). These channels of communication are defined by agreed standards, such as POSIX and in the case of Linux, netlink. But this is not magic, this is common sense.
From my Debian amd64 box
Code: |
roy@uberpc:~/src/dhcpcd$ size /sbin/dhcpcd /sbin/dhclient /usr/sbin/NetworkManager
text data bss dec hex filename
194982 1544 432 196958 3015e /sbin/dhcpcd
1620973 24576 45264 1690813 19ccbd /sbin/dhclient
1012178 22656 3016 1037850 fd61a /usr/sbin/NetworkManager
|
And that's not including any GUI components. Magic _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sun Mar 23, 2014 5:53 pm Post subject: |
|
|
Since my favourite Troll has been invited (hehe ) I'd just add onto the MS weirdness that I've always been amazed at why on Earth Microsoft decided to make interface precedence but *manual* (interfaces are sorted... alphabetically). We have the issue systematically at work when we receive pre-installed machines or when reinstalling them: wireless interfaces always take precedence over the wired interfaces and you have to manually reorder them, i.e. move the wired interface to the top of the list.
On Linux it is automatic. Besides, traffic automatically switches to the fastest interface when you plug the cable, no need to restart existing connections.
Magic sometimes relates to common sense. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
Incomplet n00b
Joined: 12 Apr 2012 Posts: 43
|
Posted: Sun Mar 23, 2014 9:22 pm Post subject: |
|
|
@RM: Yeah, I've noticed that upstream sucks. It's really sad if the rest of gnu/linux could be that good if only certain people weren't trying to play monopolyOS. It's also amazing in a way, given all the limitations of C.
@Vinz: *sigh* dhcpcd also automatically stops the wireless card/driver in that situation too, doesn't it? What is it people have against sensibility, anyway? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Sun Mar 23, 2014 9:41 pm Post subject: |
|
|
Incomplet wrote: | @Vinz: *sigh* dhcpcd also automatically stops the wireless card/driver in that situation too, doesn't it? What is it people have against sensibility, anyway? |
No, dhcpcd just changes the default route to go via wired.
If both are on the same subnet (which they really shouldn't be) then it will change the subnet route also on BSDs = on Linux there is no need thanks to routing metrics.
The only thing dhcpcd will stop is wpa_supplicant if the interface goes away. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
|