infeeeee ( @infeeeee@lemm.ee ) 36•4 months agoThey have an example service on the website:
(define sshd (service '(sshd ssh-daemon) ;the secure shell daemon #:start (make-inetd-constructor ;start on demand '("/usr/sbin/sshd" "-D" "-i") (list (endpoint (make-socket-address AF_INET INADDR_ANY 22)) (endpoint (make-socket-address AF_INET6 IN6ADDR_ANY 22))) #:max-connections 10) #:stop (make-inetd-destructor) #:respawn? #t)) (register-services (list sshd)) (start-in-the-background '(sshd))
Let’s see how the same service looks like with systemd:
[Unit] Description=OpenSSH Daemon Wants=sshdgenkeys.service After=sshdgenkeys.service After=network.target [Service] Type=notify-reload ExecStart=/usr/bin/sshd -D KillMode=process Restart=always [Install] WantedBy=multi-user.target
I have some lisp knowledge, so the scheme version doesn’t look frightening to me, but I guess for sysadmins, who should write these kind of files frequently systemd’s TOML like language is much more easier to understand.
Some differences I see: Shepherd does some firewall management with ports, and I don’t see the services it depends on.
Why this kind of files should be written in a programming language at all? I guess it’s a remnant from the old times, but I like when tools abstract away the programming parts, and users shouldn’t have to deal with that. I like the same thing in docker-compose: I can configure a program whatever language it’s written, I don’t have to deal with what’s happening under the hood.
I guess there is some usefulness with defining services as code, if you need more complex situations, but it should the more rare case nowadays.
deadcream ( @deadcream@sopuli.xyz ) 11•4 months agoSome differences I see: Shepherd does some firewall management with ports, and I don’t see the services it depends on.
That looks like it sets up sshd to start when someone connect to its port, not on boot. You can do the same with systemd, but you need additional .socket unit that will configure how .service unit is activated.
Why this kind of files should be written in a programming language at all? I guess it’s a remnant from the old times, but I like when tools abstract away the programming parts, and users shouldn’t have to deal with that
Systemd invents its own configuration language (it looks like ini but there no standard for that and systemd’s flavor is its own) so you still need to learn it.
infeeeee ( @infeeeee@lemm.ee ) 13•4 months agoSystemd invents its own configuration language (it looks like ini but there no standard for that and systemd’s flavor is its own) so you still need to learn it.
Yeah, but it’s much more straightforward and less exotic than scheme. But I guess this type of configuration fits perfectly in Guix, where everything is already configured similarly.
JustEnoughDucks ( @JustEnoughDucks@feddit.nl ) 5•4 months agoYes but as a somewhat layperson (electronics engineer and light firmware design, and some hobby sysadmin stuff), I can learn systemd’s “language” in 30 minutes and most attributes are so self evident that you can puzzle them together without learning the language at all.
That Shepherd mess I would have no idea what to change to make a small tweak without spending hours and hours learning it because it is written extremely cryptically in comparison.
It’s the difference between modifying a config with human readable names and having to go into the source code to change heavily abbreviated variables that require a lot of background knowledge to even read.
Possibly linux ( @possiblylinux127@lemmy.zip ) English4•4 months agoLeave it to the community to do something in Lisp. That language should’ve died 20 years ago.
I have some lisp knowledge, so the scheme version doesn’t look frightening to me, but I guess for sysadmins, who should write these kind of files frequently systemd’s TOML like language is much more easier to understand.
People who only know C-style languages tend to struggle with anything that deviates from that too (which is a lot of developers). The Shepard example looks readable to me, but then I’m a Emacs user and have learned a few languages with “weird” syntax so something that looks a bit different is fine.
Why this kind of files should be written in a programming language at all? I guess it’s a remnant from the old times, but I like when tools abstract away the programming parts, and users shouldn’t have to deal with that
It’s user base is akin to the NixOS audience. It’s more aimed at advanced users and sysadmins (with some programming ability) that want to configure their whole system declaratively. Using a real programming language gives a lot of power and flexibility to achieve this that you’d effectively have to create a new language to replicate that (I.e. Nix or Guile).
On the other hand, something like Shepard is potentially overkill for even Nix and Guix. Nix works quite well as a layer on top of systemd to declare a NixOS system, and still gives you enough power to do most things.
And from GNU: https://www.gnu.org/software/shepherd/
To be clear, this is mainly intended to be used with Guix which is a package manager and OS akin to NixOS but written in Guile Scheme.
GolfNovemberUniform ( @GolfNovemberUniform@infosec.pub ) English1•4 months agoHow is it different to runit or openrc?
Magiilaro ( @DarkMetatron@feddit.org ) English4•4 months agoIt has a different name and is written in Guile
GolfNovemberUniform ( @GolfNovemberUniform@infosec.pub ) English3•4 months agoOk so it’s basically a yet another point of fragmentation. Nice.
MadhuGururajan ( @MadhuGururajan@programming.dev ) English1•4 months agoRolls eyes