Update Debian Package Services and Config Directory#1855
Update Debian Package Services and Config Directory#1855DaAwesomeP wants to merge 52 commits intoOpenLightingProject:masterfrom
Conversation
Co-authored-by: Wouter Verhelst <w@uter.be> Co-authored-by: Perry Naseck <git@perrynaseck.com>
Co-authored-by: Wouter Verhelst <w@uter.be> Co-authored-by: Perry Naseck <git@perrynaseck.com>
|
Requesting review from @peternewman |
|
OK, I have this running on a production machine and it works like a charm! |
|
@peternewman polite ping! |
yoe
left a comment
There was a problem hiding this comment.
I know you didn't ask for my review, but I'm giving it anyway ;-P
Although I made some suggestions for improvement, none of them are really critical, so from my POV things can go in as-is and that would be better than the status quo; but I'll leave actual approval up to @peternewman.
I didn't ask but you're an infinitely more experienced package maintainer than me and I am excited that you left a review! :D |
|
Note from the init/systemd side there's also #1444 which I suspect is stuck on me looking at some stuff (as always)... |
…-systemd-and-config-dir
…:DaAwesomeP/ola into DaAwesomeP-debian-systemd-and-config-dir
…-systemd-and-config-dir
|
@peternewman @kripton rebased! |
|
I saw your ping. However, since I neither use Debian nor systemd, I'm probably not really qualified to comment this one. However, when it improves the situation, I'd rather merge it (and fix later in case of problems) instead of not merging it. Ping @peternewman ;) |
|
Hey @yoe, we might finally revisit this and I wanted to see if there are any updated Debian practices that should be worked into this PR. @aroffringa saw this Debian notice that this PR should fix. |
|
OK, I have rebased and the build is working for Debian bullseye, bookworm, and trixie. Debian forky (testing) and sid (unstable) are showing C++ compilation errors to be fixed in other PRs:
|
…-systemd-and-config-dir
aroffringa
left a comment
There was a problem hiding this comment.
I went over the changes and it looks great to me. It's hard to tell everything is robust to the future but I think that's fine, we can deal with that later. Shall I merge it?
It's really up to you! I've been ready for a while :D. @yoe approved it (and handles package management on the Debian side of things). I don't know that @peternewman ever reviewed it. |
…-systemd-and-config-dir
|
Just rebased again. |
peternewman
left a comment
There was a problem hiding this comment.
Thanks again @DaAwesomeP . A few relatively minor comments from me...
| @@ -0,0 +1,16 @@ | |||
| [Unit] | |||
| Description=Open Lighting Architecture daemon | |||
| Documentation=man:olad(1) | |||
There was a problem hiding this comment.
There was a problem hiding this comment.
Can we add these in a followup PR? I want to avoid tacking on anything else to this PR since it has been open so long.
Separately, I think these links should go in the man page instead of in the Systemd service. That way you see them no matter how you get to the docs on Debian. Also means fewer places to keep them updated.
| if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then | ||
| DAEMON_ARGS="--world-writeable" | ||
| elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then | ||
| echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola-rdm-tests\" to change this." >&2 | ||
| fi | ||
|
|
There was a problem hiding this comment.
I don't know how major an issue we feel this is, but it will be a breaking change for anyone using our version of the deb build/init script. I don't believe it's been in Debian's shipped version for ages (ever?).
We could split this in half so the additions were in 0.11.0 and the removal/tidying was in whatever we call the next version...
There was a problem hiding this comment.
See my rationale at the start of the PR. The Debian build in this repo had been nonfunctional for so long that there is no way anyone is using it.
| USER=olad | ||
| LOG_LEVEL=3 | ||
| CONFIG_DIR="/var/lib/ola/conf" | ||
| CONFIG_DIR="/etc/ola" |
There was a problem hiding this comment.
This will be a bigger breaking change for those users!
There was a problem hiding this comment.
Same applies here. I am quite confident that nobody is using our deb package over the Debian one.
There was a problem hiding this comment.
We should also consider what other settings we should merge in from https://github.com/OpenLightingProject/ola/pull/1444/files#diff-f6474409cdd97933e66d7f3eb687aa1bc0c23b9a6785394a5a1eb884a00d7d29 initially, versus possibly wait for the notify stuff in the next release?
There was a problem hiding this comment.
This PR has been open for nearly 3 years, so I'd like to just get this going and come back to the other parts.
There was a problem hiding this comment.
Also discussed this here in this PR: #1855 (comment)
|
|
||
| #create the olad user, add it to groups | ||
| getent passwd olad > /dev/null || adduser --system --no-create-home olad | ||
| getent passwd olad > /dev/null || adduser --system --home /usr/lib/olad --no-create-home olad |
There was a problem hiding this comment.
Do we really need to specify a home despite not creating one?
There was a problem hiding this comment.
Yes, the Linux user still has a directory associated with it even a directory is not created. By default this is /home/olad. I probably pulled this from Debian upstream.
There was a problem hiding this comment.
We'll have to get you to rebuild ola.js for some other stuff given you've clearly found the nack!
There was a problem hiding this comment.
Well, it's been 3 years so I have almost no memory of it now hah.
Co-authored-by: Peter Newman <peternewman@users.noreply.github.com>
Now that I am using the Debian build from
masterin production I have found some outdated parts.This updates the Debian package to use a modern Systemd service and moves the config folder. It also removes the reliance on Debconf to enable/disable which definitely not needed for Systemd and is redundant on Debian for init scripts (and especially redundant now that Systemd wraps init scripts by default).
Per Debian package recommendations both the init script and Systemd service will be installed, but users running
systemctl start|enable|etc oladwill now trigger the Systemd service instead of the init script Systemd wrapper. This fixes a big bug I was experiencing where Systemd does not properly trigger the init script and sosystemctl restart oladdid not work with the init script butstartandstopdid.Systemd users can now override options with Systemd overrides instead of an environment file
/etc/default(new preferred method).Per Debian package recommendations the configuration files should go in
/etc/olasince they are user editable and not 100% runtime-controlled. This is also where I think most users expect to find the configuration.This creates some breaking changes, but I think this is OK for the following reasons:
a. Building from source, installing with
make install, and creating their own config directory and service schemeb. Installing from the Debian package repository which already uses
/etc/olafor configs and has removed the Debconf bitsmasterinstead of0.10.These changes should make it much smoother to move between the Debian repo packages and the ones created here. As new features and bugfixes seem to have accelerated recently, the ability to use the pre-packaged master build is quite nice. Personally I experienced this because I needed KiNETv2 support (#1787).
The main remaining difference in the packages is in the way that the web assets are handled, but most users won't perceive a difference between these builds with that or would possibly try this build if that one breaks. I don't really see a need to update that part here.
Hopefully this eventually makes its way downstream to Debian and brings the Systemd service to everyone.