-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
papplMainLoop should use persistent location for state files #128
Comments
- _papplMainloopRunServer now chooses a default spool directory and state file based on the base name of the printer application, and those files go in persistent locations. - _papplMainloopConnect now tries connecting to a root server if the per-user server cannot be found, before starting a per-user server. - _papplMainloopGetServerPath now takes a UID argument.
I see in the change that you take into account that the Printer Application is running in a Snap, but you forgot the socket, in the function |
In PAPPL support for the Printer Application as system service is added now, especially if the Printer Application runs a root and users run the Printer Application as client (command line interface) the commands are applied to the Printer Application running as root and no new personal server process for the user is created. This functionality was provided by a patch in this Snap before, this patch is removed now. See michaelrsweet/pappl#148 Also handling of directories got improved and therefore additional arguments were added to the ./configure command line of PAPPL. See michaelrsweet/pappl#128
@tillkamppeter I can't put the socket in SNAP_COMMON. What do other snap-based services do? |
In the Snap of the PostScript Printer Application I am actually putting the socket into $SNAP_COMMON (via the It should also be accessible this way for any unsnapped clients. If you want to access the snapped Printer Application from another Snap (Snap-to-Snap communication via domain socket) you always need a special snapd interface, independent whether the socket is in $SNAP_COMMON or somewhere in the file system of the host system. The CUPS Snap is such a case. The CUPS Snap's cupsd is listening on up to two domain sockets, always on Client Snaps must plug an appropriate interface to access any file or domain socket of the host system or of another Snap, so for printing with or managing CUPS they need to plug an interface, "cups" (under development, see the linked snapcraft.io forum threads in README.md and especially the current discussion) for sole printing and "cups-control" for managing CUPS (create/modify/delete queues, delete anyone's jobs, ...). The domain socket The way to use Printer Application Snaps by any snapped or unsnapped client (especially the CUPS Snap) is to use |
@tillkamppeter I still don't like putting the domain socket in As for a client (other than the executables in the snap) accessing the domain socket, I guess that is technically possible but not using the PAPPL client code (which will only work properly inside the snap). |
Currently
papplMainLoop
defaults to a state file in$TMPDIR/BASENAME.state
and a spool directory in$TMPDIR/papplUID.d
.When running in a SNAP, the state file should be in
$SNAP_COMMON/BASENAME.state
and the spool directory$SNAP_COMMON/BASENAME.d
.When running as root, the state file should be in
LOCALSTATEDIR/lib/BASENAME.state
and spool directoryLOCALSTATEDIR/spool/BASENAME.d
.When running as non-root, the state file should be in
$XDG_CONFIG_HOME/BASENAME.state
if XDG_CONFIG_HOME is set and$HOME/.config/BASENAME.state
or$HOME/Library/Application Support/BASENAME.state
(macOS) otherwise. The spool directory should be$TMPDIR/BASENAME-UID.d
.The text was updated successfully, but these errors were encountered: