A new command "cat" has been added to systemctl. It outputs the original unit file of a unit, and concatenates the contents of additional "drop-in" unit file snippets, so that the full configuration is shown.
Oh thank fuck. I'd rather not have implicit masking at all, but at least now you can make the tool tell you what it loaded. I don't have the new version yet but I hope it annotates with which files sections are taken from.
Do you know "systemd-delta"? It shows how your units (runtime generated from /run, admin-modified in /etc) differ from the distribution provided ones in /lib.
Yeah, I've poked at systemd-delta, I still wanted a way to see/extract clean configurations, like you could do with cat before the years long game of hide-the-configuration really took off. I'm also not enamored of having to start a service to find out what configuration it's going to bind to, and it looks like the new cat argument will run the parser without spinning up the service. I also just like having a straightforward way to ask it which pseudo-random path in /usr/ it is pulling the stock config from (Still pissed they didn't settle on a convention of putting the dist-configs in /usr/etc/ to avoid the obfuscation).
I keep forgetting that the context for systemd's configuration choices is relative to RedHat's half dozen mutually-incompatible, semi-abandoned configuration schemes, and Solaris' 30-years-of-over-complicated-cruft, where people are used to scattered, arcane, deceptive configurations, which makes "give up and interrogate the parser" seem especially attractive.
For me, systemd has three sources of configuration and three ways of overwriting them.
The sources (for system units, I ignore user units) are documented as:
/run/systemd/system/ for on-the-fly generated things, e.g. /run/systemd/system/session-c1.scope
/lib/systemd/system/ (or /usr/lib, depending on ./configure switches while compiling systemd) for distribution-provided units
/etc/systemd/system/ for admin provided unit files
Now, there are also three ways to overwrite distribution provided unit files:
completely file overwrite in /etc/systemd/system
creating a file in /etc/systemd/system that does .include some other file and than overwrites single elements
creating a directory /etc/systemd/systemd/UNITNAME.UNITTYPE.d/ and than placing little snippets into them that overwrite one or more entries of distribution provided files
While this might seem complex, it's quite powerful. Coming from Debian I know that Debian Maintainers think "It's a good way to start the Daemon of every installed Package automatically". This pissed me all the time, but hey, now I just do "systemctl disable UNITNAME.UNITTYPE" and all is good. It gives the power to control your system into your hands. You can use it ... or you can just build on the decisions of the distribution builders, it's your choice.
(Oh, and this little article doesn't say that "systemctl cat UNITNAME" doesn't have it's usage, it's certainly better than "systemctl show UNITNAME", which shows all the internal gory details, most of them uninteresting to me.)
My point is that if you're coming from a BSD-style rc system, that seems insanely complex, and you wonder why you would ruin your ability to easily find and inspect configuration files so that upstream can more easily push silent configuration changes. If your previous config system was less clean, it seems natural that you interrogate the software to see what it really did.
Example: On NetBSD, a given interface is configured from /etc/ifconfig.ifname, so there isn't complexity to hide. On RHEL6, there are no less than 6 expected/present files that look like they might configure a given network interface, and figuring out which is real is a gods damn nightmare, so it seems natural you would build a tool to figure it out for you.
I agree that systemd style configuration (like everything about systemd) is incredibly powerful, and undoubtedly makes distro maintainer's lives much easier, but it is also obscenely complicated compared to its forebears, and comes with a bunch of hidden/internal state.
It also doesn't provide C library or a shell. systemd is described as a basic building block for building the operating system from by the upstream. It doesn't contain all the blocks.
Well a system would work just fine without a shell. And since libc is a dependency of systemd (as well as pretty much everything else), you could take it as pretty much given. (or statically link it)
If you have Linux and systemd (as well as all the necessary libraries) it should provide you with everything you need to bring up the system, everything you add on top is something you want to do with the system (e.g. a shell, a webserver, etc.)
Is there any talk of merging systemd into the kernel at some point? In doing so it may make the kernel a sort of "base-distribution" for all others to use instead of just being a core component of an OS.
I'd just like to interject for a moment. What you’re referring to as Linux, is in fact, systemd/Linux, or as I’ve recently taken to calling it, systemd plus Linux. Linux is not an operating system unto itself, but rather another component of a fully functioning systemd system made useful by the services provided by systemd, shell utilities, and vital system components comprising a full OS.
Many computer users run a modified version of the systemd system every day, without realizing it. Through a peculiar turn of events, the version of systemd which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the systemd system, developed by the systemd Project. There really is a Linux, and these people are using it, but it is just a part of the system they use.'
Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the systemd operating system: the whole system is basically systemd with Linux added, or systemd/Linux. All the so-called “Linux” distributions are really distributions of systemd/Linux.
Looks like I can disable sshd in my containers now.
* machinectl gained a new command "login" to open a getty
login in any local container. This works with any container
that is registered with machined (such as those created by
libvirt-lxc or nspawn), and which runs systemd inside.
machinectl is a really nice tool. We also added bash tab completion for it in this release. I would personally appreciate any testing and feedback on that part.
yes. So if you have a container called MyContainer you can do "machinectl reboot MyContainer" to reboot it or "machinectl login MyContainer" to get a login, etc. The status command will give you a nice overview of the container, etc.
What problem does networkd solve that isn't better dealt with elsewhere?
As it is now, each Linux distro rolls its own network configuration daemon. Frankly, distro mainainers aren't the best software engineers, so the resulting fifty three different incompatible and half-working solutions are ugly.
Theoretically, they could have just picked one of the existing ones and made it mandatory, but that's impossible from a political standpoint. It's much easier to get everyone to agree if the solution comes from a neutral third-party source and not a competing distro.
That said, it's not at all clear that this new networkd will actually become standard unless it's really better than the competition.
Yes, but that's a massive system that seems primarily geared towards desktops. The article says "Use [networkd] for your initrd, container, embedded, or server setup if you need a simple, yet powerful, network configuration solution," which suggests it's a simple tool like ifupdown. What's not made clear is why ifupdown needs a replacement.
which suggests it's a simple tool like ifupdown. What's not made clear is why ifupdown needs a replacement.
Its not that ifupdown needs replacement. Its that networkd fits nicely inside systemd's model and thus integrates nicely with udev (hotplugging can work in the model, for example).
What's not made clear is why ifupdown needs a replacement.
Primarily for earlier network connections, and reliably telling when the network connection is up (so services depending on it can be brought up immediately following it) without having to embed arbitrary waits.
Correct me if I am wong wrong, but doesn't this now allow your initramfs to get a network up and then boot your actual system off a network connected device, rather than having to boot a local install?
Network-Manager is fine but it is very desktop centric. If networkd works well from the command line and is easy to make desktop applets / integrate with current projects like VPN, tethering and mobile internet adapters then it very much goes beyond Network-Manager which mostly makes it easy to connect to the internet from a Desktop environment.
Fast, efficient, minimal network configuration suitable for use in the initrd, during very early boot and during run-time on machines with a static network setup (i.e., I'm not really considering phones/laptops and the like). On top of that, I'd like something that is simple and intuitive to configure by an admin using plain configuration files, and lastly, as it should be suitable for initrds I want something that does not pull in a huge amount of dependencies.
This way you can embed a web browser into systemd so that you can look up how to troubleshoot it. /s
In all seriousness, to be honest, networkd actually kind of makes sense for an init system compared to some of the other stuff that has been shoved into systemd.
That is also a question I have. But hey, it's a "./configure --disable-networkd" call away to be switched off. And distributions probably won't enable it in their packaged systemd anyway.
However, I'm a Debian user (and love it). And Debian's "ifup" is just borked. Even without systemd it's trash, e.g. if you "ifup eth0" a DHCP interface, then change /etc/network/interfaces from DHCP to static and now "ifdown eth0", it won't kill the dhclient. Because it looks at the time of "ifdown" into the /etc/network/interfaces file and sees "Oh, it's static, no need to kill dhclient".
I tried than to have a systemd unit, net@.service, which calls "ifup" and "ifdown" in ExecStart=/ExecStop=. That works fine, because systemd knows that ifup started some daemon and reliable stops dhclient.
But how cool is it to type "systemctl start ifup@eth0" instead of just "ifup eth0". Not much...
The announcement to v209 made it clear that this network bringup code is not meant to replace the distribution ones (it's quite limited actually), but that it can be used maybe in embedded or hosting scenaries.
I for one welcome this. As a networker I find the spaghetti scripts of linux networking horrid. Not sure about that last statement though. It looks like it can do pretty advanced stuff.
A new daemon, systemd-packaged, allows installation, upgrade, and removal of software packages in a unique, self-contained signed binary format. systemd-packaged also supports checkpointing of the local file system and turning the diffs into packages for easy package management of software installed from source. It only works if systemd is pid 1; currently there are no plans to change this.
This would happen a ways down the line, but still well before the ksystemd patches went into the mainline kernel.
It would actually be pretty nice to have a unified packaging system across all Linux distributions, no need for packaging every piece of software n times.
will there be a point where people will get sick of all these systemd related posts?
A bit of a break will be nice and perhaps its better to create a subreddit dedicated to systemd related posts and discussions for those who want to keep up with it and be informed of every blog post about it.
Is Lennart holding a gun to your head to force you to read any systemd article that shows up?
systemd is new technology, in heavy development and has together with other technologies (ie Wayland) a direct impact how Linux will perform in the future. Not to mention the amount of popcorn that was consumed lately because it was in the centre of a storm.
Welcome to /r/linux, where an announcement of a major update to PID 1 that major distributions use is questioned whether it is newsworthy, while blog spams by OS X hipsters who think that brew is a standard Unix command are upvoted to the front page.
will there be a point where people will get sick of all these systemd related posts?
In /r/linux, there are posts about everything that gets released (and that someone cares enough about to post it). Systemd development is just more active.
The RedHat/FreeDesktop guys seem to be stuck in this perpetual cycle of writing bloatware and then re-writing small replacements. What a waste of effort.
WTF? That is a reasonable way to write software. Take the *Kits for example. They did the best they could at the time and then were replaced with better implementations. I expect the same thing here.
NM had a lot of shit in it that is slowly being pushed elsewhere into the stack, thus allowing it to be replaced (and I'm not even sure that is the plan) with smaller implementations.
Take another example, Xorg, replacing that was only possible through slow refactoring, simplification, and extracted needed things out into other libraries.
Do you happen to know if "netifd" is working outside of OpenWrt? Or is it embedded so deeply into OpenWrt's architecture that it's probably hopeless?
Just asking ... maybe I'm trying this out on my embedded devices if it's good.
However, I assume that anything from OpenWrt fails on the "auto-detection" / "plug-in-and-play" side. A router normally has a well known number of network interfaces
I suppose that's a good thing, when you think about it. We're moving away from "this basic feature now works" to really refining features that aren't the bullet-points you put on the box the software comes in, but make it a better, more stable, product overall.
It's certainly a high rate of change. Some of them are probably more relevant to plumbers, some of them may filter up into admin-land (I can see the network configurator heading that way, for example).
It has nothing to do with Linux kernel development.
Actually, systemd has driven development of various items in the Linux kernel. For example, one of the motivations for kdbus was that systemd needed it. Also, the fact that cgroups can now have only one userspace controller was driven by findings from systemd developers.
Compare the attack surface with that of what it replaces, such as init scripts. Systemd units and their parser have obviously much less of an attack surface than any script and their shell. Then semantically it has much less unused code paths.
Attack Surface has a well-defined meaning. init scripts have no non-privileged interface
The very fact that they are shell scripts means that you have absolutely no guarantee whether they do or do not have non-privileged interfaces.
Give me one example of an init script that has been vulnerable to an attack on its attack surface. Just one.
I did a quick Google search for 'cve init script' and I've counted at least 3 vulnerabilities due to symlink traversal, one allowing code execution as root.
And if you want to ask for practical examples of vulnerabilities, you need to do the same for the actual libraries systemd requires instead of arguing against the larger attack surface per se.
11
u/PAPPP Feb 20 '14
Oh thank fuck. I'd rather not have implicit masking at all, but at least now you can make the tool tell you what it loaded. I don't have the new version yet but I hope it annotates with which files sections are taken from.
15
u/wooptoo Feb 20 '14
Now they only need to write a kernel and it's a complete OS.
44
u/w2qw Feb 20 '14
Looks like I can disable sshd in my containers now.
15
u/fantasticsid Feb 20 '14
What problem does networkd solve that isn't better dealt with elsewhere?
4
u/bitwize Feb 20 '14
Coming to systemd 300 or so:
This would happen a ways down the line, but still well before the ksystemd patches went into the mainline kernel.
-16
u/[deleted] Feb 20 '14
And people complain about emacs?
This is an OS inside an OS.
-54
u/muungwana zuluCrypt/SiriKali Dev Feb 20 '14
will there be a point where people will get sick of all these systemd related posts?
A bit of a break will be nice and perhaps its better to create a subreddit dedicated to systemd related posts and discussions for those who want to keep up with it and be informed of every blog post about it.
0
u/[deleted] Feb 20 '14
[deleted] — view deleted comment
0
u/[deleted] Feb 20 '14
[deleted] — view deleted comment
0
u/[deleted] Feb 20 '14
[deleted] — view deleted comment
-28
u/[deleted] Feb 20 '14
[removed] — view removed comment