Hacker News new | past | comments | ask | show | jobs | submit login

Not OP.

I my experience, systemd config is simple because it handles all the complexity. Inside it’s guts, it is much more complicated than a sysv system — naturally so because it can do so much more. Those folks loves using the latest and greatest kernel function for all its glory.

All works well - until it don’t. When something is broken, suddenly you have to understand all the interdependent components to debug.

Back in the days, these were not so uncommon, because bugs or simply unimplemented features………




Agree with that. It breaks catastrophically.

But it's also overengineered. Like starting a daemon on first connect is "neat trick", but should never have gone beyond that.

Like: oh, I want to restart this daemon, because I want it to re-run its init code (possibly with new settings), but you CAN'T, because some idiot decided that it'll only actually start when someone connects to its unix socket, so running "restart" is a no-op.


> but you CAN'T, because some idiot decided that it'll only actually start when someone connects to its unix socket, so running "restart" is a no-op.

FTA:

> It can then boot your service on the first request, or you can do systemctl start lunchd yourself if you think that would take a while.


You can, but it doesn't. If I know I want to start it I can just connect with the client.

Sounds like you're arguing something like "yes, it's broken. But you can just reimplement everything and it won't be broken anymore".

Yes, I can also turn off "kill user processes on logout", but that doesn't make that not-broken.


No, I'm arguing there's a way to force-start even socket-activated services.

But this is really a moot point. Systemd's socket activation is really meant for system services which would otherwise be in the critical path of system boot. 'Regular' client-facing services that people normally run–webapps, etc.–are not really the target use case. It's fine to start them up in the normal way, with WantedBy=multi-user.target in the [Install] section. And I have never seen people use socket activation for them anyway. So you are basically arguing a strawman here.


> So you are basically arguing a strawman here.

gpsd is an example that immediately comes to mind that was set to start on-demand. Which is ridiculous.

So it's a straw man that actually exists, making it not a straw man.


Starting a daemon on first connect is essential for fast boot times of a system with multiple dependent network services. This is mostly a desktop use case though. Not sure if it can be disabled for servers.


But I would also like to see data showing how often desktop users reboot (on purpose, that is, not because systemd or something says "you should reboot now" because it's shitty software that doesn't just work cross updates).

Like, who even boots their computer anymore? Isn't the typical user on a laptop, and just suspends it?

My workplace even had to install corp software that forces a reboot every N days (with warnings ahead of time) because people just Do. Not. Reboot.

And even for the people that do, at what cost, here? You have a bunch of services and services completely broken, but "they started just fine" (except they didn't start), and only break once you actually need them.

So to me this really looks like it applies neither to servers nor desktop. I'm really not seeing any use case except fetishizing boot times.

And for me this always SPENDS human wait time, not save it. I try to use a service, and nope, it needs to "boot up" first. Could you not have done that already, WTF? (and maybe it fails to boot, which I only find out about now that I'm already in the zone to use it)

Are we really optimizing for kernel developers, here? Can't they just disable the services they don't need, to speed it up?

And we have eleventy billion cores now. Really? You can't start a 645kB gpsd? It takes what, 3ms?


> So to me this really looks like it applies neither to servers nor desktop.

It applies to both. We need desktops to boot up fast, because you said it yourself, sometimes they just need to. And no one likes waiting around for their machines to boot. Can you imagine the volume of complaints about long boot times that would come in to large-scale distros from annoyed users? That alone makes it a high priority.

And on top of that, we need servers to boot up fast, because nowadays they're virtualized and started/stopped constantly when services are scaled up and down. Can you imagine trying to scale up a fleet of servers and waiting a couple of minutes for each one to boot?


> We need desktops to boot up fast, because you said it yourself, sometimes they just need to

I didn't say that. Because they don't.

> And no one likes waiting around for their machines to boot.

Nobody cares, if it's once for every month or two. Which it is.

> we need servers to boot up fast

But it's not actually booted until the service is up, so it's moot.


> I didn't say that. Because they don't.

Yes, you did. Here's a refresher:

> My workplace even had to install corp software that forces a reboot every N days (with warnings ahead of time) because people just Do. Not. Reboot.

I.e. sometimes computers just need to reboot, and there's nothing you can do about it.

> Nobody cares

If nobody cares, then why do people hate rebooting so much?


> I.e. sometimes computers just need to reboot, and there's nothing you can do about it.

And this is the attitude that brings us shitty software, and "I dunno, just reboot to fix the problem?", which is what we have now.

Short of kernel upgrades they really really don't.

But if you've bought in to "oh computers just need to reboot sometimes", then I guess you fall into the category of people who have just given up on reliable software, or you don't know that there is an alternative and no this was not normal.

>>> We need desktops to boot up fast, because you said it yourself, sometimes they just need to

>> I didn't say that. Because they don't.

> Yes you did[…] > people just Do. Not. Reboot.

So is that what I said? I believe you did not read what you quoted.

The main reason people reboot is because of shitty software that requires reboots. So if you want to go self-fulfilling prophecy, then systemd is optimizing for boot times because it's low quality software that requires periodic reboots?

But maybe you count forced reboots once a month (or every two months) for kernel upgrades (but also the above arguments since they also run systemd and therefore need reboots). Fine.

So in order to save ten seconds per month (from a boot time of a minute or so, including "bios" and grub wait times, etc.., so not even a large percentage) this fd-passing silently breaks heaps of services, wasting hours here and there? And that's a good idea?

And all for what? Because you chose to have installed services you don't need, and don't use? And if you do use them, then the time was not saved anyway, but just created a second wait-period where you wait for the service to start up?

And ALL of these services could in any case be fully started while you were typing your username and password.

So what use case exactly is being optimized? The computer was idle for maybe half the time between power-on and loaded desktop environment anyway.

> If nobody cares, then why do people hate rebooting so much?

Because all their state is lost. All their open windows, half-finished emails, notepad, window layout, tmux sessions, the running terminal stuff they don't have in tmux sessions, etc… etc…


> And ALL of these services could in any case be fully started while you were typing your username and password.

This is the key point you are refusing to hear. No, all of the services on a modern Linux machine can't be started while you're typing in your credentials. So they're started lazily, on-demand, one of the classic techniques for performance optimization and a hallmark of good engineering.


Of course they can. How many services do you they there are, installed, and how long do you think it takes to start them?

How long do you think it takes to start gpsd, or pcsd? Even my laptop has 12 CPU threads, all idle during this time. And including human reaction time (noticing that the login screen has appeared) this is, what, 10 seconds? 120 CPU-seconds is not enough? All desktops run on SSD now too, right?

In fact, how many services do you even think are installed by default?

And Linux, being a multitasking OS, doesn't even have just that window.

But you know, maybe it's a tight race. You could try it. How long does it take to trigger all those?

> a hallmark of good engineering.

In the abstract, as a "neat idea", yes. In actual implementation when actually looking at the requirements and second order effects, absolutely not.

You know you could go even further. You could simply not spin up the VM when the user asks to spin up a VM. Just allocate the IP address. And then when the first IP packet arrives destined for the VM, that's when you spin it up.

That's also a neat idea, and in fact it's the exact SAME idea, but it's absolutely clearly a very bad idea[1] here too.

So do you do this, with your VMs? It's cleary "started lazily, on-demand, one of the classic techniques for performance optimization and a hallmark of good engineering".

[1] Yes, very specific environments could use something like this, but as a default it's completely bananas.


> But it's not actually booted until the service is up, so it's moot.

With per second billing, fast boot times save money and enable lower fixed capacity, further lowering cost.


But no it doesn't. Until your service is started, your service is NOT actually booted. That's what I said.

You are not paying per-second for the VM. The VM itself adds zero value to you. It's the service that's running (or in this case, not) that you're paying for.

Who cares how long it takes before systemd calls listen()? Nobody derives value from that. You're not paying for that. You're paying for the SERVICE to be ready. And if you're not, then why are you even spinning up a VM, if it's not going to run a service?

It's just clever accounting.


Starting services in parallel will reduce overall service start up time as well, even if services are dependent on each other, because services often do work before they connect to a dependent service. Without socket activation that is a race condition.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: