libera/#devuan/ Friday, 2025-01-31

systemdletewhat is a deterministic way to test if a linux system is running systemd or absolutely is not?01:05
systemdleteI suggest something like "ps -o comm --no-headers -p1"01:06
systemdleteSome package maintainers need this to support non-systemd folks like us, here.01:06
systemdleterelying on testing for /usr/lib/systemd/system/.  is NOT deterministic because our own non-systemd distro still has these files present01:07
onefangI would suggest running "systemd lete" and see if it fails, but that's just a joke.01:07
systemdleteBut, onefang, I actually /like/ that joke.01:08
onefangB-)01:08
fsmithredcheck if init is really init or a symlink to some systemd shit01:10
fsmithredon debian: /sbin/init -> /lib/systemd/systemd01:15
Xenguyshitstemd01:16
systemdleteI looked for but maybe overlooked some file under /etc indicating which init system is being used.01:17
systemdleteXenguy, please write it and package it for all distros01:17
AlverstoneFYI I just grep runit or runsvdir :)01:22
Alverstonenot terribly reliable01:22
freemcheck for fstab presence: if it's not around, it's systemd :D01:25
freem(not reliable, I know, some other inits may do the same silly thing of handling partitions, but those should probably be avoided as well as systemd anyway)01:25
freem`which systemd` as root may work, too, I suppose?01:26
fsmithredsystemdlete, cat /proc/1/comm01:26
fsmithredI don't know if that works outside the debian world.01:27
systemdleteI think it would be best, if we are to suggest any solution, to provide a deterministic solution that should (in theory at least) work on all platforms.  (Natch, Windoze will fail on ps...)01:27
freemon all platforms, including non POSIX ones? ambitious.01:28
systemdleteIt's too bad that os-release does not have an init system field01:28
onefangfsmithred's first suggestion seems obvious and reliable to me.01:28
systemdleteonefang, actually, some of the scripts I've seen do exactly that.01:29
systemdletebut it does require some processing; one would hope for a "cleaner" and simpler solution I think01:29
systemdletecat /proc/1/comm   is a better way to get the same info01:30
systemdletebut /proc may not be mounted on all platforms, so one would have to test for that also01:30
onefangI said FIRST solution, checking for a symlink isn't hard.01:30
fsmithredstackexchange says cat /proc/1/exe but the output is ugly01:30
onefangfsmithred: check if init is really init or a symlink to some systemd shit01:30
onefangfsmithred: on debian: /sbin/init -> /lib/systemd/systemd01:30
onefangIs what he said.01:30
fsmithredoops. stackexchange says 'stat /proc/1/exe' which gives nice output.01:32
fsmithredHere's the reasoning they give: "The init process is always assigned PID 1. The /proc filesystem provides a way to obtain the path to an executable given a PID."01:33
fsmithredwhen would /proc not be mounted?01:34
systemdletecan we reliably count on /proc being mounted?01:34
systemdleteidk, solaris (illumos?)01:34
freemis systemd portable, now?01:34
fsmithreddoes solaris have systemd now?01:34
systemdleteno idea.  What does it matter?01:34
systemdleteif it is not mounted, the test fails no matter what01:35
systemdleteso then you have to redirect stderr, etc01:35
freemwell, you can already filter any non-linux kernels: they won't have systemd AFAIK01:35
freemthen filter out muslc as IIRC systemd can't compile without GNU extensions01:35
systemdleteagain, hoping for a universal, one-stop mechanism01:35
systemdlete*hoping*01:35
systemdlete(only hoping, ok?)01:36
systemdleteI think all of you have made some helpful suggestions01:36
freemsystemd requires dbus... so there may be a way to ask dbus01:36
freemif no dbus, no systemd, and if dbus, ask dbus01:36
systemdletewhat if a system doesn't have dbus; same problem as with /proc01:36
freemit's impossible01:36
freemsystemd *requires* dbus01:36
fsmithredthat wont work on my no-dbus builds01:36
systemdleteprobably freem01:36
onefangYou want a "isthishitstemd" command, and not happy with a two line shell solution you could stuff in a script called isitshitstemd?01:37
freemfsmithred: is it actually possible to run systemd as PID1 without dbus?01:37
systemdleteonefang, exactly *who* would be doing the stuffing?01:37
fsmithredfreem, I've never tried it with debian01:37
onefangThe people that need this function.01:37
systemdleteonefang, so all the package maintainers then?01:38
freemI thought systemd had a super hard dep on dbus because it needs it to communicate with daemons?01:38
* systemdlete not so sure they will like that...01:38
freemhttps://lists.freedesktop.org/archives/systemd-devel/2025-January/051066.html01:38
systemdletefreem, only with daemons?  What about all the ghouls and apparitions it launches itself?01:38
freemso, it is actually possible...01:38
freemlol01:38
systemdletelol01:38
onefangThe point I'm making is you seem TOO focused on a simple command when a slightly more complex one will do the trick.01:39
freem"It uses a peer-to-peer dbus socket – i.e. not so much a 'dbus server' but a01:39
freemdirect unix socket that happens to speak the dbus protocol. This is placed01:39
freemat /run/systemd/private and is restricted to root only "01:39
freemthat seems a sane way to detect if systemd is running?01:39
systemdleteonefang, I am thinking about adoption, acceptance, etc.01:39
onefangWhat is so hard about checking a symlink?01:39
freemthis is dated from 2025, so I guess it's fresh enough01:40
fsmithredwhy do package maintainers need to know this?01:40
systemdleteso far, I think fsmithred's suggestion of cat /proc/1/comm makes the most sense, with stderr directed to null and testing the output.  That could be done ONCE at the top of a script (or a dotted-in script) and then tested as a variable01:40
systemdletefsmithred, because many of them rely on systemd to launch various tools, say, postinst01:41
systemdletes/many/some/01:41
systemdleteso I am thinking thus:01:42
systemdleteIS_SYSTEMD=$(cat /proc/1/comm 2>/dev/null)01:42
fsmithreddo any of those packages currently provide both init scripts and systemd service files?01:42
freemI wish people would stop run scripts for things that could be handled by splitting the package between: realprogram, realprogram-systemd, realprogram-other01:42
systemdletethen later on in the script01:42
freemwould make things so much easier... for everyone.01:42
systemdletetest "$IS_SYSTEMD" == "systemd" (or maybe != as the case requires)01:43
systemdletefreem, I wish systemd wasn't.  period.01:43
freemwell, on this I am more mixed. And that does not removes the fact that having services starting automatically because you needed it to toy, is annoying as heck01:43
freemI have no love for sysVinit+rc.d as it was done in debian before, really.01:44
freemand the noise around systemd made me aware that alternatives exists :)01:44
systemdletesimplest of all is to get all distros to add a field to /etc/os-release for init type01:46
freemgood luck with this01:46
systemdletebut that would require getting all the distros on board.01:46
fsmithredhow do they know?01:46
systemdleteyeah, really freem01:46
systemdletefsmithred, that was just me dreaming.  Ignore...01:46
fsmithredand if you have more than one installed, os-release would need to edited at boot01:46
freemeven if they were aware, many would refuse because "just use systemd and shut up"01:47
systemdletefreem, yep01:47
systemdletesadly01:47
systemdleteit's all about the oligarchy today.01:47
systemdletewhat they say is the TRUTH and no one may question it, ever01:47
systemdletebut this is getting a little OT01:47
fsmithreddon't invent this tool. Some maintainers will use it to detect non-systemd and hose the system for you.01:47
systemdletehahaha01:48
systemdletethey would, too!01:48
fsmithrednah, they just drop the init scripts from the package01:48
systemdleteI've seen that too--I was using bareos (nee bacula) for years and suddenly their packagers decided to stop including the init scripts01:49
freemI smiled at those people using systemd for embedded... considering the amount of RAM the shit uses, can this really be called "embedded"?01:49
systemdlete(but it was when they wrecked my backup system completely that I was done with them.  restic all the way now...)01:49
systemdletesure it can01:50
systemdletethe root of the word "embedded" is "bed," right?  so having all that crap running eating up the system should slow it down to where it almost seems to be asleep01:50
freemnice one01:50
* systemdlete really reaching there...01:50
systemdletethx01:51
freemI should join embedded world soon01:51
plasma41If systemdlete returns, please let them know that '[ -d /run/systemd/system ]' is, as far as I'm aware, a reliable check for a running systemd.09:27
plasma41As an example, I used this exact check this week in my patchset submission to the snapper package: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=7;bug=976888;filename=v2-1007-Make-cronjobs-defer-to-systemd-timers.patch;msg=2209:28
AlverstoneUsing btrfs with zlib:9 compression has significantly improved performance over ext4 in my virtual machines, due to fewer I/O on quite slow external disks.13:06
eyalrozAn interesting discussion on HackerNews regarding a NixOS-like, systemd-free distribution:14:49
eyalrozhttps://news.ycombinator.com/item?id=4288472714:49
eyalrozOne popular comment is "Can anybody explain to me again why systemd is so bad ?"...14:49
n4diri sure can't remember anymore why i decided against it14:50
Alverstonewhat's so complex? i need an init system, systemd isn't an init system, period14:51
eyalrozSince the initial debates about this last decade, is there a more up-to-date web page or article one could direct users to, which considers how systemd has changed over the years, in the arguments against it?15:11
eyalrozAnyway, @Alverstone, I made the argument that it's been like "Stone Soup", if you know that folk tale; with the init system replacement being the stone put in the pot.15:12
djphexcept that one was about community coming together and making something better15:26
al1r4dn4dir, me too15:41
freem<n4dir> i sure can't remember anymore why i decided against it15:45
freemMemory usage is *huge*. You need to learn stuff that is only useable for systemd. Critical network IT flaws in PID1. Can not compile (could not, at least, for long) with a standard C library. Lack of clear goals lead to bloat and complexity and bugs, in PID1.15:45
freemProbably one of those :)15:46
gnarfacethis is not really a support topic15:47
gnarfaceeyalroz: save it for #devuan-offtopic15:47
eyalrozgnarface: Oh, sorry. I actually forgot that channel exists...16:20
NICADAnyone here running a hybrid Desktop with integrated graphics on the Mobo and a separate Radeon card?22:19
NICADIs there any way to force Xorg to use my Radeon card instead of the integrated Matrox card on my Motherboard?22:27
debdogelaborate! laptop?22:31
Alverstoneiirc xorg.conf allows choosing video card, I'd check arch wiki maybe for details22:33
NICADNo. A desktop computer. The motherboard has an integrated graphics chipset, but I want to use the separate Radeon card that I've installed.22:34
NICADUsing Devuan here.22:34
NICADThe Kernel and drivers all see the Radeon card just fine. No errors. But for some reason Xorg still keeps defaulting to the Integrated graphics.22:35
NICADThe Radeon card has a DVI-I connector, while the integrated Matrox one just uses a VGA.22:36
Alverstonehttps://bbs.archlinux.org/viewtopic.php?id=24340222:52
AlverstoneThe logic should be the same22:52
fsmithredNICAD, doesn't your motherboard let you change the order of the vid cards?22:57

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!