I have an old ThinkPad 11e running Debian that I have repurposed into a home server. It’s only supposed to run TVheadend. I don’t need any other services for now, but later on i might add a few using docker.

Is it enough to set multiuser.target as default to disable gui and keep the system always on?

How can I disable all unnecessary services and minimize power usage?

  • leisesprecher@feddit.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    In case you didn’t already do that: remove the battery. It’s probably dead anyway, you don’t need it and it poses a potential (albeit low) risk.

    • poVoq@slrpnk.net
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      Depends. Usually it is still good as a UPS for a few minutes, and some laptops have a bios option to limit full charge which lowers the risk even further.

      • leisesprecher@feddit.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 month ago

        And how much need is there for a UPS in this scenario - realistically.

        Some of the people here take their admin-LARPing a tad too seriously. Most households have reliable enough electricity, and even if there’s an outage once every quarter, would a dead battery even help?

        I advocate for being realistic with one’s own needs. Don’t build a five-nines datacenter for a glorified weather station or VCR.

        • curbstickle@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 month ago

          The nice thing about some battery backup is not keeping it running during an outage, but safely shutting it all down.

          I agree on the laptop battery, I’m just disagreeing on battery backup. It serves a purpose, as does decent surge elimination.

          • leisesprecher@feddit.org
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            1
            ·
            1 month ago

            But not for us.

            That’s what I meant by larping. The vast vast majority of us here would probably not even notice if their systems went down for an hour. Yes, battery backup has its purpose. In a datacenter.

            I mean, what’s on the line here in the worst case? 15min without jellyfin and home assistant? Does that warrant taking risks with old batteries or investing in new ones?

            That equation might change if you’re in a place with truly unreliable electricity, but I guess those places have solutions in place already.

            • curbstickle@lemmy.dbzer0.com
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              1 month ago

              No, hard disagree.

              I have many thousands of dollars worth of hardware. I have seen the results of a surge. I have seen a NAS reduced to a paper weight. You’re making incredibly silly assumptions here - this has nothing to do with uptime, and everything to do with protecting your equipment.

              You will not ever convince me otherwise, because I’m not willing to dump thousands of dollars on replacements because someone on the internet thinks it has anything to do with uptime.

              You are wrong.

              Edit: anywhere that weather exists is an area with “unreliable electricity”. Full stop.

            • BCsven@lemmy.ca
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 month ago

              We have blippy power in the windy season, a 1 second outage was enough to trash hardware, not to mention dirty power you may not visibly notice. My UPS kicks in every few weeks for a few seconds to provide clean power when the utility is falling short or over volting. Having a battery take over is super helpful

          • realbadat@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            30 days ago

            US power sucks plenty!

            Texas is an extreme example, but outages happen everywhere. It was only a bit over 10 years ago when Sandy basically hit half the US and took power out in the tristate area for weeks. With climate change making things worse…

            But even when things are running well, not including the random downed line or busted transformers, its still better to give your hardware clean power and avoid the small spikes.

        • poVoq@slrpnk.net
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          1 month ago

          That is why I said it depends. There are many places where electricity cuts for a short duration are quite frequent. Often you don’t even notice it, but a 24/7 server would be effected.

          In general, I think the risk of laptop batteries catching fire is overstated especially if you limit the charge to 80% or so. So weighting these two issues against each other you can come out either way, but I think for most places it will come down towards a UPS being nice to have.

          • realbadat@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            30 days ago

            Worth taking a look at the battery - especially an old one on a repurposed device - before considering it safe. Spicy pillows happen.

          • hendrik@palaver.p3x.de
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            1 month ago

            Everything has pros and cons. I’ve seen 3 laptops (of my family) with batteries that looked like a baloon after several years. I’ve subsequently removed or replaced them. I’d definitely check on them every now and then. A UPS is nice. Burning down a house isn’t. I haven’t seen them catch on fire (yet), they supposedly have at least some protection. But definitely get them out of the laptop once they’re dead anyways or don’t look alright. Everyone is responsible to make that decision on their own. Take care.

  • Limonene@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    The easiest way to disable unnecessary services is to uninstall them with aptitude, or whichever package manager you like. Try terminating services one by one, and see if anything bad happens. If nothing bad happens, you can probably uninstall it. On the other hand, if the system does get wonky a reboot should fix it. Or, you can research the services by name and decide whether to uninstall them. (avahi-daemon for example is a good idea to uninstall.)

    To make the GUI not run, uninstall your display manager (gdm, xdm, nodm, or whatever) and uninstall your xorg server or wayland server. There may be GUI programs remaining after that, but they will only be consuming disk space, not RAM or CPU.

    If the battery is old and holds little charge, you may save a few watts by removing it and throwing it away, instead of letting the system keep it topped off.

    Get a power meter, such as a Kill-a-watt device. Then, experiment with different settings. If it’s consuming less than 30 watts, you’re probably fine. If you live in the US, one watt-year is about one US dollar (or a little more), so for every watt it consumes, that’s about how much you will pay per year for its electricity.

  • TheHolm@aussie.zone
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    It would be useful to know laptop spec. In general, do not bother power consumption should be lower enough as it is.

    • mFat@lemdro.idOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      It’s a Thinkpad 11e with AMD A series A4-6210 (1.8 GHz), 8GB RAM, 120GB SSD, AMD Radeon R3.

      • TheHolm@aussie.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        30 days ago

        A4-6210 with build in GPU has TDP of 15W. There is no point to optimize anything it is seeping power already. may be try to use tlp to limit max charge level of the battery ( i’m not sure is you laptop is supported). You can play with governors too, but I personaly will not bother. You obviously need multiuser.target but not GUI.

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 month ago

    I usually do the expert install and don’t install a graphical environment in the first place. But your solution should be fine, too. I think you can show running services with systemctl and then disable unneeded ones. For example systemctl disable gdm but there shouldn’t be that much running on a plain Debian anyways.

    For powersave I run powertop in auto-tune mode as a systemd service. A description is here: https://wiki.archlinux.org/title/Powertop

    Unfortunately, the Debian Wiki doesn’t seem to have a lot on laptop power saving. The Arch wiki has some more (random) info: https://wiki.archlinux.org/title/Power_management

    I’d say do the powertop systemd service on startup, set the multiuser target or disable the login manager and that’s it.