Update Debian Package Services and Config Directory - #1855
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
|
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.
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.
Yeah fair point.
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.
I think they should perhaps go in both (assuming people actually put web links in man pages, although it feels a bit like defeating the point of man. I'd hope we never need to update them anywhere regardless, as we'd just put redirects in.
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)
Co-authored-by: Peter Newman <peternewman@users.noreply.github.com>
peternewman
left a comment
There was a problem hiding this comment.
LGTM, lets finally get this in...
| DAEMON_ARGS="--world-writable" | ||
|
|
||
| # Reads config file (will override defaults above) | ||
| [ -r /etc/default/ola-rdm-tests ] && . /etc/default/ola-rdm-tests | ||
|
|
||
| if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then | ||
| DAEMON_ARGS="--world-writeable" |
There was a problem hiding this comment.
After a bit of headbanging at Plugfest (not helped by SystemD silently stealing control of the init script code, I eventually spotted we'd changed to the other spelling of the argument (without the e).
For consistence (for now) I've corrected it in:
b860a75
I guess we could think about a breaking change to drop the e at some point in the future @DaAwesomeP ?
There was a problem hiding this comment.
I eventually spotted we'd changed to the other spelling of the argument (without the e).
I guess we could think about a breaking change to drop the e at some point in the future @DaAwesomeP ?
Oh wow huh. I probably did this without realizing. I definitely did not mean to change the spelling of any existing args.
After a bit of headbanging at Plugfest (not helped by SystemD silently stealing control of the init script code
I will say, this has been the default behavior for a very long time now. I was going to suggest fully removing the init script in v0.12.0 or later.
Is there a reason you were still using the init script over the Systemd one? You should be able to trivially set OLAD_OPTS in a Systemd override. As simple as: systemctl edit olad and Environment=OLAD_OPTS=myopts.
There was a problem hiding this comment.
I eventually spotted we'd changed to the other spelling of the argument (without the e).
I guess we could think about a breaking change to drop the e at some point in the future @DaAwesomeP ?Oh wow huh. I probably did this without realizing. I definitely did not mean to change the spelling of any existing args.
No need to apologise, all three of us reviewing it missed it too!
After a bit of headbanging at Plugfest (not helped by SystemD silently stealing control of the init script code
I will say, this has been the default behavior for a very long time now. I was going to suggest fully removing the init script in v0.12.0 or later.
Ah right, I didn't know. Wouldn't that break things for people choosing not to use SystemD (I've no idea how many people that actually is).
Is there a reason you were still using the init script over the Systemd one? You should be able to trivially set
OLAD_OPTSin a Systemd override. As simple as:systemctl edit oladandEnvironment=OLAD_OPTS=myopts.
My issue was SystemD wasn't telling me what was wrong. It was only when I ran with set -x and stopped the include function dragging in SystemD so it really ran my bash code, I actually saw the error onscreen to realise what needed fixing. Also I've rarely had to override things at all, let alone in SystemD (does that also mean it won't load the /etc/defaults file too anymore)? Anyway I don't know if that's an us issue, our SystemD config, or SystemD itself, but I never saw the error in journalctl, just that it had exited.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
It would be good to know what's still broken after various other stuff has gone in now @DaAwesomeP ? |
It looks like tests are building and passing in |
Yeah, I'm just a bit confused given I don't think I did anything to fix the last few... |
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.