It's not quite that simple. People actually tried to update net-tools ifconfig (one of the two ifconfigs back in 2018).
In 2019, I simply wrote an ifconfig that uses the netlink API, because for portability I needed a Linux ifconfig that had a FreeBSD-like command-line syntax. It doesn't have the old interface aliasing mentioned in the headlined article, and has no problems setting up and reporting IPv6 addresses or additional IPv4 addresses.
I have a system to convert Debian /etc/network/interfaces into a BSD-style rc.conf, which then in turn gets converted into a suite of native service bundles. One of the service bundles is ifconfig@interface , which invokes ifconfig with a uniform command-line syntax across Linux and FreeBSD, hence the need for a more FreeBSD-alike ifconfig on Linux.
Another off-topic question (using this forum as your author page is quite discouraging about sending you emails ....)
What's the reason for naming cyclog files with the time they were closed? (other than that's how djb did it?), since this information is available easily with 'ls -l'?
I use a logger that opens a $CREATE_TIMESTAMP.u file, and makes "current" a symbolic link to it; and on close renames it to ".s", which I find more intuitive and informative (also provides time between log creation and first message, which is unavailable with cyclog). I was considering changing the ".u"/".s" marking to be an attribute (-w or +i or +t to signify "safely closed") to help repeated rsyncs of log directories, but haven't done that yet.
I'm sure there's some useful aspect of existing cyclog/multilog behaviour that I'm missing, but I haven't been able to figure what it is for the last 10 years ...
If you want more than just my perspective, look to Laurent Bercot's Supervision Mailing list. M. Bercot is of course there, as well as a few other people.
As for the filenames, yes the original reason was for compatibility with multilog, and of course all of the other tools that can process these log directories. I did set out, after all, to produce a cyclog workalike, with lessons from multilog incorporated. Note that said tools might not deal well with log directories where the same log file is available via two names, both "current" and something else.
Moreover, if you go and look at follow-log-directories you can see an additional benefit that it very efficiently skips its cursors over old files without having to look at their i-nodes because it knows that the filename is guaranteed to be a timestamp at or after the last log entry in the file.
Furthermore, if you go and read the cyclog manual, you'll find out why using the w permission bit had problems. (-:
Off-topic: I can't help but be nosy and check the https version of your page. You seem to be serving a cert with CN=albertstreetantiquescentre.co.uk. Might want to get this looked at :)
So, firstly don't put a dot at the end. Whatever you might feel about it, the decision in practice was that the host part of the URL is an FQDN but doesn't need a dot at the end. So don't write one there. The browser should probably trim it out when you type in or follow such a link.
The Apache web server that the bulk host is using for that site has a fairly poor implementation of HTTPS. It's unsatisfactory in various ways, some very technical, but what you're seeing here is the weird way it handles SNI.
By default when you say you want jdebp.uk. and there is no such virtual host (there's only jdebp.uk with no trailing dot) Apache will pick a default virtual host and act as though you asked for that, sending over the certificate for that host and so on. In this case, at a bulk hosting site, it's some unrelated Antiques Shop outfit, likely because that begins with 'A' which is the first letter of the alphabet.
This actually caused a problem for Let's Encrypt because their tls-sni-01 challenge type assumed nobody would be crazy enough to answer queries for a random name with a certificate chosen by somebody else entirely. But that's exactly what Apache is doing here. The current tls-alpn-01 challenge was introduced to fix that - it asks for a reserved ALPN service instead of a spurious SNI server name.
It seems that the server running on the other end doesn't properly match the certificate from the SNI if the domain sent by the browser is a FQDN (i.e. ends in a .)
That's the page on a shared hosting service, not served by me. See the site history page (still in the same place that it was a couple of years ago when it came up on Hacker News).
This might be the first time in quite a few years that I've seen people using a dot like that. Any reasons to do so? I figured most people do not have weird DNS search domains or some such to warrant that dot.
This is highly biased opinion piece. I like BSD. I liked pre-Oracle Solaris. And I like Linux at lot too.
And it is factually inaccurate. Deprecation of ifconfig is a distro issue. "Linux" did not deprecate it. And the reason is that it was unmaintained, not that it couldn't handle multiple IP addresses. In fact it can, I still use it 50% of the time. Works fine for setting and displaying multiple addresses.
The Debian maintainers wanted to drop it, and the other distros all followed suit a couple years later. Good information and links here:
"Linux maintains known bugs – and actively refuses to fix them. In fact, if you attempt to fix them, Linus will curse at you, as manifest by this email."
That is a bold statement but is not at all supported by the linked email. You'll see Linus cursing at a bad patch that would break something in userland, not for "maintaining a bug". He's preventing at least two bugs (unnecessary change to behavior and ENOENT is indeed the wrong return value). I think I liked the old Linus better...
So it's a shame. I'd love to read a series about BSD, but this is really just inaccurate propaganda.
If you follow the email thread through to the end, nobody was trying to intentionally break userspace. An internal error code was being leaked to userspace accidentally. That was the bug. The original patch was actually fixing a different issue, where some V4L2 devices were returning the wrong error codes! So userspace was already seeing an inconsistent API.
I don't like this email thread, because some people are clearly trying to carefully find the breakage and fix it, but Linus yelling at people is all that people ever see from it. So the conversation changes from fixing a bug to insults and anger.
> And the reason is that it was unmaintained, not that it couldn't handle multiple IP addresses.
Unmaintained sounds like a very good reason to me. It's not just whether there is 1 or 2 addresses per interface. The rot set in when Alexy re-did the Linux kernels network infrastructure back god knows when (its decades ago now), and wrote his own user space tool to configure it. That tool was ip. It not only handled multi ip addresses per interface - it handled multiple routing tables, multiple link types, routing rules and a whole pile of other things. And that single tool has been growing ever since - it's now huge. Type typing "man ip-<tab><tab>" on a cli that supports tab completion some time.
Effectively the task of keeping up with the kernel's new features kept growing and at some point the ifconfig maintainers gave up. It was all over bar the shouting at the point. The only surprising thing is the shouting has gone on for literally decades, and as this article demonstrates continues to this day. Lets hope the same angst over systemd doesn't continue for the same amount of time.
Just like like systemd there are things that rub me the wrong way of course. Coping the Cisco IOS style of command line usage rather than using the Linux style is for me one of those things. But it happened for a reason - Alexy set the standard when he wrote the first version of ip, and he was trying to emulate the features provided by a Cisco router at the time.
That's a great theory, but Linus picks and chooses when to decide it's outrageous to make changes that break userland tools based on his personal preferences. They intentionally broke ZFS - then Linus follows up with a wildly inaccurate statement about why he thinks nobody should use ZFS.
It's difficult to take him seriously when he picks and chooses when to enforce his supposed "never break userland" ethos.
Did you read his mail though? He literally answers this criticism. ZFS is not userland so kernel developers are free to break it, just like they can break ext4 and do, and then they fix them. The problem with ZFS is that they can't fix it because it's not part of linux. It's a 3rd party kernel module. So your entire comment reads like a misunderstanding of the situation.
ZFS is not user land. It's kernel code but without being in the kernel. So it has to be built separately and may not even be compliant with GPL (still has to be tested in court AFAIK). Linux's promise to not break userspace is just that, It can not be held responsible for code that should be in the kernel but does not play fair with the license.
For a scary few days he was considering completely breaking the ABI of getrandom(2). If he decides to break interfaces, I don't know that anyone can stop him. It is a downside to the BDFL model.
Edit: Breaking ZFS is not a great example — as sibling comment points out, that is a kernel module using kernel-internal APIs, not userspace syscall ABI. The Linux kernel notoriously considers all kernel interfaces unstable. GregKH has in the past characterized this as a feature, not a bug.
There's an assumption which this article makes which is not true; namely, that the only utilities which do (or should) use ioctl's are system programs like ipconfig which are shipped with the kernel. There are other programs, like for example Kerberos, who want to know what network addresses are used by the network, and requiring them to screen scrape ipconfig is not especially reasonable. So if you randomly change ioctls, then you randomly break other programs that might not be shipped with the kernel that need to use those ioctls. Maintaining proper backwards compatibility for userspace applications, and not labelling some set of interfaces as "can randomly change, and if you use them and you're aren't part of the privileged set of programs shipped with the kernel, well, it just sucks to be you", is not, in my opinion a professional way to run an OS.
Yes! He also mentions that NetBSD and OpenBSD have "kernel interface itself is highly stable anyways" but doesn't elaborate on how that's different from Linux's interface stability.
The argument doesn't hang together. He can't claim that changes to userland tools aren't possible whilst at the same time claiming it's because the existing interfaces never change.
It seems like for many userspace applications, the appropriate backwards compatibility ABI would have been at the SO level. ELF shlibs make it easy to version interfaces without breaking old dynamically linked programs. Linux is sort of the odd duck in that it considers the entire syscall surface a stable ABI. It leads to a lot of neat results, but can obviously also cause pain when some older interfaces are not sufficient.
That said — new ioctls could be added and new ifconfig could use those? Old ifconfig and user programs could continue using the old ABIs.
I would argue that the stable syscall interfaces is one of the main drivers behind Linux success. Containers as we know them would be quite different if they needed to somehow merge the kernel version appropriate .so files into the fs. They would forever remain just sandboxes of the essentially the same distro as the host just like they are on Solaris/FreeBSD.
But, for finding interfaces and read about their state and settings, aren't /proc and /sys the best way to go, if there is no worry about toctou? I was answered yesterday on another topic that /proc is a linuxism, but is there anything missing there ?
There's no reason why someone can't get their act together and fix ifconfig, or if that is insurmountable, rewrite it while maintaining the same outward appearances.
I think this is not specific to Linux at all, and is not really about kernel ABI. This is a problem I see a lot, often in proprietary software too. Firstly, people opt to rewrite before they fix or even before they fully understand the old thing. Secondly, people confuse interface with implementation, and often don't bother trying to make their rewrites interoperable with the old thing.
Another example of that last one, in Linux from the late 90s, is ALSA. FreeBSD for example chose to fix the problems and maintain the old OSS API for audio devices. Linux introduced a very complicated new API.
[By the way, I spotted one sort of technical error in the article. I don't think most software keeps private copies of kernel data structures in their source tree. Rather, when they #include the kernel headers, they end up using an effectively-private version of those structures and constants in their object code. This is slightly different but a similar result.]
> There's no reason why someone can't get their act together and fix ifconfig, or if that is insurmountable, rewrite it while maintaining the same outward appearances.
But it's telling that nobody stepped up and actually bothered to do that despite all the bitching and moaning.
Successful code is generally produced to solve problems, not fullfil some abstract ideals
But with the Linux ecosystem's inertia being what it is, rather than the 2 existing implementations of ifconfig in use being displaced by this better one... now there are just 3 implementations of ifconfig in use.
As mentioned in the Stack Exchange thread linked in that post, a different someone submitted a relevant patch to one of those existing implementations – way back in 2013. But it was never accepted. More inertia.
Software using obscure kernel interfaces does keep private copies of kernel data structures.
The reason is that people want the software to have full functionality no matter what system is used for building it. You can build on an old system, with a kernel that totally lacks the functionality, and produce a binary that can use the new kernel interfaces when run on a system that has them.
Glibc certainly does this, I would expect for limited periods per interface. It is often at the cutting edge of kernel interfaces, so that becomes necessary during interim periods. I really doubt it makes sense for old and stable things like ifconfig, or a tipical application.
> or even before they fully understand the old thing.
I feel that /sbin/ip is in almost every way a better tool than /sbin/ifconfig, is that not the concensus?
> Linux introduced a very complicated new API.
Which highlights the fact that the moment you want to have in-depth interactions with a driver for a piece of hardware ioctls are the wrong choice.
OSS was great if you had exceptionally simple needs.. the moment you want to do "professional" audio it was a nightmare. ALSA is _somewhat_ better for this, and I honestly wish they went with a more netlink(3) style API instead of an IOCTL driven one.
What's the point of pantomiming the old thing when the old thing wasn't designed properly in the first place?
2) default format. Far better spaced than “ip”’s various outputs. I find “ip -o a” just about manageable, but if config shows data far more cleanly imo
I really do not like the default UI in ip. You have to remember a lot of weird stuff to get useful information. The default listing is compressed, hard to read, and noisy. Then I saw someone who had these aliases:
alias ipa 'ip -br -color a'
alias ipl 'ip -br -color link'
Night and day! I try to not use the aliases because I'm often on servers without them, but the options for brief and color with the command to list adapters or links at the end it one all sys admins should memorize. It returns output that isn't terrible.
According to the manpage, -color can be shortened to -c and link shortened to `l`, as `addr` can be shortened to `a`. -br stands for -brief, which knowing makes it easier to remember.
> The only to prevent this would be to conduct regular massively coordinated updates to system utilities when the kernel changes, and properly version applications for specific kernel releases.
Well, no. What you do is create a new struct with correct behavior and let new applications use that. The old struct becomes deprecated but continues to exist until things stop using it. Which may be indefinitely, but that's not really a lot more work than maintaining a compatibility library to serve the same purpose.
The thing with ip vs. ifconfig was more to do with there being somebody interested in creating ip and nobody interested in maintaining ifconfig. If you want to go add support for multiple addresses on the same interface to ifconfig, nobody is stopping you -- in fact that has already happened now.
I've been actively working on firmware that is now over ten years old. My advice tends to be if you have an api that takes a pointer to a structure you should have a version field from the get go.
Indeed, ip is vastly superior. But it took me almost a year of working with internet gateways (i.e as a day job) to let old habits die. Learning the new output format takes time.
I've almost replaced route with "ip route" as well. arp isn't fully replaced yet in muscle memory.
Also, as a comment on the article, ip can now fully replace brctl. (and iw replaces iwconfig and iwlist).
IP may be better from an ABI standpoint, but I still find its output to be much harder to parse with the Mk 1 Eyeball than ifconfig. Most of that is probably just ip shoving more information on the screen than ifconfig, but most of the information isn't useful 99% of the time and maybe it would be nicer if ip pared down some of the "qdisc noqueue state UNKNOWN group default" noise unless someone adds a "verbose" parameter?
Or maybe only show them in the basic use case when they are set to something other than the default?
All of the "valid_lft" lines add a lot of visual noise.
While I agree that different defaults might be nice, modern versions of ip support a -br[ief] option which is pretty nice:
$ ip -br a
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 10.123.45.67/24 fe80::7ed3:aff:fe51:4612/64
$ ip -br l
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0 UP 7c:d3:0a:51:46:12 <BROADCAST,MULTICAST,UP,LOWER_UP>
This - you think - new tool will be better and then are blinded :) If they would just move the noise down one line so you could see interface name without BROADCAST, MULTICAST, mtu 1500 qdisc up blah blah.
The fact that the Linux ABI is stable is the whole reason why containers are possible.
If it were necessary to use the matching version of userland tools to your kernel version, then a container engine would only be able to run container images that match the kernel version -- you wouldn't be able to run containers based on two different versions of Debian, for example.
In 2019, I simply wrote an ifconfig that uses the netlink API, because for portability I needed a Linux ifconfig that had a FreeBSD-like command-line syntax. It doesn't have the old interface aliasing mentioned in the headlined article, and has no problems setting up and reporting IPv6 addresses or additional IPv4 addresses.
* https://unix.stackexchange.com./a/504084/5132
* http://jdebp.uk./Softwares/nosh/guide/commands/ifconfig.xml
I have a system to convert Debian /etc/network/interfaces into a BSD-style rc.conf, which then in turn gets converted into a suite of native service bundles. One of the service bundles is ifconfig@interface , which invokes ifconfig with a uniform command-line syntax across Linux and FreeBSD, hence the need for a more FreeBSD-alike ifconfig on Linux.
* http://jdebp.uk./Softwares/nosh/guide/rcconf-amalgamation.ht...
* http://jdebp.uk./Softwares/nosh/guide/rcconf.html
* http://jdebp.uk./Softwares/nosh/guide/networking.html
Another off-topic question (using this forum as your author page is quite discouraging about sending you emails ....)
What's the reason for naming cyclog files with the time they were closed? (other than that's how djb did it?), since this information is available easily with 'ls -l'?
I use a logger that opens a $CREATE_TIMESTAMP.u file, and makes "current" a symbolic link to it; and on close renames it to ".s", which I find more intuitive and informative (also provides time between log creation and first message, which is unavailable with cyclog). I was considering changing the ".u"/".s" marking to be an attribute (-w or +i or +t to signify "safely closed") to help repeated rsyncs of log directories, but haven't done that yet.
I'm sure there's some useful aspect of existing cyclog/multilog behaviour that I'm missing, but I haven't been able to figure what it is for the last 10 years ...
* http://www.skarnet.org/lists.html
As for the filenames, yes the original reason was for compatibility with multilog, and of course all of the other tools that can process these log directories. I did set out, after all, to produce a cyclog workalike, with lessons from multilog incorporated. Note that said tools might not deal well with log directories where the same log file is available via two names, both "current" and something else.
Moreover, if you go and look at follow-log-directories you can see an additional benefit that it very efficiently skips its cursors over old files without having to look at their i-nodes because it knows that the filename is guaranteed to be a timestamp at or after the last log entry in the file.
Furthermore, if you go and read the cyclog manual, you'll find out why using the w permission bit had problems. (-:
1.41 is building up changes, by the way.
What happened?
Edit: Interesting,
https://jdebp.uk has the correct cert configured, whereas https://jdebp.uk. serves the cert as mentioned above.
The Apache web server that the bulk host is using for that site has a fairly poor implementation of HTTPS. It's unsatisfactory in various ways, some very technical, but what you're seeing here is the weird way it handles SNI.
By default when you say you want jdebp.uk. and there is no such virtual host (there's only jdebp.uk with no trailing dot) Apache will pick a default virtual host and act as though you asked for that, sending over the certificate for that host and so on. In this case, at a bulk hosting site, it's some unrelated Antiques Shop outfit, likely because that begins with 'A' which is the first letter of the alphabet.
This actually caused a problem for Let's Encrypt because their tls-sni-01 challenge type assumed nobody would be crazy enough to answer queries for a random name with a certificate chosen by somebody else entirely. But that's exactly what Apache is doing here. The current tls-alpn-01 challenge was introduced to fix that - it asks for a reserved ALPN service instead of a spurious SNI server name.
For example, try the following:
vs You'll notice that in the first case the default certificate is sent back, in the second case the certificate is correctly matched against the SNI.According to the Server header returned:
Testing against an NGINX based server, I am not seeing the same results, in fact I am seeing the correct certificate being returned.And it is factually inaccurate. Deprecation of ifconfig is a distro issue. "Linux" did not deprecate it. And the reason is that it was unmaintained, not that it couldn't handle multiple IP addresses. In fact it can, I still use it 50% of the time. Works fine for setting and displaying multiple addresses.
The Debian maintainers wanted to drop it, and the other distros all followed suit a couple years later. Good information and links here:
https://serverfault.com/questions/633087/where-is-the-statem...
"Linux maintains known bugs – and actively refuses to fix them. In fact, if you attempt to fix them, Linus will curse at you, as manifest by this email."
That is a bold statement but is not at all supported by the linked email. You'll see Linus cursing at a bad patch that would break something in userland, not for "maintaining a bug". He's preventing at least two bugs (unnecessary change to behavior and ENOENT is indeed the wrong return value). I think I liked the old Linus better...
So it's a shame. I'd love to read a series about BSD, but this is really just inaccurate propaganda.
I don't like this email thread, because some people are clearly trying to carefully find the breakage and fix it, but Linus yelling at people is all that people ever see from it. So the conversation changes from fixing a bug to insults and anger.
Unmaintained sounds like a very good reason to me. It's not just whether there is 1 or 2 addresses per interface. The rot set in when Alexy re-did the Linux kernels network infrastructure back god knows when (its decades ago now), and wrote his own user space tool to configure it. That tool was ip. It not only handled multi ip addresses per interface - it handled multiple routing tables, multiple link types, routing rules and a whole pile of other things. And that single tool has been growing ever since - it's now huge. Type typing "man ip-<tab><tab>" on a cli that supports tab completion some time.
Effectively the task of keeping up with the kernel's new features kept growing and at some point the ifconfig maintainers gave up. It was all over bar the shouting at the point. The only surprising thing is the shouting has gone on for literally decades, and as this article demonstrates continues to this day. Lets hope the same angst over systemd doesn't continue for the same amount of time.
Just like like systemd there are things that rub me the wrong way of course. Coping the Cisco IOS style of command line usage rather than using the Linux style is for me one of those things. But it happened for a reason - Alexy set the standard when he wrote the first version of ip, and he was trying to emulate the features provided by a Cisco router at the time.
It's difficult to take him seriously when he picks and chooses when to enforce his supposed "never break userland" ethos.
Edit: Breaking ZFS is not a great example — as sibling comment points out, that is a kernel module using kernel-internal APIs, not userspace syscall ABI. The Linux kernel notoriously considers all kernel interfaces unstable. GregKH has in the past characterized this as a feature, not a bug.
Deleted Comment
Deleted Comment
https://vez.mrsk.me/freebsd-defaults.txt
The argument doesn't hang together. He can't claim that changes to userland tools aren't possible whilst at the same time claiming it's because the existing interfaces never change.
That said — new ioctls could be added and new ifconfig could use those? Old ifconfig and user programs could continue using the old ABIs.
Also something like WSL would be impossible
I kind of said the same thing just now:
https://news.ycombinator.com/item?id=22629837
I think this is not specific to Linux at all, and is not really about kernel ABI. This is a problem I see a lot, often in proprietary software too. Firstly, people opt to rewrite before they fix or even before they fully understand the old thing. Secondly, people confuse interface with implementation, and often don't bother trying to make their rewrites interoperable with the old thing.
Another example of that last one, in Linux from the late 90s, is ALSA. FreeBSD for example chose to fix the problems and maintain the old OSS API for audio devices. Linux introduced a very complicated new API.
[By the way, I spotted one sort of technical error in the article. I don't think most software keeps private copies of kernel data structures in their source tree. Rather, when they #include the kernel headers, they end up using an effectively-private version of those structures and constants in their object code. This is slightly different but a similar result.]
But it's telling that nobody stepped up and actually bothered to do that despite all the bitching and moaning.
Successful code is generally produced to solve problems, not fullfil some abstract ideals
https://news.ycombinator.com/item?id=22628938
But with the Linux ecosystem's inertia being what it is, rather than the 2 existing implementations of ifconfig in use being displaced by this better one... now there are just 3 implementations of ifconfig in use.
As mentioned in the Stack Exchange thread linked in that post, a different someone submitted a relevant patch to one of those existing implementations – way back in 2013. But it was never accepted. More inertia.
The reason is that people want the software to have full functionality no matter what system is used for building it. You can build on an old system, with a kernel that totally lacks the functionality, and produce a binary that can use the new kernel interfaces when run on a system that has them.
I feel that /sbin/ip is in almost every way a better tool than /sbin/ifconfig, is that not the concensus?
> Linux introduced a very complicated new API.
Which highlights the fact that the moment you want to have in-depth interactions with a driver for a piece of hardware ioctls are the wrong choice.
OSS was great if you had exceptionally simple needs.. the moment you want to do "professional" audio it was a nightmare. ALSA is _somewhat_ better for this, and I honestly wish they went with a more netlink(3) style API instead of an IOCTL driven one.
What's the point of pantomiming the old thing when the old thing wasn't designed properly in the first place?
1) name. It’s to configure the interface
2) default format. Far better spaced than “ip”’s various outputs. I find “ip -o a” just about manageable, but if config shows data far more cleanly imo
According to the manpage, -color can be shortened to -c and link shortened to `l`, as `addr` can be shortened to `a`. -br stands for -brief, which knowing makes it easier to remember.
Now I need the aliases less.In case somebody is wondering the output looks like:
Well, no. What you do is create a new struct with correct behavior and let new applications use that. The old struct becomes deprecated but continues to exist until things stop using it. Which may be indefinitely, but that's not really a lot more work than maintaining a compatibility library to serve the same purpose.
The thing with ip vs. ifconfig was more to do with there being somebody interested in creating ip and nobody interested in maintaining ifconfig. If you want to go add support for multiple addresses on the same interface to ifconfig, nobody is stopping you -- in fact that has already happened now.
I've almost replaced route with "ip route" as well. arp isn't fully replaced yet in muscle memory.
Also, as a comment on the article, ip can now fully replace brctl. (and iw replaces iwconfig and iwlist).
Or maybe only show them in the basic use case when they are set to something other than the default?
All of the "valid_lft" lines add a lot of visual noise.
Really, just some whitespace in between the interfaces like in ifconfig would go a long way.
If it were necessary to use the matching version of userland tools to your kernel version, then a container engine would only be able to run container images that match the kernel version -- you wouldn't be able to run containers based on two different versions of Debian, for example.