New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos cups: support for socket activation [WIP] #40491
Conversation
Also: 1) no longer force the cups-browsed service to run (which can increase boot times) if Avahi is enabled by making it configurable. 2) enable socket activation by default
Success on x86_64-linux (full log) Attempted: cups Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: cups Partial log (click to expand)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested the pull request, but I agree with the idea.
I've been running with this for the last year or so so I know it works but I realized that this PR needs a little cleaning up so I have changed the title to WIP. |
type = types.bool; | ||
default = true; | ||
description = '' | ||
Start CUPS processes on demand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifying expected extra latency on a specific piece of hardware would be useful. Something like
On my Intel-<specific model> this delays a printing dialog by 2.4 seconds
.
fi | ||
# Then, populate it with static files | ||
cd ${rootdir}/etc/cups | ||
for i in *; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*
needs to be ./*
.
done | ||
|
||
#update path reference | ||
[ -L /var/lib/cups/path ] && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many references to /var/lib/cups
. Can a variable be introduced to eliminate the repetition?
$server->waitForUnit("cups.service"); | ||
$client->waitForUnit("cups.service"); | ||
$client->sleep(10); # wait until cups is fully initialized | ||
$server->waitForUnit("sockets.target"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't both configurations (socket activated and not socket activated) be tested? (I can see the old test was not reliable and your test is better.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed they should - that is one of the 2 issues I want to clean up before this gets merged.
Are there any updates on this pull request, please? |
I believe this was implemented in #65040. |
Motivation for this change
With printing enabled, the cups services would start eagerly on boot despite only being needed when printing.
With this PR, cups only start when needed so it takes a few seconds for the print dialog to show.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)