Skip to content

Remove set -x from scripts. - #40

Open
funman wants to merge 1 commit into
OpenPrinting:masterfrom
funman:master
Open

funman wants to merge 1 commit into
OpenPrinting:masterfrom
funman:master

Conversation

@funman

@funman funman commented Oct 12, 2026

Copy link
Copy Markdown

This disables printing commands and their arguments as they are executed. This cuts down on log spam e.g. in journalctl -f, even though it can be mitigated with snap stop cups.

Oct 12 12:01:39 big cups.cups-browsed[12202]: + [ -r /var/snap/cups/1262/var/run/cupsd.pid ]
Oct 12 12:01:39 big cups.cups-browsed[12263]: + cat /var/snap/cups/1262/var/run/cupsd.pid
Oct 12 12:01:39 big cups.cups-browsed[12202]: + PID=3029
Oct 12 12:01:39 big cups.cups-browsed[12202]: + [ -n 3029 ]
Oct 12 12:01:39 big cups.cups-browsed[12202]: + kill -0 3029
Oct 12 12:01:39 big cups.cups-browsed[12202]: + sleep 1
Oct 12 12:01:40 big cups.cups-browsed[12202]: + [ -r /var/snap/cups/1262/var/run/cupsd.pid ]
Oct 12 12:01:40 big cups.cups-browsed[12266]: + cat /var/snap/cups/1262/var/run/cupsd.pid
Oct 12 12:01:40 big cups.cups-browsed[12202]: + PID=3029
Oct 12 12:01:40 big cups.cups-browsed[12202]: + [ -n 3029 ]
Oct 12 12:01:40 big cups.cups-browsed[12202]: + kill -0 3029
Oct 12 12:01:40 big cups.cups-browsed[12202]: + sleep 1

This disables printing commands and their arguments as they are executed.
This cuts down on log spam e.g. in journalctl -f, even though it can be
mitigated with snap stop cups.

Oct 12 12:01:39 big cups.cups-browsed[12202]: + [ -r /var/snap/cups/1262/var/run/cupsd.pid ]
Oct 12 12:01:39 big cups.cups-browsed[12263]: + cat /var/snap/cups/1262/var/run/cupsd.pid
Oct 12 12:01:39 big cups.cups-browsed[12202]: + PID=3029
Oct 12 12:01:39 big cups.cups-browsed[12202]: + [ -n 3029 ]
Oct 12 12:01:39 big cups.cups-browsed[12202]: + kill -0 3029
Oct 12 12:01:39 big cups.cups-browsed[12202]: + sleep 1
Oct 12 12:01:40 big cups.cups-browsed[12202]: + [ -r /var/snap/cups/1262/var/run/cupsd.pid ]
Oct 12 12:01:40 big cups.cups-browsed[12266]: + cat /var/snap/cups/1262/var/run/cupsd.pid
Oct 12 12:01:40 big cups.cups-browsed[12202]: + PID=3029
Oct 12 12:01:40 big cups.cups-browsed[12202]: + [ -n 3029 ]
Oct 12 12:01:40 big cups.cups-browsed[12202]: + kill -0 3029
Oct 12 12:01:40 big cups.cups-browsed[12202]: + sleep 1
@tillkamppeter

Copy link
Copy Markdown
Member

The -x was there for debugging during the devlopment. It would be great if one could add somewhere, in a config file for example, a global "debug mode" switch to turn on and off the -x switch for all scripts at once.

Also, the tests for standalone mode are failing.

@funman

funman commented Oct 13, 2026

Copy link
Copy Markdown
Author

What about something like:

[ -n "$CUPS_DEBUG" ] && set -x

I noticed the tests failing but I don't understand if this is caused by my change or due to external causes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants