|
|
Subscribe / Log in / New account

Udev and systemd to merge

Udev and systemd to merge

Posted Apr 3, 2012 21:40 UTC (Tue) by russell (guest, #10458)
Parent article: Udev and systemd to merge

The lazy approach to interface design, do away with the interface, commit to nothing. What will systemd "interface" with next?


to post comments

Udev and systemd to merge

Posted Apr 3, 2012 22:31 UTC (Tue) by tpetazzoni (subscriber, #53127) [Link] (39 responses)

Next step is of course to integrate D-Bus in systemd, no?

Udev and systemd to merge

Posted Apr 3, 2012 22:41 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (33 responses)

I'm thinking that network handling is more likely.

Udev and systemd to merge

Posted Apr 3, 2012 23:07 UTC (Tue) by mezcalero (subscriber, #45103) [Link] (32 responses)

"Niemand hat die Absicht, eine Mauer zu errichten!" -- Walter Ulbricht

Udev and systemd to merge

Posted Apr 3, 2012 23:14 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (31 responses)

So we're getting networkd in two months? :)

BTW, I actually wouldn't mind if something cleaned up the mess that is /etc/network in Debian and /etc/sysconfig/network* in RHEL/CentOS.

Udev and systemd to merge

Posted Apr 4, 2012 9:06 UTC (Wed) by Aissen (subscriber, #59976) [Link] (30 responses)

The funny thing about Debian's mess: it relies heavily on ifplugd (although it isn't mandatory), which was written by… I'll let you guess ;-)
It works pretty well once you know how to configure it, and if your configuration isn't too dynamic.

BTW, NetworkManager should have been the one fixing this "mess" (not sure it really is a mess). Apparently it didn't work, otherwise some people wouldn't have written connman :-)

Udev and systemd to merge

Posted Apr 4, 2012 9:52 UTC (Wed) by hadess (subscriber, #24252) [Link]

> BTW, NetworkManager should have been the one fixing this "mess" (not sure
> it really is a mess). Apparently it didn't work, otherwise some people
> wouldn't have written connman :-)

Connman was written because somebody was allergic to NetworkManager's use of GObject. No other reasons that I know of.

Udev and systemd to merge

Posted Apr 4, 2012 10:22 UTC (Wed) by cortana (subscriber, #24596) [Link] (22 responses)

I think you mean ifupdown, not ifplugd.

NetworkManager is actually becoming pretty awesome. It's great to be able to e.g., quickly configure my laptop for "internet connection sharing" with just a few clicks.

For the foreseeable future, I'm sticking with ifupdown on my servers though. I'm not opposed to NM taking over there; the fact that it actually checks to see whether the configurations it enacts were successfully applies means that in theory it can be much more reliable than ifupdown, which just runs ip/dhclient, etc., without checking their exit statuses. It's just not as obvious how to configure it without a GUI (there's no man page for the per-connection configuration files in /etc, nor is there any obvious replacement for ifupdown's hook scripts).

Udev and systemd to merge

Posted Apr 4, 2012 10:52 UTC (Wed) by lindi (subscriber, #53135) [Link] (5 responses)

My largest problem with ifupdown is that it does not understand anything about multiple routing tables or firewalls. We just end up doing all network setup in ugly "post-up" calls.

Udev and systemd to merge

Posted Apr 4, 2012 13:46 UTC (Wed) by drag (guest, #31333) [Link] (4 responses)

I like network manager, personally, but I don't think it's going to offer much of a improvement over 'post-up' calls.

Generally what you'd want to do for network-manager is to put your scripts into /etc/NetworkManager/dispatcher.d in the typical "if [ "$2" = "up" ]; then" style format.

To get the best benefits out of NetworkManager you want to disable all the 'legacy' configuration plugins and use keyfile. That way you can edit all your network configurations using a 'ini' file format in /etc/NetworkManager/system-connections/

The advantage to this is that you can support a much more diverse amount of network connection types with better granularity then you can through traditional distro-specific configs.

The spec for the settings can be found..
http://projects.gnome.org/NetworkManager/developers/api/0...
http://live.gnome.org/NetworkManager

For managing it through the command line use 'nmcli'.

I wish Gnome would provide a better documentation and examples for people using network manager on a server, but oh well.

Udev and systemd to merge

Posted Apr 4, 2012 15:04 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

> The spec for the settings can be found..
> http://projects.gnome.org/NetworkManager/developers/api/0...

Thanks for that link. It really needs to be mentioned in the nmcli man pages.

Udev and systemd to merge

Posted Apr 4, 2012 17:59 UTC (Wed) by mgedmin (subscriber, #34497) [Link] (2 responses)

I've attempted to use nmcli to connect to a wireless network (WPA2 encryption) in the past and failed miserably. As far as I can tell, this is simply not supported (you can only connect to a connection you've configured before).

I can barely manage to figure out how to list available networks ('nmcli dev wifi', really?).

Udev and systemd to merge

Posted Apr 4, 2012 18:43 UTC (Wed) by tzafrir (subscriber, #11501) [Link] (1 responses)

That said, the full reference file is confusing without an example.

http://bugs.debian.org/637769

Last time I asked, I was told adding such a thing was not a good idea (which is why the bug report is not in the NM bugzilla).

Udev and systemd to merge

Posted Apr 4, 2012 18:52 UTC (Wed) by drag (guest, #31333) [Link]

It certainly seems like a good candidate for /usr/share/doc/*/examples item.

Udev and systemd to merge

Posted Apr 4, 2012 12:45 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

The problem is, Debian's /etc/network/interfaces is outdated. It doesn't have a good notion of dependencies, it can't really cope with interfaces having IPv4 and IPv6 addresses, bridge support is flaky and so on.

Most of my network configuration ends up in pre-up and post-down scripts.

Udev and systemd to merge

Posted Apr 4, 2012 23:16 UTC (Wed) by rleigh (guest, #14622) [Link]

Have you tried the new ifupdown in experimental? If not, it might be worth a try (but an updated version will be going into unstable in the next few days if you want to wait). This fixes a lot of long-standing issues.

Udev and systemd to merge

Posted Apr 4, 2012 15:01 UTC (Wed) by mathstuf (subscriber, #69389) [Link] (2 responses)

> NetworkManager is actually becoming pretty awesome. It's great to be able to e.g., quickly configure my laptop for "internet connection sharing" with just a few clicks.

Unfortunately, a feature[1] (though I consider it a bug) which is a blocker for me is still present.

Basically, I'd like to be able to set a wireless network as "flaky" so that if the connection drops, NM silently retries in the background continually instead of dropping the connection and *then* trying to reconnect. NM-aware applications tend to freak out if this happens every 5 minutes or so. Another use case is when moving around and one network is out of range temporarily in the presence of another known network (personal wireless, which is vastly preferred, versus campus wireless in my case). Going between floors takes me out of range of the my wireless, but the end points are both within range. I'd like to be able to tell NM that, but AFAIK, it will drop the connection, pick up the campus wireless and then not drop it when my wireless comes back into range because the campus connection is still there.

Of course, being able to create connections with nmcli would be nice too (unless it's a recent change, I haven't found out how to give it passwords and such for new wireless networks and instead have to launch nm-applet to create the connection which can then be managed with nmcli).

Currently, I just use ifcfg scripts for connections and wpa_supplicant.conf for wireless network configuration.

[1]There's a bug open somewhere for it, but I can't find it right now.

Udev and systemd to merge

Posted Apr 4, 2012 16:40 UTC (Wed) by drag (guest, #31333) [Link] (1 responses)

> Of course, being able to create connections with nmcli would be nice too (unless it's a recent change, I haven't found out how to give it passwords and such for new wireless networks and instead have to launch nm-applet to create the connection which can then be managed with nmcli).

You edit your own keyfile and then copy it to /etc/NetworkManager/system-connections/. NetworkManager watches that directory and should pick up on changes to configs automatically.

Although it's usually easier to use the nm-applet to make something so you have a config to work on when you want to make changes in the future.

Udev and systemd to merge

Posted Apr 4, 2012 16:46 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

Right, this is something I don't see why nmcli can't help with. A subcommand like "nmcli dump-config essid 'some_wireless_network'" to get a barebones keyfile which can then be edited should be possible.

Udev and systemd to merge

Posted Apr 5, 2012 16:49 UTC (Thu) by scientes (guest, #83068) [Link] (10 responses)

> It's great to be able to e.g., quickly configure my laptop for "internet connection sharing" with just a few clicks.

can i share over ethernet, as opposed to just wireless? If so, I guess I missed that functionality, I had alot of pain trying to do it myself while still having networkmanager work.

Udev and systemd to merge

Posted Apr 6, 2012 12:20 UTC (Fri) by cortana (subscriber, #24596) [Link] (8 responses)

I don't think NM cares about the kinds of each connection involved in sharing. One quirk that I never bothered to raise upstream was that you're not supposed to set the mode of the *upstream* connection to 'shared to other computers'; you're supposed to set the mode of the *local* connection. Perhaps NM sets up some iptables rules so that only packets from local interface marked as 'shared to other computers' will be routed out of the upstream interface... I didn't bother to look into it once I made it work. :)

Udev and systemd to merge

Posted Apr 6, 2012 14:39 UTC (Fri) by Eckhart (guest, #74500) [Link]

The way NetworkManager works is actually pretty simple. Unless a connection is marked "Shared", it is considered a potential upstream connection. Of all the upstream connections, the best one is marked the default gateway, with simple ordering (i.e. vpn wins over cable, cable wins over wireless…).
A connection marked as shared will get a DHCP server and uses NAT to route traffic over the default gateway. Therefore it is perfectly possible to share your 3g connection via ethernet to a bunch of computers.

Udev and systemd to merge

Posted Apr 6, 2012 19:44 UTC (Fri) by scientes (guest, #83068) [Link] (6 responses)

> One quirk that I never bothered to raise upstream was that you're not supposed to set the mode of the *upstream* connection to 'shared to other computers'; you're supposed to set the mode of the *local* connection.

as someone that has basic understanding of the networking, and has done this manually, this makes perfect sense, the other way you talk of is confusing, and would be way less capable.

If it wasn't for ipv4 exhaustion, sharing your internet connection could as simple as turning on ipv4 packet forwarding. (now there is also address allocation issues, so DHCP) the complexity, and ever difference between upstream, and downstream, somes from Network Address Translation.

Udev and systemd to merge

Posted Apr 6, 2012 20:02 UTC (Fri) by cortana (subscriber, #24596) [Link] (5 responses)

I find it confusing to have to set the mode of the downstream interface to 'share with other computers'. It's my internet connection I want to share, so I naturally expect to set its interface, the upstream one, to 'share with other computers'; the upstream connection is what I'm sharing, and is therefore be the object in the sentence "Share my internet connection with other computers".

Udev and systemd to merge

Posted Apr 6, 2012 20:23 UTC (Fri) by scientes (guest, #83068) [Link] (1 responses)

thats only because you are considering yourself a slave to your Internet connection, and a slave to the Internet. The way it works, it will share any connections you have, even if you dual-banding with the neighbor that has a differn't ISP so that you don't have to worry about censorship, are to evade network neutrality violations.

sure maybe the language needs to be made clearer, "share Internet to this interface?"

Udev and systemd to merge

Posted Apr 6, 2012 20:37 UTC (Fri) by cortana (subscriber, #24596) [Link]

That language change would definitely be a lot better.

Udev and systemd to merge

Posted Apr 6, 2012 20:39 UTC (Fri) by khim (subscriber, #9252) [Link] (2 responses)

It's my internet connection I want to share, so I naturally expect to set its interface, the upstream one, to 'share with other computers'; the upstream connection is what I'm sharing, and is therefore be the object in the sentence "Share my internet connection with other computers".

Well, it'll be nice psychology study which will show just why Joe Average gets the facts backward, but this logic is obviously quite strange.

Let's forget about network, routing, packets, etc. Suppose my neighbour lost electrical power and I, ever the helpful guy, want to share my grid power connection with him (electrical grid, not Internet).

Now, I have two choice:
1. I can go find out where and how my own house itself is connected to grid and try to change that global connection. I can even succeed and survive (if I'm lucky).
  or
2. I can change my local connection configuration: just plug extension cord to my wall socket and attach appliances of my neighbour to it.

Somehow when electrical grid is concerned everyone automatically assumes solution #2 is right, but for Internet they want go and try to change WAN#1 (their WAN connection)? WHY? What's so special about Internet?

P.S. This phenomenon is quite obviously present because Microsoft tries to “help” here. It ALSO makes no sense to change WAN configuration when you share it even in Windows, but hey, if people en masse want to do this strange thing then this is how it should be done. As a result when you share network connection you must “alter” WAN connection, but this is illusion. When you try to “share” WAN connection in Windows WAN connection is not changed at all. Instead Windows goes and silently changes LAN connection behind your back.

The end result is essentially the same as with Linux, but with a twist: in simple cases everything “just works”, but in complex cases you must imagine these behind the scenes changes and do complex dance (Ok, I need to change this network in this and that way, but this is impossible to do so I need to create fictive temporary network and change THIS, then I can delete it because it's unneeded and I can fix THAT and but this well mean that networks will be disconnected but this can be fixed later…) I hate that.

Udev and systemd to merge

Posted Apr 6, 2012 20:54 UTC (Fri) by scientes (guest, #83068) [Link] (1 responses)

#1. the entire concept of LAN vs. WAN only propagates this confusion

#2. The Linux way of electricity networking does exist in your 2nd electrical example, its called a Widow-maker or other similarly ominous names. (for good reason)

Udev and systemd to merge

Posted Apr 6, 2012 21:25 UTC (Fri) by khim (subscriber, #9252) [Link]

The Linux way of electricity networking does exist in your 2nd electrical example, its called a Widow-maker or other similarly ominous names. (for good reason)

s/Linux/Windows/

Widow-maker is used to attach to the upstream, to “WAN” power grid (this is what you “naturally expect” for some reason). This is Windows way.

In Linux you share your wall outlets (you local in-house “LAN” electric network) instead.

the entire concept of LAN vs. WAN only propagates this confusion

Why? WAN == WIDE area network (think city-level or even wider electrical network), LAN == LOCAL area network (think you own tiny in-house network with dozen or two plugs and few appliances). If you want to share electricity with someone you most definitely will do it using your local network (unless you have some serious reasons to use thing which is called Widow-maker or other similarly ominous names).

Udev and systemd to merge

Posted Apr 6, 2012 14:32 UTC (Fri) by Eckhart (guest, #74500) [Link]

> can i share over ethernet, as opposed to just wireless? If so, I guess I missed that functionality, I had alot of pain trying to do it myself while still having networkmanager work.

This is perfectly possible with NetworkManager. Just create a wired connection, set method to Shared, and NetworkManager will start a DHCP server on your wired connection.

Udev and systemd to merge

Posted Apr 4, 2012 15:28 UTC (Wed) by jond (subscriber, #37669) [Link] (4 responses)

> The funny thing about Debian's mess: it relies heavily on ifplugd (although it isn't mandatory), which was written by… I'll let you guess ;-)

Indeed, "it's entirely optional" would be closer to the truth.

Udev and systemd to merge

Posted Apr 4, 2012 16:05 UTC (Wed) by Aissen (subscriber, #59976) [Link] (3 responses)

Most things in Debian are optional, that's the beauty of the thing (and sometimes, the hassle, see the systemd "full integration" drama).
Also, previous commenter pointed out that I mixed ifplugd and ifupdown. He was right.

Udev and systemd to merge

Posted Apr 6, 2012 14:49 UTC (Fri) by Eckhart (guest, #74500) [Link] (2 responses)

>Most things in Debian are optional, that's the beauty of the thing (and sometimes, the hassle, see the systemd "full integration" drama).

Can you please explain the systemd "full integration" "drama"?
(both "full integration" and "drama")

Udev and systemd to merge

Posted Apr 6, 2012 15:26 UTC (Fri) by Aissen (subscriber, #59976) [Link] (1 responses)

See:
https://lwn.net/Articles/452865/
and more recently:
https://lwn.net/Articles/484168/

I said "full integration" because systemd is already in debian (http://packages.qa.debian.org/s/systemd.html ), it's just not the default init. So it's integrated, but not fully since not all daemons have systemd unit files.

Udev and systemd to merge

Posted Apr 6, 2012 16:53 UTC (Fri) by Eckhart (guest, #74500) [Link]

Ah, then I just misinterpreted your original sentence. Thanks.

Udev and systemd to merge

Posted Apr 4, 2012 21:23 UTC (Wed) by iabervon (subscriber, #722) [Link]

I'd guess it was actually the assumption that GNOME couldn't possibly get a system daemon right. Nobody wants to repeat the situation we had when every desktop environment had its own sound daemon that interfered with sound from programs that didn't use it. Of course, that's not actually the case, but having a generic component come from a desktop environment project gives people the wrong impression.

Second system effect?

Posted Apr 4, 2012 0:33 UTC (Wed) by Pc5Y9sbv (guest, #41328) [Link]

It knows when you are sleeping, it knows when you're awake, it knows when you've had disks attached, and it hashes logs for safety's sake... it's santad.

But seriously, maybe we really need a higher level set of event and process control abstractions from the kernel, rather than building some weird monolithic macro-micro-kernel architecture (kitchensinkd on top of Linux kernel)?

Udev and systemd to merge

Posted Apr 4, 2012 4:45 UTC (Wed) by iabervon (subscriber, #722) [Link] (2 responses)

Actually, that makes a surprising amount of sense. Surely, when you cause dbus to start upowerd on demand, upowerd should be possible to manage through systemd like any other daemon, right? I mean, it's not like it's part of dbus, despite dbus launching it. Sure, it's reasonable for dbus to handle demand-execution of services when your init isn't capable of that, but having dbus be a second process launcher when you've already got one is redundant and just makes management harder.

Udev and systemd to merge

Posted Apr 4, 2012 8:24 UTC (Wed) by nowster (subscriber, #67) [Link]

What is a process launcher? Should all fork()/exec() operations be done by message passing in the future?

Udev and systemd to merge

Posted Apr 4, 2012 12:28 UTC (Wed) by njs (subscriber, #40338) [Link]

Yes, which is why D-Bus now has the option of implementing bus activations by having systemd spawn the relevant service...

Udev and systemd to merge

Posted Apr 4, 2012 15:27 UTC (Wed) by jond (subscriber, #37669) [Link]

The D-Bus guys have been trying to push a lot of that into the Kernel (no, really)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds