The ipp-usb daemon uses some files, for configuration, USB quirk rules, remembereing the use of the ports, and logging. For this, paths are had-coded in the paths.go file (comments removed):
package main
const (
PathConfDir = "/etc/ipp-usb"
PathConfQuirksDir = "/etc/ipp-usb/quirks"
PathQuirksDir = "/usr/share/ipp-usb/quirks"
PathProgState = "/var/ipp-usb"
PathLockDir = PathProgState + "/lock"
PathLockFile = PathLockDir + "/ipp-usb.lock"
PathControlSocket = PathProgState + "/ctrl"
PathProgStateDev = PathProgState + "/dev"
PathLogDir = "/var/log/ipp-usb"
PathLogFile = PathLogDir + "/main.log"
)
In a container, like a Snap or an OCI container there is often not the same file system available as in a classic operating system environment without containerization/sandboxing. Also applications can be shipped in immutable file systems, meaning that one cannot write into the directories in which the application itself is delivered.
Therefore there must be an easy way to redefine the places of the files which ipp-usb is using, so that one can easily package it in a containerized, snadboxed, and/or immutable format.
The Snap for example has the immutable file system with which ipp-usb is shipped in /snap/ipp-usb/current/ and it can write files only into subdirectories of /var/snap/ipp-usb/current/ and /var/snap/ipp-usb/common/, meaning that the file paths need to be appropriately redefined for the Snap build. Currently, we go the awkward way of modifying paths.go with a command line editor (in our case perl) before building ipp-usb in snapcraft.yaml.
To make it easier I suggest to add one or more (ideally all) of the following methods:
- Build command line options
- Command line options when starting the daemon
ipp-usb
- Environment variables to be read by
ipp-usb
- Entries in the config file
ipp-usb.conf (requires (2) or (3) for ipp-usb to find the config file at least)
to change the paths/file names.
The
ipp-usbdaemon uses some files, for configuration, USB quirk rules, remembereing the use of the ports, and logging. For this, paths are had-coded in thepaths.gofile (comments removed):In a container, like a Snap or an OCI container there is often not the same file system available as in a classic operating system environment without containerization/sandboxing. Also applications can be shipped in immutable file systems, meaning that one cannot write into the directories in which the application itself is delivered.
Therefore there must be an easy way to redefine the places of the files which ipp-usb is using, so that one can easily package it in a containerized, snadboxed, and/or immutable format.
The Snap for example has the immutable file system with which ipp-usb is shipped in
/snap/ipp-usb/current/and it can write files only into subdirectories of/var/snap/ipp-usb/current/and/var/snap/ipp-usb/common/, meaning that the file paths need to be appropriately redefined for the Snap build. Currently, we go the awkward way of modifyingpaths.gowith a command line editor (in our caseperl) before building ipp-usb insnapcraft.yaml.To make it easier I suggest to add one or more (ideally all) of the following methods:
ipp-usbipp-usbipp-usb.conf(requires (2) or (3) foripp-usbto find the config file at least)to change the paths/file names.