| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| #!/bin/sh | ||
| exec 2>&1 | ||
|
|
||
| [ -r /etc/bees.conf ] && . /etc/bees.conf |
There was a problem hiding this comment.
This isgenerally now how we ship service configurations. The common pattern is to just ship a conf file next to the service [ -r ./conf ] && . ./conf
Sorry, something went wrong.
There was a problem hiding this comment.
Seems like the beesd does the parsing itself. So it shouldn't be sourced here and conf can be used to overwrite or pass additional flags.
https://github.com/Zygo/bees/blob/master/scripts/beesd.in#L82-L85
Sorry, something went wrong.
There was a problem hiding this comment.
run reads a conf next to the service if you make one, but I kept sourcing the bees config for the UUID.
beesd finds its config by grepping /etc/bees/*.conf for the UUID it was passed, so it needs one on argv before it can find anything, and bails without it:
https://github.com/Zygo/bees/blob/v0.11/scripts/beesd.in#L79
Taking it from conf instead would mean setting the same value in two files. conf is still there for flags and overrides.
Sorry, something went wrong.
There was a problem hiding this comment.
The systemd service is parametrized. It would probably be better to just add an example service instead instead of one "ready to use" (which actually limited to one UUID and also needs extra setup) in /etc/sv.
Sorry, something went wrong.
There was a problem hiding this comment.
Fair. I'll ship it as an example under usr/share/examples/sv/beesd.
Sorry, something went wrong.
| if [ "$(uuidparse -n -o VARIANT "$UUID")" = "invalid" ]; then | ||
| echo "Set UUID in /etc/bees.conf before starting beesd" | ||
| sv down . | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
This is not generally what we do with services. I don't think there is a single other service that calls sv or takes itself down by default.
Since services are not enabled by default and a user has to enable it I don't think this should be here.
Sorry, something went wrong.
There was a problem hiding this comment.
sv does get called by other run scripts, but no other service uses down, agreed.
I went with it because beesd can't start without a UUID and there's no default that would work. The shipped config has upstream's placeholder UUID, so enabling before editing trips the guard on every restart, one line a second, forever. Taking it down once seemed better than filling the log.
If you'd rather it just loop like everything else, I'll drop it.
Sorry, something went wrong.
| revision=2 | ||
| version=0.11 | ||
| revision=1 | ||
| archs="x86_64* i686* aarch64* armv[67]l*" |
There was a problem hiding this comment.
Why is there an archs pattern if it allows all architectures?
Sorry, something went wrong.
There was a problem hiding this comment.
Dropped. I was being careful because bees touches the filesystem, but I can't actually back up where I drew the line.
Sorry, something went wrong.
| vconf scripts/beesd.conf.sample bees.conf | ||
| vsconf scripts/beesd.conf.sample | ||
| vmkdir etc/bees | ||
| ln -s ../bees.conf "${DESTDIR}/etc/bees/bees.conf" |
There was a problem hiding this comment.
Why do we need this link? Just install the config file to where its needed.
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, that was working around installing it to the wrong place. Config goes straight to /etc/bees/bees.conf now and the link is gone.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Supersedes #61901
Add runit service for beesd.
Remove outdated patches, replace with make args.
Testing the changes
Local build testing