News for hackers. Stuff that matters.
Re:What FreeBSD can offer compared to other operating system... by jiripospisil on Wednesday June 08, 2022 @07:46AM (#31665930)
To suggest that writing a shell script is superior to declaratively specifying what binary to run is just plain ridiculous.
Re:What FreeBSD can offer compared to other operating system... by marginalia_nu on Wednesday June 08, 2022 @08:58AM (#31666594)
My experience with declarative set-up tools ranging from systemd to gradle to kubernetes is that they're amazing as long as you don't have any sort of problem.

If you do have a problem, you invariably find yourself in a byzantine hell maze where you are celebrating if you manage to find a cryptic error message (often you aren't even entitled to that). It can be incredibly nasty to debug as there is no actual code to step through, nothing to reason about. There is no where it went wrong.

Re:What FreeBSD can offer compared to other operating system... by Saint_Genet on Wednesday June 08, 2022 @08:57AM (#31666584)
I feel a lot of the points in the article boils down to "it's not what I'm used to". I mean, that's totally fine as an argument for not switching away if you already run FreeBSD, but not so much as an argument for switching to it.
Re:What FreeBSD can offer compared to other operating system... by trasz on Wednesday June 08, 2022 @08:02AM (#31666024)
A shell script _is_ a way of specifying what binary to run. It's just that it's standardised and relatively well thought-out, as opposed to one-off hacks, like with systemd.
Re:What FreeBSD can offer compared to other operating system... by nerdponx on Wednesday June 08, 2022 @08:28AM (#31666267)
Maybe if it was in Lua or Scheme. But Bourne shell script is a nasty messy language.

Pretty much the only thing about shell scripting that is useful and not easy to do in other languages is input/output redirection and piping. Service managers should take care of things like figuring out where stdout and stderr logs are sent to, so you shouldn't have to do that stuff in your service scripts.

Thus there is no benefit to shell compared to other languages / formats, and there are a lot of problems with shell scripting otherwise.

Re:What FreeBSD can offer compared to other operating system... by trasz on Wednesday June 08, 2022 @09:26AM (#31666981)
>Service managers should take care of things like figuring out where stdout and stderr logs are sent to, so you shouldn't have to do that stuff in your service scripts.

You don't have to. The fact that Linux had anachronisms like that wasn't because of shell scripts, it's an entirely orthogonal issue; a typical rc script in, say, FreeBSD, looks like this: https://github.com/freebsd/freebsd-src/blob/main/libexec/rc/.... It's declarative, it's easy to understand, but it also provides you with flexibility when you need it, as opposed to one-off hacks with custom, fixed functionality and random syntax.

Re:What FreeBSD can offer compared to other operating system... by nerdponx on Wednesday June 08, 2022 @09:38AM (#31667148)
You're justifying my point! There is no reason (other than historical) why this should be a Bourne-flavored shell script compared to any other scripting language. You could just as well write this in Lua or Scheme. Even the fact that there is runtime information embedded in the comments should be a big red flag that the wrong tool was chosen for this purpose.
Re:What FreeBSD can offer compared to other operating system... by marginalia_nu on Wednesday June 08, 2022 @11:03AM (#31668386)
To be fair, you can just change the hashbang and write your start up script in lua instead if you have an axe to grind with sh for some reason.
Re:What FreeBSD can offer compared to other operating system... by trasz on Wednesday June 08, 2022 @11:37AM (#31668946)
Yes - except you can't really expect anyone to know Lua or Scheme, while you can assume every even remotely competent Unix/Linux system administrator or power user to know sh(1).
Re:What FreeBSD can offer compared to other operating system... by ungamed on Wednesday June 08, 2022 @08:11AM (#31666117)
I find that shell scripts feel like the hack compared to systemd startup scripts.
Re:What FreeBSD can offer compared to other operating system... by bigpeopleareold on Wednesday June 08, 2022 @08:38AM (#31666374)
Possibly. But, FWIW, this was posted a few days ago and it was good at explaining the design decisions in NetBSD's rc system over earlier versions that FreeBSD uses as well (there are a few differences): https://news.ycombinator.com/item?id=31637755.
Re:What FreeBSD can offer compared to other operating system... by nerdponx on Wednesday June 08, 2022 @08:21AM (#31666199)
This is a big sticking point for me when evaluating other init systems / system service managers. There are a lot of weird and bad things about Systemd, but the declarative service file format is a big plus to me.
Re:What FreeBSD can offer compared to other operating system... by ape4 on Wednesday June 08, 2022 @09:05AM (#31666698)
Indeed, and with systemd you can ExecStart=myshellscript if you want