Slash Boxes

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 9 submissions in the queue.
posted by NCommander on Thursday April 20 2017, @06:00PM   Printer-friendly
from the backporting-is-not-a-maintainable-process dept.

Two months ago, I polled the community for advice on the underlying operating system that should power SoylentNews (SN). After reading comments, and some recent experiences in my personal and professional life, we are migrating to Gentoo as the operating system of choice. As of right now, we've already migrated our development box, lithium, over, and using it as a shakedown to see how painful the overall migration will be. I'm pleased to report that, aside from varnish (an HTTP accelerator), the process went relatively smoothly.


For those who weren't here for the original article querying the community (linked above), let me recap the situation. At the time that I wrote that article, SN was mostly standardized on Ubuntu 14.04, with a single CentOS 6.7 box lurking in our midst. In the course of testing updates and other projects, the staff and myself felt that Ubuntu (and Debian) had lost a lot of the advantages that had made it a rock solid choice for the last three years of powering SN, combined with the fact that the upgrade process would not have been trivial due to the systemd migration.

Though greatly disliked by all of us, systemd being part of Ubuntu 16.04 LTS (Long Term Stable) was not a deal breaker. More importantly was the perception that the release lacked stability and we had a serious sense that the upgrade would be problematic. I felt it was time to reopen the scenario to see if we were better off migrating to a different distro, or abandoning Linux entirely. As such the original article was penned to see what the community's feelings on the subject were. The overwhelming consensus was that I was not alone with my feelings on the latest LTS, and many thought FreeBSD would be a good choice for us. Ultimately, we decided to trial Gentoo over FreeBSD for four reasons

  • FreeBSD's upgrade system with ports/core isn't anywhere as robust as I would like
  • We would lose Linode's backup services, and be fully dependent on our own self-rolled backup system
  • Trying to backport security features is ultimately a losing battle
  • Gentoo had overwhelming support from the staff

I'll break these first three item by item

FreeBSD Upgrades

FreeBSD is divided into two parts, the core system which has basic utilities, and the ports collection which has all the add on software like Apache and such. In theory, these two components can be updated independently of each other allowing a stable base while migrating to newer software versions with relative ease. Ports can be installed from binaries, or manually compiled to suit one's taste in a relatively automated fashion bringing together the best of a binary and source based distribution. On paper, it looks perfect.

In further research, I've found that port upgrades are fragile at the best of times. Unlike Debian's APT which has strict package dependence and shared library management, port upgrades are very much upgrade and pray and its possible to hose a system in this way. The situation is similar to using EPEL on CentOS, or using Slackware that port upgrades can leave artifacts, and there's often considerable manual intervention to keep things chugging around. This is compounded by the fact that the version of Kerberos we need is in the ports collection due to incompatibility between MIT Kerberos V (which we use) and Heimdal Kerberos which ships out of the box. For those of you familiar with Active Directory, this is roughly on par with the effort required to rebuild AD from scratch along side a pre-existing forest. This meant unless we rebuilt the entire Kerberos domain (a drastic and painful option to say the least) that we could easily break a node because a ports upgrade went sideways.

Furthermore, mixing binary and source ports also have several ways it can go wrong which is problematic. To ease our system maintenance burden, its long been a goal of the admin team to have rehash and its dependencies built and deployed through package management instead of the rather horrorifying script+rsync that we use now. While we could have technically achieved this with Ubuntu by running our own buildd (or using a PPA), the sheer amount of dependencies combined with the pain of rebuilding the world ultimately doomed this to the "would be nice" pile list of ideas.

On top of this, the split architecture of FreeBSD would also mean that upgrades are no longer "one command and done" as they are with Ubuntu and Debian. Instead it becomes a matter of determining what, if any, core system upgrades are available, deploy them, then deploy/rebuild ports as needed. None of this by itself would be deal-breaking, but when compounded with the other reasons it tipped me away from this option.

Linode Backups

For any production website, having backups is the thing you must have, not the thing you wish you had. With the exception of our development box, all our systems are backed up to off-site storage on a machine called oxygen via rsnapshot nightly (and yes, we do test our backups). However, due to the way SoylentNews is situated, there is the possibility that if an attacker ever successfully breached SN, its possible they may be able to gain access to oxygen, and rm -rf / everything.

For this reason alone, we used two separate sets of backups in case of system failure or node compromise. As mentioned many times before, SN is hosted on a number of VPSes by Linode who I continue to highly recommend for anyone's VPS needs. One very useful and handy feature of Linode is that they offer snapshotting and node backups as part of their hosting services for reasonable prices, and critical system boxes are backed up with them as a second-level of defense. Unfortunately, Linode's backup services require that their system understand the underlying filesystem format used by the OS so they can snapshot it easily. As of writing, they do not support FreeBSD's UFS or ZFS. A migration would mean we'd have to sink additional costs in a new backup system to supplement oxygen.

Backporting Security Features is a Losing Battle

I'm going to get flamed for this reason, but recent events have sort of drilled this home for me, both at SoylentNews and as my work as a freelancer. During the last round of security updates, I've been fighting to get several of CentOS's security issues fixed. Red Hat (and CentOS) offer ten year support for their products but in many ways it is the wrong approach to system stability and security. A real-world issue I ran into with CentOS's support is that they ship rather old issues of dovecot, a relatively popular IMAP server.

Now, in theory, as long as security patches are backported, this shouldn't be a problem. In practice however, it means you're essentially tethered to the security features as offered at the time of the release. For example, a good number of our users are likely familiar with the Logjam attack. The mitigation for Logjam is to regenerate DH parameters to larger sizes, and change to a non-common prime. Relatively straightforward, right?

Well, not so much. Dovecot 2.0 (which is what CentOS 6.7 ships with) doesn't allow for setting of custom DH parameters, or even tweaking anything beyond the most basic TLS settings. To a lesser extent, we also had this problem with Postfix (we can't disable client side negotiation). The solution in both cases is to upgrade. That would be great, if we could in-place upgrade CentOS, or reliably upgrade the RPMs without hosing YUM at a later date. In practice, we've been forced into doing a number of arcane hacks to get most of the survey tools to report anything better than a "C" grade, with the situation worsening as time goes on. Before people say "well that's a problem with dovecot", and not CentOS, you can't get OCSP stapling (which is an important security feature to help fix SSL's revocation system) with Apache out of the box. You need to either patch Apache 2.2 in place, or upgrade to 2.4.

This problem also has shown its head on Ubuntu. To Canonical's credit, their security team actually has gone through the work of mainlining newer security features in popular products; Ubuntu 14.04's Apache 2.2 supports OCSP stapling because they patch Apache in their binaries. However this practice only goes so far. Deploying CAA records to SoylentNews in the last round of tweaks was an exercise in frustration because only the most recent versions of BIND knows how to handle the CAA record type. Once again, we're in serious voodoo territory if we tried to upgrade BIND outside of a distro release.

This brings me to my final point: trying to follow industry best-practices falls apart if you can't easily update your stack. Release based distros at best (with Ubuntu) update once every six months, or once every year or so for longer term support from other distros. That's a very long time in the security world. Furthermore, each major upgrade is an event and a large time sink in and of itself. As such I've (grudgingly) come to the conclusion that if you actually want to have real security, you need to update frequently. Furthermore, by having smaller upgrades at a given time instead of them in one large pile, you have a better chance of not getting overwhelmed at those release points.

Why Gentoo

Gentoo ultimately won by being both rolling-release based, and source based. It meant that we could easily upgrade the entire stack (including rehash's special dependencies) as a single emerge world, and then deploy. It also edged out the other options by not forcing systemd on us (and OpenRC is an absolute pleasure to debug and maintain in comparison). We've also discussed the issue at length and have determined how we're going to approach the rather daunting task ahead of us.

The Steps Ahead

The first step, which was already completed, was to migrate our development system over to Gentoo to get an idea of how much pain we're going to be in. This was accomplished by booting the system in rescue mode, moving "/" (i.e. the root of our filesystem) to "/old-rootfs", extracting a stage3, cooking the kernel, and rebooting. audioguy and TheMightyBuzzard worked out the correct set of USE flags for our environment, and I used the serial console to do the actual changeover. Aside from Varnish breaking, the migration was actually relatively smooth if time consuming. Right now, we're still wrestling with varnish, but after kicking MySQL cluster's init scripts and copying configs, it sputtered to life and popped back onto the internet.

The next steps is to create ebuilds for hesinfo (a Hesiod support tool that Gentoo doesn't ship in their hesiod package), and then to create a custom stage3 with our kernel config and base system with catalyst. We're going to work out the set of packages we need and configure lithium to work as a binary package source for portage. In effect, every package we need will be compiled once on lithium, then published via a private portage repository. Other machines will simply be able to emerge world and download the pre-tested and compiled binaries in one fell swoop keeping the software stack across SoylentNews consistent across the organization. As an added bonus, we can now easily migrate our custom set of compilation scripts to ebuilds and have sane package and dependency tracking for the entire site infrastructure.

Since most of the site infrastructure is fully redundant, we don't expect too much downtime or breakage as we begin migrating other boxes from Ubuntu. As usual, we'll keep the community apprised of our status, as well as if we need to schedule actual site downtime during this period. While some of us might thing we're insane, I will just note for the record we took a similarly drastic step of migrating to a IPv6-only backend two years ago in the name of administration sanity, and serving SN needs best. As always, I'll be reading and commenting below.

~ NCommander

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0, Troll) by bob_the_systemd_builder on Thursday April 20 2017, @08:13PM (29 children)

    by bob_the_systemd_builder (6568) on Thursday April 20 2017, @08:13PM (#497040)

    Are people still really scared of Systemd? If so you should just really switch over to Windows at this point because Linux systems are just going to be too hard for you to use. Learn to embrace change yo! This is what I see in my head when all the old people on their rascal scooters complain about Systemd. []

    Starting Score:    1  point
    Moderation   -1  
       Troll=3, Insightful=2, Total=5
    Extra 'Troll' Modifier   0  

    Total Score:   0  
  • (Score: 5, Insightful) by linuxrocks123 on Thursday April 20 2017, @08:52PM (1 child)

    by linuxrocks123 (2557) on Thursday April 20 2017, @08:52PM (#497056) Journal

    Your assertion is that, yes, there is a giant f*ing hole in the house, but it's unreasonable to be unhappy about that.

    Additionally, disliking something is not the same thing as fearing it.

  • (Score: 3, Informative) by Azuma Hazuki on Thursday April 20 2017, @08:55PM (5 children)

    by Azuma Hazuki (5086) on Thursday April 20 2017, @08:55PM (#497057) Journal

    SystemD per se isn't the issue, it's 1) that it seems to be a vehicle for making RedHat money, i.e., "vendor lockin through obscurity" and 2) the way it's implemented is very monolithic and difficult to configure, thus breaking the shit out of The Unix Way (TM).

    Those of us who've either been using *nix a long time, or like me, started with something that forces you to get down and dirty with the guts of the system, have a creeping, rotting feeling that "this is not beautiful, this is not just, this is not open" when dealing with SystemD as it is. SysVInit has issues, yes, but OpenRC does wonderfully and for the life of me I cannot understand why it didn't become standard. I always knew my devotion to Gentoo would pay off...

    I am "that girl" your mother warned you about...
    • (Score: 1, Interesting) by Anonymous Coward on Thursday April 20 2017, @09:23PM (3 children)

      by Anonymous Coward on Thursday April 20 2017, @09:23PM (#497071)

      Notice how redhat based systems are mentioned as easy to hack in the recent wikileaks?

      Ever wonder why.

      Defects by design.

      • (Score: 2) by kaszz on Friday April 21 2017, @08:56AM (1 child)

        by kaszz (4211) on Friday April 21 2017, @08:56AM (#497308) Journal

        Hope someone checks out where Red Hat gets their money flow from. If they have done a "RSA deal" or if their board is way to cosy with certain elements of the government.

        • (Score: 0) by Anonymous Coward on Friday April 21 2017, @05:13PM

          by Anonymous Coward on Friday April 21 2017, @05:13PM (#497495)

          RedHat's largest single client is the US Department of Defense.

      • (Score: 0) by bob_the_systemd_builder on Friday April 21 2017, @02:36PM

        by bob_the_systemd_builder (6568) on Friday April 21 2017, @02:36PM (#497416)

        Red Hat is only easy to hack if you turn off selinux. If you're not using selinux you're wrong. The more used an operating system is the more vulnerabilities are found. That's why you see tons of exploits for firefox and not lunascape.

    • (Score: -1, Troll) by bob_the_systemd_builder on Friday April 21 2017, @02:27PM

      by bob_the_systemd_builder (6568) on Friday April 21 2017, @02:27PM (#497410)

      1) I'm very curious how you think Systemd makes Red Hat any money. Can you show any proof or are you just babbling about "vendor lock in" because you don't like enterprise operating systems? On that note you CAN force another init system if you really want to, but that's like sending back a fancy steak and asking for a happy meal. There's also no obscurity. [] It's open source so you can review all of the code and understand the inner workings. Systemd is incredibly straight forward once you take the time to learn it. How is it not open?

      2) Systemd is far easier to configure than Upstart or any of the older sysv init systems. A unit file is VERY simple to build and adjust. What would take over 30 lines in an init script takes 10 lines in a unit file. The Unix way is old and needed to be changed.

      Been using Linux since the early 90's and I started with Slackware. I've seen a variety of init systems and Systemd is the best so far. So don't try and pull the "Been using it longer" card.

  • (Score: 3, Insightful) by Scruffy Beard 2 on Thursday April 20 2017, @09:26PM

    by Scruffy Beard 2 (6030) on Thursday April 20 2017, @09:26PM (#497074)

    Um... Stewie is complaining about a broken house.... I think Stewie is being completely prudent in that clip.

  • (Score: 1, Insightful) by Anonymous Coward on Thursday April 20 2017, @10:30PM (2 children)

    by Anonymous Coward on Thursday April 20 2017, @10:30PM (#497094)

    And you sound like a naive young jerk who doesn't even comprehend his own limitations. Go look back at your old school pictures, the horror you experience at seeing your young "fashion sense" will be similar to what happens when the clouds finally lift from your mind and you can see the bigger picture. So many techies can't comprehend that yes, the world is that fucked up, and they have some weird faith that corporations wouldn't do nasty stuff because they'd go out of business... hahahahahahaha

    • (Score: 0) by bob_the_systemd_builder on Friday April 21 2017, @02:39PM (1 child)

      by bob_the_systemd_builder (6568) on Friday April 21 2017, @02:39PM (#497419)

      Depends on your definition of young. If people in their 50's are young then I'm a spring chicken baby! Also while the world is fucked up I don't see what anything you said has to do with systemd. Are you saying systemd is the trump of linux? Corporations are people dude. Don't bash people. It's just wrong. Trolllollollollollollollollol. Seriously though what big picture are you referring to?

      • (Score: 0) by Anonymous Coward on Sunday April 23 2017, @04:28PM

        by Anonymous Coward on Sunday April 23 2017, @04:28PM (#498384)

        Not sure about the GP but the big picture on systemd, IMO, would be bad by design, i.e. the monolithic opaque design. I've certainly seen again and again that from an engineering perspective, it is a bad design. It's is prone to breakage and difficult/impossible to fix. The only slightly positive comment I could say about it is that, it can be a useful design for trying to stop competitors and for locking others out. But I'm not trying to 'compete' with my OS. I want something that works as stable as possible and is easy to fix when it doesn't work. I see systemd as technical change that's non-cooperative. This from my user perspective is undesired.

        But no fear. We use purposely crappily designed tech and systems every day. I don't fear a crappily made screw driver. But I'm sure going to avoid using the piece of junk if I can get my hands on something better.

  • (Score: 0) by Anonymous Coward on Friday April 21 2017, @07:07AM (7 children)

    by Anonymous Coward on Friday April 21 2017, @07:07AM (#497284)

    > Are people still really scared of Systemd?

    you mean, that piece of software that is behaving exactly as its detractors predicted?

    • (Score: 0) by bob_the_systemd_builder on Friday April 21 2017, @02:42PM (6 children)

      by bob_the_systemd_builder (6568) on Friday April 21 2017, @02:42PM (#497420)

      Please explain how systemd is behaving badly. My complaint that old sys admins hate change is pretty evident and well documented. See your post above for proof. But what problems is systemd causing?

      Just like any other piece of software. If it's properly setup it runs perfectly.

      • (Score: 2) by Scruffy Beard 2 on Saturday April 22 2017, @06:34AM (5 children)

        by Scruffy Beard 2 (6030) on Saturday April 22 2017, @06:34AM (#497826)

        The only weirdness I have personally seen so far is that the filesystem check did not run properly on a dirty boot. Can't have a 5 minute Fsck hold back parallel booting, now can we? The Knoppix live DVD got rid of systemd because parallel boot slows things down considerably when seeking costs up to 300ms.

        There was that bug with systemd re-implementing the rm utility...poorly []

        Systemd is behaving badly by trying to do everything: with a development team that apparently does not take serious bugs seriously.

        The advantage of "the UNIX way" is that you can rip out and re-implement troublesome components. With systemd, it is largely an "all or nothing" proposition.

        • (Score: 2) by linuxrocks123 on Sunday April 23 2017, @03:39AM (4 children)

          by linuxrocks123 (2557) on Sunday April 23 2017, @03:39AM (#498156) Journal

          Wow ... hadn't heard of THIS one lol. I guess bricking the machines of people who did rm -rf --no-preserve-root / wasn't stupid enough for them.

          Do you know what exactly "R!" is, why it exists, etc.? I can't find too much documentation on this command -- if it is a command -- not unusual for SystemD's documentation to be poor, of course.

          • (Score: 2) by Scruffy Beard 2 on Sunday April 23 2017, @06:14AM (3 children)

            by Scruffy Beard 2 (6030) on Sunday April 23 2017, @06:14AM (#498189)

            Good question. I had to go back to the bug report to find it.

            R is used in configuration files to tell systemd what directories to routinely delete.

            systemd-tmpfiles []

            • (Score: 2) by Scruffy Beard 2 on Sunday April 23 2017, @06:21AM (2 children)

              by Scruffy Beard 2 (6030) on Sunday April 23 2017, @06:21AM (#498192)

              It is actually documented here: tmpfiles.d(5) []

              • (Score: 2) by linuxrocks123 on Sunday April 23 2017, @08:15AM (1 child)

                by linuxrocks123 (2557) on Sunday April 23 2017, @08:15AM (#498228) Journal

                Good find. Thanks for the info.

                The bug you linked is an excellent example of the problem with their style and attitude. Reimplementing "rm" is NIH to an absurd and terrifying extreme.

  • (Score: 3, Insightful) by Runaway1956 on Friday April 21 2017, @02:05PM (7 children)

    by Runaway1956 (2926) Subscriber Badge on Friday April 21 2017, @02:05PM (#497400) Journal

    Well, bob_the_systemd_troll - I don't think anyone "fears" systemd. We distrust it, generally. Except for some of the totally clueless, who have no idea WTF systemd is. "WTF is an init system, anyway?" Those of us who don't actually distrust it, dislike it. What we all want to know is, who is paying whom to make systemd default in all the distros? To date, there has been no compelling reason to choose one init system over another. But, systemd is growing in popularity - among distro maintainers. Why?

    We've finally beat Medicare! - Houseplant in Chief
    • (Score: 0, Informative) by bob_the_systemd_builder on Friday April 21 2017, @02:49PM (4 children)

      by bob_the_systemd_builder (6568) on Friday April 21 2017, @02:49PM (#497423)

      Since systemd is fully open source I'm wonder what there is to distrust. Also I know fully well what an init system is and have probably been writing init scripts as long as if you have (if not longer). The reason why systemd is replacing upstart and other init systems is because it's better. Unit files allow more flexibility and simplicity of setup. With cgroups being so heavily used I have full control over resource consumption as it's being launched. I have the ability to closely monitor every single process under a service. Lets look at the legacy systems. If I run 'service httpd status' I get a single PID, but very little information as to how apache is actually running. I also can define dependencies in a simple straight forward manner. This makes it so I don't have to rely on a number based order.

      TLDR, systemd has tons of benefits and is easy to use. What don't you "trust" when you can read over the source code for yourself?

      • (Score: 2) by Runaway1956 on Friday April 21 2017, @03:33PM (3 children)

        by Runaway1956 (2926) Subscriber Badge on Friday April 21 2017, @03:33PM (#497453) Journal

        I'll grant that AFTER you understand WTF systemd is doing, it is relatively "simple", in that, everything can be found in more or less one place.

        What's to distrust? Monoculture is always untrustworthy, in and of itself. Why has Windows always been so easy to hack? Well, because damned near every Windows system in the world responds to the same outsite stimuli as every other Windows system in the world. If you can get into one Windows system, you can get into damned near all Windows system by doing the same thing again and again. I believe the term "script kiddie" specifically targeted Windows "hackers" who knew how to use a script, but had little if any idea how it worked. With Unix-likes, the script kiddie thing never got the traction that Windows users got. Pretty much, each system had to be targeted, and the majority of them didn't respond to the same outside poking and prodding that any other system responded to.

        Give it a couple more years, and anyone who can exploit a systemd system, will be able to get into half or more of the Linux systems in the world.

        I think the *nix world is losing something valuable, when all of the distros make the same init system default.

        Unlike others, I don't "hate" systemd. Not yet, anyway. But, I distrust it. And, I have little faith in the future of systemd. It threatens to make Linux more Windows-like than Unix-like.

        We've finally beat Medicare! - Houseplant in Chief
        • (Score: 2) by Gaaark on Friday April 21 2017, @06:05PM (1 child)

          by Gaaark (41) on Friday April 21 2017, @06:05PM (#497512) Journal

          I've started using Arch (Manjaro, really, because of the easy install --my free time seems to be so unavailable anymore) because of the speed: started hating the sloooooowness of Ubuntu.

          If only Gentoo had an 'easy' install, i'd probably switch (from what i can see, aren't arch and gentoo 'basically' the same thing?)

          If i get a patch of free time, i might just install Gentoo, though. At least on a separate partition, dual boot with arch/manjaro.

          Will look into removing systemd from arch, but it looks like a difficult time, from what i'm reading.... :(

          --- Please remind me if I haven't been civil to you: I'm channeling MDC. ---Gaaark 2.0 ---
          • (Score: 2) by The Mighty Buzzard on Friday April 21 2017, @08:33PM

            Have a look at Calculate Linux. It's essentially gentoo with a binary overlay and some handy admin type scripts thrown in. If you like you can remove all things Calculate after install and just have a Gentoo system. Plus it's quite a lot easier to install.

            My rights don't end where your fear begins.
        • (Score: 2) by Gaaark on Friday April 21 2017, @06:06PM

          by Gaaark (41) on Friday April 21 2017, @06:06PM (#497514) Journal

          oh, yeah... main reason for posting here:

          Bob? Runaway put his balls in your court.... whack away! :)

          --- Please remind me if I haven't been civil to you: I'm channeling MDC. ---Gaaark 2.0 ---
    • (Score: 0) by Anonymous Coward on Friday April 21 2017, @03:07PM (1 child)

      by Anonymous Coward on Friday April 21 2017, @03:07PM (#497433)

      > But, systemd is growing in popularity - among distro maintainers. Why?

      Because it is so much better than alternatives that it even worth switching the default.

      > who is paying whom to make systemd default in all the distros?

      Must be a consortium of NSA, FSB, Mossad and the Chinese to haxxor all of the internet. Isn't it obvious?

  • (Score: 0) by Anonymous Coward on Friday May 05 2017, @08:21AM

    by Anonymous Coward on Friday May 05 2017, @08:21AM (#504732)

    People are not scared of systemd, just see it as wrong minded and going in a direction they care not to follow.

    It's true that many popular distros have become redhat derivatives and for those that don't notice or care that will be their linux world, they've been captured.

    But those people don't contribute in any great measure, only users have been captured.

    For the people who do care, do contribute the only choice is to move away from systemd/linux in exactly the same way as we moved away from windows.

    This is not a zero sum game, systemd people seem to think they have 'won' others just see them as damage and are routing around them and following linus' advice, to paraphrase:

    "linux is a big project with lots of people, find people you can and like work with, doing things you care about"