-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let standard domain (/var)/run/cups/cups.sock be used if available
Now, if there is not already a CUPS running (for example from .deb packages), the Snap's CUPS uses the standard domain socket (/var)/run/cups/cups.sock and the standard port 631. If domain socket or port are already occupied the alternatives /var/snap/printing-stack-snap/common/run/cups.sock and port 10631 are used. To make this Snap's tools always use this Snap's CUPS, the actually selected domain socket is set as ServerName in the Snap's client.conf, /var/snap/printing-stack-snap/common/etc/cups/client.conf and libcups is built to use this client.conf by default. This Snap's cups-browsed is started with the CUPS_SERVER environment variable set to the selected domain socket. So it always attaches to the CUPS of this Snap. Further changes and fixes to make this working and to make this Snap also correctly working with the extra check of administrative tasks of the previous commit: - All apps which do admin tasks via cupsd (cups-browsed, lpadmin, cupsenable, cupsdisable, cupsaccept, cupsreject, cancel, cupsctl) are now plugging cups-control. - A new interface "cups-domain-socket" based on the "system-files" interface allows the Snap's apps to read/write access the standard CUPS domain socket (/var)/run/cups/cups.sock. - The CUPS build system is patched to use /var/snap/printing-stack-snap/common/etc/cups instead of /etc/cups as standard CUPS_SERVERROOT, especially to make libcups use the Snap's client.conf. - run-cupsd checks whether the standard CUPS domain socket is free using the "lsof" utility. Then it drops the selected domain socket as ServerName in client.conf, so that the utilities use it. - run-cups-browsed reads the domain socket from client.conf and sets the CUPS_SERVER environment variable before starting cups-browsed. run-cups-browsed waits for cupsd coming up, by checking the presence of the PID file and whether there is actually a process with this PID. Only then it reads client.conf, to be sure it contains the currently selected domain socket. - run-cupsd and run-cups-browsed delete their PID files in the end, as when they end, their corresponding daemon has terminated. - Fixed the PID file paths in stop-cupsd and stop-cups-browsed. - Changed the location for CUPS config files to /var/snap/printing-stack-snap/common/etc/cups
- Loading branch information
1 parent
2e5817f
commit 2da5047
Showing
5 changed files
with
124 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.