News for hackers. Stuff that matters.
Re:GNU Mcron by otterley on Saturday May 05, 2018 @12:39PM (#17002533)
Do you have substantive feedback about the systemd timer implementation, or are you just here to shitpost?
Re:GNU Mcron by nimbius on Saturday May 05, 2018 @12:53PM (#17002587)
no, the poster is citing well documented historical evidence that systemd reinventions of traditional posix compliant unix/BSD/Linux services arrive as a horrendously complex mess of overcomplicated code.

take oddjobd for example, which supplants pam_mkhomedir.so in creating a users home directory on first login. oddjob is its own standalone daemon running constantly, while pam_mkhomedir is invoked only as necessary. oddjob needs dbus and systemd to complete what in many systems is just a simple mkhomedir && chown user:grp $homedir. its now fully dependent on the most fundamental building blocks of your OS to do one simple thing.

this also assumes the user doesnt have a home directory...which...many do.

in most commercial infrastructure if you suggest installing oddjobd to handle the potential for a user to log in without their home youll be laughed out of the chat. oddjobd forces organizations back into the 1980s and NIS based implementations of federated authentication where you had to go to a new user machine, or an account creation machine first if you dont want to run yet another idle daemon on your machine

Re:GNU Mcron by userbinator on Saturday May 05, 2018 @01:00PM (#17002622)
Another memorable example is systemd's DNS resolver which somehow has to involve XML parsing/unparsing just for a simple hostname lookup: https://lists.dns-oarc.net/pipermail/dns-operations/2016-Jun...
Re:GNU Mcron by otterley on Saturday May 05, 2018 @01:44PM (#17002806)
What does systemd-resolved have to do with systemd's timer implementation? It's possible to agree that the resolver implementation is problematic, while other parts of the ecosystem are reasonably good.
[dead]
Re:GNU Mcron by dang on Sunday May 06, 2018 @03:04PM (#17007809)
This breaks the site guidelines badly, particularly the ones about civility and avoiding shallow dismissals. We ban accounts that post like this (regardless of how wrong someone else might be), so please read https://news.ycombinator.com/newsguidelines.html and follow the rules from now on.
Re:GNU Mcron by userbinator on Saturday May 05, 2018 @01:23PM (#17002726)
Wow. Perhaps you should read through this and then reconsider who is "technically illiterate":

https://news.ycombinator.com/item?id=14652787

Re:GNU Mcron by wereHamster on Saturday May 05, 2018 @12:58PM (#17002608)
> the poster is citing well documented historical evidence

I don't see any of that citation. Or evidence.

Re:GNU Mcron by dig1 on Saturday May 05, 2018 @01:10PM (#17002659)
For evidence, use the source Luke ;) systemd has plenty of reinvention evidences...
Re:GNU Mcron by otterley on Saturday May 05, 2018 @01:17PM (#17002691)
What does this have to do with systemd, exactly? This sounds like a rant that is only tangentially related, and demonstrates that you don't know why oddjobd exists (specifically to provide an encapsulated means by which unprivileged processes can safely perform privileged operations).

Just because you deem something overly complicated doesn't mean that it doesn't serve a practical purpose.

Re:GNU Mcron by parenthephobia on Saturday May 05, 2018 @02:58PM (#17003211)
oddjob isn't part of systemd and doesn't use systemd.
Re:GNU Mcron by liveoneggs on Saturday May 05, 2018 @01:19PM (#17002699)
systemd is attempting to take over unix just like gnome has always been trying to turn linux into GNOME-OS. It's all just a matter of having people with no taste given too much influence.
Re:GNU Mcron by qbrass on Saturday May 05, 2018 @04:42PM (#17003693)
The main code contributor to both projects is Red Hat.
Re:GNU Mcron by liveoneggs on Saturday May 05, 2018 @07:23PM (#17004427)
exactly. Ever used jboss? :)
Re:GNU Mcron by DC-3 on Saturday May 05, 2018 @12:53PM (#17002588)
Their point is a valid one though. I don't really think the init process is the right place for timers.
Re:GNU Mcron by derefr on Saturday May 05, 2018 @01:40PM (#17002788)
Maybe you've never tried to optimize an OS for battery life on mobile devices, then. There needs to be one place that timers happen—ideally the kernel, but a "userland kernel adjunct" like systemd is fine too—in order to be able to coalesce all the timers on the system (except for real-time ones) along some granularity scale.

You don't want to go to all the effort to spin up a CPU core to schedule a (cron) process thread, just to find out it has no work to do. Ideally, if you're going to check the time at all, you just want it done in one thread running on one core, so that the rest of the cores can stay asleep and you never have to spend energy context-switching when idle.

That being said, systemd isn't quite the right architecture for getting down to a "tickless everything" system. That'd be something more like WinNT's kernel timer object API, where the kernel sends an event to your window's or service's message inbox to wake you up when the timer is done; or macOS's "Grand Central Dispatch", where any native code (including non-Foundation POSIX code!) can pass scheduling control of any async block through a Mach trap over to one central scheduling process, which coalesces both timers and the runtimes of async events in general so that all background CPU activity happens in bursts with idles in between.

Re:GNU Mcron by theamk on Saturday May 05, 2018 @04:42PM (#17003697)
In my cronjob, I like to log the target process output, and ensure that only one timer jobs runs at a time, and apply resource limits, and have an easy way to know if the job is still running.

Right now, I am doing this all with a mess of shell scripts (flock + logger + echo calls + pgrep). This is fragile and ugly.

Since systemd provides all of the above easily, a better approach will be one-off systemd jobs. In this case, my crontab entries would be a trivial -- "1 3 * * * root systemctl start cronjob1". This only requires scheduling functionality -- background execution, env vars, email notification and other things no longer matter.

From there, it is just one small step to move scheduling into the init process itself -- after all, compared to what other things init does, scheduling is both simple and safe.