News for hackers. Stuff that matters.
Re:Why I dislike systemd by efaref on Monday June 15, 2015 @06:27AM (#9718497)
Reading a file is not even atomic - you can race with concurrent writes.

The only safe way to update a config file of a running service is with POSIX atomic rename, and most editors don't do that by default.

Re:Why I dislike systemd by pjc50 on Monday June 15, 2015 @06:38AM (#9718530)
If only the operating system maintained a tree-structured key-value configuration store with atomic updates, like the Windows registry.

(Even I'm not sure if this is sarcasm any more)

Re:Why I dislike systemd by bad_user on Monday June 15, 2015 @06:58AM (#9718579)
The Windows Registry is a dump on disk of some half-assed structures defined in a memory heap, poorly specified, being in essence a file-system as well. Also, only individual operations have been atomic and one update in the Windows Registry does not equal one update of an entire configuration file on Linux. Transactional support has been added, but late and interactions with it are still problematic. The Internet is filled with complaints and pieces of advice on corrupted registries.

And it is being obsoleted, with the elephant in the room being that the Windows Registry needs to be thread-safe because it's a central store of all settings and this was a really bad idea. I'll also have my nginx.conf over a registry entries file any day of the week.

Re:Why I dislike systemd by bad_user on Monday June 15, 2015 @06:35AM (#9718516)
That's true, that's why I said that it "can be". And if you have a special edit command, like "systemctl edit", then it can take care of the details for you, which is I presume the reason for its existence (much like visudo).