GNU Shepherd
gnu.org
gnu.org
I think GNU deserves much more support then it's getting.
It appears that you write to FSF and write out an evaluation proposal.
> other than adopting a GPL
Despite it's name, the GNU General Public License is a license for any software written by anyone. Licensing something under the GPL doesn't make your project a member of the GNU project, any more than licensing something with the MIT/X11 license make your project part of FreeDesktop, or BSD making your project one of Berkley's projects.
It's quite an elegant system and strikes the right balance (in my mind) between privacy and accountability for corporations. Also it piggy-backs on existing systems (operating through exchanges) and doesn't require proof-of-work. And the browser extensions are super easy to use (even easier than Flattr in some ways).
> I think GNU deserves much more support then it's getting.
I would recommend donating money to the FSF (if you have the means) and becoming a member. They are an incredible project doing awesome work and deserve the support. You also get free access to LibrePlanet conferences and a few other perks.
(register-services
(make <service>
#:provides '(apache-2.0 apache httpd)
#:requires '()
#:start (...)
#:stop (...)
#:actions (make-actions
(reload-modules (...))
(restart (...)))))
It not horrible, but I'm Not a huge fan of that, but maybe it will get much better as it matures.I now use req-package so I don't even have to download anything.
I do miss the old style of one file per "kind" though. Doesn't mean use-package is bad but somehow I like having a FS-level idea of my emacs config.
https://github.com/mitchty/dotfiles/blob/master/emacs.org
(actually i use org mode to compile all of my dot files based on predicates, i'm double plus weird here >.<)
I really rather like this way of working with things as it just sticks stuff into ~/.emacs.d/elpa. I can rsync that around if i need/want. And it even bootstraps itself if i'm opening things on a new system. I just like keeping each package in its own use-package declaration so I can have config+setup all in one spot.
I might try to make one from scratch using yours as an inspiration. Just to see how my mindset evolved along the years.
Aka I can customize my dot files based on if i'm going to a bsd/mac/linux box with(out)/nix/perl/haskell/git/whatever and have an easy way to copy things over the top of things or not.
I declared dot file bankruptcy a few years ago and this is my "perpetual penultimate dot file solution" (yes I'm making a joke at my own expense with penultimate here).
But this new setup is easily the most sane I've found so far. Most dot file management uses softlinks which sucks for rsyncing, or some hokey templating language.
All mine amounts to is just a stupid .el file that holds predicate definitions that just controls via stupid elisp when an org babel block gets tangled out into a file. Its pretty simple and straightforward. Wonder if I should do some sort of show and tell for it or not.
Good luck! Hope it helps or inspires something better.
Elsewhere people are saying it's just Scheme. I'm sure I could find a parser for that in Python, and maybe if I'm really lucky that parser will record whitespace and comment nodes, and have a reverse transformation, but do I really want to be writing error prone 20-line AST visitors just to tweak an integer setting? (No, I most certainly do not, and I consider design decisions like this a massive code smell that'd ward me off any further investigation of a system)
edit: downvotes? Is this really such a difficult concept?
edit 2: so apparently the big whoopsie was insulting the religion that is LISP. Yes, using a turing complete language for config syntax causes pain. Nobody does this stuff in the real world for a reason. Deal with it, meanwhile go back to obsessing over novelty code-is-data academic exercises on your obsolete Symbolics machines, you'll cause less damage that way.
Edit: downvotes are because you're sort of insulting Lisp (which is older than you and all your "best practices") with an ignorant complaint.
I recognized it as lisp right away, but I share the complaint about the format. If you want to write a lisp program then do so. If you want to format something for human readability it's probably a good idea to do it differently. This is just a opinion of course, but I suspect it's not an uncommon one.
Furthermore, anything that tricks you into learning Scheme is a good thing. Like eating vegetables.
Ignorant of the cave-dwelling depths some would go to ensure the practicality of the arcane religious icon that is LISP as a massively overgeneral solution to a problem, at the cost of all downstream users who must now "just switch to Guile" or link against chunks of a C compiler just to introspect a config? Maybe, but I'm content with that.
> Elsewhere people are saying it's just Scheme. I'm sure I could find a parser for that in Python, and maybe if I'm really lucky that parser will record whitespace and comment nodes, and have a reverse transformation, but do I really want to be writing error prone 20-line AST visitors just to tweak an integer setting? (No, I most certainly do not, and I consider design decisions like this a massive code smell that'd ward me off any further investigation of a system)
XML satisfies all the above: no AST visitors, no custom parsing routines, no attempting to solve the halting problem in order to introspect a simple scalar value.
What you're saying is that the same is "possible" with Scheme. At least one followup comment (finally) described an algorithm that would actually allow machine-driven file changes, but we're still left with rather than a working out of the box solution, a description of an algorithm that "might someday work" and that's not the sort of thing I want to be dealing with while building business solutions on somebody else's dime, which drives my conclusion above: this config file syntax is not for me, and my original comment explained precisely why.
EDIT: Complaining about downvotes and then going on a tirade about how Lisp users are cave-dwellers is not constructive. Personally I think your argument was a valid concern (and I just went to try to find a Scheme parser in Python to help you), but you're not helping your case.
Also, like it or not, but both of the most widely-used editors (emacs and vim) both have turing-complete "configuration" languages. By your statements, that would make the majority of programmers academic cave-dwellers (oh wait... :P).
https://insights.stackoverflow.com/survey/2017#technology-mo...
If you include full-blown IDEs in your definition of editor (which I think you should), Visual Studio was the most widely used editor among all the 19,772 people that responded to this question in the Stack Overflow Developer survey 2017.
Notepad++ was the second-most popular editor.
Sublime Text was the third-most popular editor.
Vim was the fourth-most popular editor.
Visual Studio Code, IntelliJ, Atom, Eclipse, Android Studio, PHPStorm, Xcode, NetBeans and PyCharm followed.
Emacs was the 14th-most popular editor.
Add far as AST visitors, you're probably better off with XPath/XSLT tree transformations. (Anyone know of a suitable library?)
On the other hand, the don't-swim-upstream approach would be to use one of the best programming languages in existence, Scheme, you do your config management tasks directly, rather than an arm's-length parse, modify, write approach.
That may sometimes be so, but only as a general consequence of "programming computers causes pain". You can do something complicated, which can have a bug; then someone comes along with a half-conceived thought like, "that solution shouldn't have been doble in the config language; therefore config language caused pain".
A non-computational config language also causes pain. Sometimes to the point that a Turing-complete language is used to generate a configuration. Then you have pains like "# this was generated ... don't touch!".
All these assuming you want to implement the thing yourself. Which is fine, S-Expressions are one of the easiest tree syntaxes to parse. But there are already libraries that can do this for you (including full Lisp/Scheme interpreters) and some of them can even 'pretty format' the code like the quoted snipped above.
So generally speaking this wont be a problem in practice.
$ cat my-config.xml
<root>
<!-- i am a comment -->
<thing attr="foo">
<!-- i am another comment -->
<setting>value</setting>
</thing>
</root>
$ cat c.py
import lxml.etree
doc = lxml.etree.fromstring(file('my-config.xml').read())
for setting in doc.xpath('.//thing/setting'):
setting.text = 'set without screwing up the file'
print lxml.etree.tostring(doc)
$ python c.py
<root>
<!-- i am a comment -->
<thing attr="foo">
<!-- i am another comment -->
<setting>set without screwing up the file</setting>
</thing>
</root>You will lose any comments like this though:
[user]
name = My Name ; that's my name!
Programming is hard in the face of arbitrary user data.It was my understanding that issue was best handled by having multiple files and having one take precedence over the other. Like having a global config that is pushed to the machine and allowing the user to locally override values set globally in the local config.
Another solution to multiple parties needing to define configuration for the same area without stomping all over each other would be to have a directory wherein all files contained therein are applicable. That way multiple people can maintain their own particular files but some precedence has to be established.
Even if you do need to do this I wouldn't think it would be that hard to modify lisp with lisp.
Nix has limited "Nix-expressions" which resulted in a bunch of bash scripts to get around the limitations, and Systemd ends up requiring C services or bash scripts because it has a limited INI-like syntax. On the opposite end, GuixSD is entirely configured, packaged, and maintained with Guile.
GCL: https://www.gnu.org/software/gcl/
CLISP: http://clisp.org/
#:foo is a keyword argument and '(apache httpd) is a quoted list containing the symbols apache and httpd.
Angled brackets have no special meaning, they are just part of the identifier.
'foo
(quote foo)
'(1 2 3)
(quote (1 2 3))
It basically does not evaluate its arguments but returns whatever it is. So instead of the value of foo, it the symbol foo. The list example does not evaluate it either, it would normally try to apply the first element as a function, but instead we get the list of numbers. (quote something)
Meaning: take whatever follows and leave it alone. Do not interpret it. If it's a list it stays a list (one of the main uses for this). The single quote ' is shorthand for that. It's meant to be an easier way to create a literal list (and other things) without escaping all the parts of a list that might be misinterpreted as symbols to evaluate (to values or functions).I think we can blame the use for lifetimes entirely on the Rusties.
(define xscreensaver (make <service>
#:provides '(xscreensaver)
#:start (make-forkexec-constructor
(list "/run/setuid-programs/xscreensaver" "-nosplash"))
#:stop (make-kill-destructor)))
(register-services xscreensaver)Guix uses #~ for G-expressions, for example.
Despite their similarities, keywords are used in a different way than identifiers or symbols. Keywords are intended for use (unquoted) as special markers in argument lists and in certain syntactic forms. For run-time flags and enumerations, use symbols instead of keywords. The example below illustrates the distinct roles of keywords and symbols.
Examples:
> (define dir (find-system-path 'temp-dir)) ; not '#:temp-dir
> (with-output-to-file (build-path dir "stuff.txt")
(lambda () (printf "example\n"))
; optional #:mode argument can be 'text or 'binary
#:mode 'text
; optional #:exists argument can be 'replace, 'truncate, ...
#:exists 'replace)Am I correct that the equivalent to this service file, in the world of systemd, is a binary file ?
https://www.gnu.org/software/guix/news/running-system-servic...
This is not part of GNU Shepherd.
I would presume they'd separate out that particular detail into separate modules.
> The GNU Daemon Shepherd or GNU Shepherd, formerly known as GNU dmd
dmd was short for "daemon management daemon". Basically, it's what powers all services running on GNU Guix instead of something else, like systemd.
I think this new name may sound "friendlier", but at the cost of precision. I immediately realized what dmd would be, but I had no idea what GNU Shepherd would be about.
(I am looking at you systemd)
We all know RMS is bitter that he can't take credit for a functional kernel, but it's still there.
I happen to call the system I work with and hack on "GNU", not "Linux". That's just a different perspective.
And I'm not RMS, nor am I bitter. I find your comment very confusing and confused.
Guix is a collection of programs for building, installing and distributing software (or other digital artefacts). It is specifically designed to work alongside alternatives, like apt, yum, etc. on many operating systems.
GuixSD is a particular OS distro, which uses Guix for all of its packaging, etc. If you use GuixSD, you're going all-in on Guix for everything.
The distinction between these projects is important, since Guix might be a good engineering choice for some project (say, a Web site backend, requiring particular versions of Apache, Python, various modules, etc.), whilst it may be a bad idea to switch the whole underlying OS to GuixSD.
As a concrete example, I've not used Guix or GuixSD myself, but exactly the same distinction exists between Nix and NixOS. I personally use NixOS, and I include Nix configurations in my own projects, so others can use Nix to install them with all of the right dependencies, etc. They don't need to switch distro to NixOS though; Nix will work on whatever system they already use (e.g. Ubuntu, OSX, etc. Though not yet Windows).
But I really think that the name should be Bash, because that's what holds it all together.
They called you out on a minor mistake: Guix being a package-manger of sorts and GuixSD being a Linux distro (built on Guix).
And Guix doesn't run anything like dmd or systemd. GuixSD does.
It's not a big deal though. Honest mistake to make.
Anyway, thanks for pointing that out.
GuixSD is kind of immature at the moment, and I have driver issues with linux-libre, but in the coming weeks I'll have the time to try to run it with a custom kernel that supports my hardware. If I succeed, as an Emacs user it'll become turtles all the way for me, which is very exciting (GuixSD is Guix + Shepherd + GNU + Linux Libre).
It is quite easy to overwrite the kernel package to use in a system configuration (e.g. to use a kernel with the RT patches applied), but I should say that I use the default kernel on all but one machine.
Though in most cases I find that people just want the "zombie problem" to go away. I wrote a simple init[1] that implements all of the key pieces of an init and signal forwarder.
Also I'm learning Rust and it was a good opportunity to practice by implementing something I already knew how to easily do in C.
Sadly it doesn't seem to play well when run under Python 3. Not a big deal now, but hopefully one of these years, desktop Linux distributions will have a 3.x release of Python as the default.