| ▲ | jjgreen 8 hours ago |
| I've been almost convinced by systemd (and have switched to using it), but God the syntax of those service files is so ugly ... |
|
| ▲ | zamadatix 5 hours ago | parent | next [-] |
| Never thought I'd see hackers saying INI format looked ugly of all things. It's basic, sure, but that's a good thing for something meant to be easily editable by hand from any editor. Otherwise, it's just key value pairs in named sections, how ugly can it be about that? |
| |
| ▲ | 5 hours ago | parent | next [-] | | [deleted] | |
| ▲ | jjgreen 5 hours ago | parent | prev | next [-] | | key-value pairs where the = cannot be surrounded by spaces, so I have to write [Service]
Type=oneshot
WorkingDirectory={{ home }}/current/
Environment=RAILS_ENV=production
ExecStart=/bin/sh -lc "bin/db-backup --verbose"
which fills me with sadness | | |
| ▲ | voxic11 4 hours ago | parent | next [-] | | Whitespace immediately before or after the equals sign is completely ignored by the parser. Its the standard INI format. | |
| ▲ | yjftsjthsd-h 5 hours ago | parent | prev [-] | | What? You absolutely can have spaces; most of mine look more like [Service]
Type = oneshot
WorkingDirectory = %h/current/
Environment = RAILS_ENV=production
ExecStart = /bin/sh -lc "bin/db-backup --verbose"
| | |
| ▲ | jjgreen 4 hours ago | parent [-] | | Friend, you have changed my life | | |
| ▲ | bblb 13 minutes ago | parent | next [-] | | My epiphany a month ago was that I can use Environment = MULTIPLE=environment VARIABLES="in single line"
| |
| ▲ | weavie 3 hours ago | parent | prev [-] | | Is this one of those cases where at one point you had an error in the file and you figured it was down to spaces? You fixed that issue, it still didn't work but from that point you never thought to question the assumption. I find myself doing this sort of thing all the time.. | | |
| ▲ | jjgreen an hour ago | parent | next [-] | | Somewhere in my head I had that spaces caused a syntax error, and the UI for systemd is not obvious when you first start using it ... so if it's working then leave well alone. I'll be making all of my .service files (not so many) human-readable in the near future! | |
| ▲ | troyvit 3 hours ago | parent | prev [-] | | That was (cough still is) ddclient for me. |
|
|
|
| |
| ▲ | ramon156 4 hours ago | parent | prev [-] | | TOML would look a lot more quiet, but I'm not sure if TOML would be a good fit | | |
| ▲ | kevinmgranger 4 hours ago | parent [-] | | unit files barely have any nesting, so the INI-like format is already 90% of the way towards TOML, no? |
|
|
|
| ▲ | mrweasel 5 hours ago | parent | prev | next [-] |
| There's definitely some weirdness to certain parts of systemd service files, but was a huge improvement over Upstart and the old SysV-style init scripts. Over all I think Systemd get way to much criticism. You don't have to use all the parts, but if you care to go through the documentation you'll find interesting features such as journald log-shipping and systemd-machined which can manage containers and VMs. |
|
| ▲ | egorfine 2 hours ago | parent | prev | next [-] |
| As a passionate systemd hater I would say I do not agree. Cron syntax is worse. |
|
| ▲ | SEJeff 5 hours ago | parent | prev | next [-] |
| Oh yes, because the well documented clean syntax of sys v init shell scripts was so nice. If I never recall hacking in ulimit calls in the top of buggy shell scripts for crappy old services that done respect pam_limits it won’t be soon enough. |
|
| ▲ | linsomniac 4 hours ago | parent | prev | next [-] |
| Hard disagree. Compared to an init script, with all its boilerplate, I'd take a systemd unit file. |
|
| ▲ | WesolyKubeczek 5 hours ago | parent | prev | next [-] |
| Could have been worse. Could have been YAML. Could have been XML. |
| |
| ▲ | silvestrov 5 hours ago | parent | next [-] | | XML would have the advantage of having a grammar so we could validate the config files. It would also make it much simpler to make good GUI editors for the files instead of the Notepad approach most unix config files take. | | |
| ▲ | pwdisswordfishq 4 hours ago | parent | next [-] | | The systemd dialect of INI is actually pretty well-defined though. https://www.freedesktop.org/software/systemd/man/latest/syst... | |
| ▲ | 5 hours ago | parent | prev | next [-] | | [deleted] | |
| ▲ | WesolyKubeczek 5 hours ago | parent | prev | next [-] | | Since systemd is successfully parsing its INI files, and barks at you when you put weird shit into them, a grammar for them does exist as well. XML is that wonderful format that gave us vulnerabilities like death by million laughs, up to a certain moment, you could MitM DTDs, and a whole slew of everything-XML stuff back when XML was like AI is today, none of which I miss today. Oh, and remember times when programmers would argue whether argument order in XML files should be significant or not? But XML books with their idealized XML future description did give me the same warm fuzzies as some intricate clockwork mechanism to a Victorian geek. | |
| ▲ | Juliate 5 hours ago | parent | prev [-] | | There are good GUI editors for XML? |
| |
| ▲ | jjgreen 5 hours ago | parent | prev | next [-] | | To be honest, I think either of those would have been better ... | | | |
| ▲ | Tsiklon 3 hours ago | parent | prev | next [-] | | XML - I see you’ve used macOS’ LaunchD, the system that inspired Systemd | | |
| ▲ | WesolyKubeczek 14 minutes ago | parent [-] | | Yeah, I'm a man of culture like this. However, systemd with its service dependencies runs circles around launchd in pretty much every aspect. |
| |
| ▲ | wpm 4 hours ago | parent | prev [-] | | Could have been better. Could have been XML Property Lists. ducks |
|
|
| ▲ | whateveracct 5 hours ago | parent | prev [-] |
| This is why I like NixOS. Defining systemd services in it is very neat. |