-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
configure.ac: Add options to configure several server features #128
base: master
Are you sure you want to change the base?
Conversation
PAPPL provides several options and server options to use when running lprint as a daemon. This PR provides a way how to configure them during configuration phase to provide a different defaults in different environments.
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'm generally not too keen on these because it makes the actual behavior/defaults different from the documented behavior/defaults. Also, PAPPL/LPrint now support configuration files in /etc so it might make more sense to simply put these in a generated lprint.conf file and not embed the setting in the systemd service file.
Hmm... it can work, although it would be great if PAPPL could adapt a feature which I know from systemd - that |
I personally hate this behavior - because different distros (and versions of systemd) move where these files live, it is almost impossible to know how to customize the configuration of any given service. Systemd is one service management framework in use on Linux, and is not used anywhere else. I'd much rather have a "/etc/lprint.conf.default" file that users can copy to "/etc/lprint.conf" and make changes. This file can provide comments that explain the supported options, is easy to find, and doesn't break the user's configuration file no matter how the installation is done. |
IMO if you want to customize, it means you want to override any defaults are there - so putting the changes into /etc will do the trick.
I think one of the reasons for this systemd behavior was making systemd better suited for containers (/etc is read-only there, left for admins to populate when they spawn the container, but never changed after container is up - another was to make machine start even with empty /etc, which is taken as admin space, where might and might not to be overrides). So to sum it up, lprint.conf.default and lprint.conf would be fine as long the daemon does not write into it. This does not seem to be the case with current lprint, where lprint.conf has similar purpose as printers.conf in CUPS - the file is meant to be writable for daemon, but people uses the file for migrations. It would be great if the files for saving daemon configuration were outside of /etc, so they would be writable regardless where the daemon runs. |
But to mention - I don't mind having those settings in a configuration file. I made the PR based on my current knowledge that some of options are available only as parameters, so I made changes to service file. If you would be okay with that I create and send PR regarding reading configuration, I can work on it. My proposal would be:
WDYT? |
Sigh... So there is some legacy stuff still in LPrint, and I didn't realize it until now. The system state file is normally stored in /var/lib/BASENAME.state. For snaps this becomes $SNAP_COMMON/BASENAME.state. For per-user instances it depends on the environment but can be ~/.config/BASENAME.state, ~/Library/Application Support/BASENAME.state, or ~/AppData/Local/BASENAME.state.
The spool directory (which also contains resource files and other longer-lived data) is normally stored in /var/spool/BASENAME. For snaps this becomes $SNAP_COMMON/BASENAME.d. For per-user instances it will be ~/.config/BASENAME.d, ~/Library/Application Support/BASENAME.d (macOS), or ~/AppData/Local/BASENAME.d (Windows). PAPPL looks for options in BASENAME.conf files in $SNAP_COMMON, /etc, /usr/local/etc, ~/.config, ~/Library/Application Support (macOS), and ~/AppData/Local (Windows). Obviously that is going to cause problems with LPrint users... :/ The point of allowing BASENAME.conf files in various standard locations is to allow for customization when the corresponding managing service causes problems with customization - systemd, launchd, snap, etc. all have this problem. |
Hmm... there is no lprint related file in Looks all stuff is in /etc/lprint.conf, since the server is started with systemd (maybe we should move it to be user service?). |
Issue #129 has fixed the state filenames, where necessary, to avoid conflicts with the .conf files and putting them in the proper directories. |
PAPPL provides several options and server options to use when running lprint as a daemon. This PR provides a way how to configure them during configuration phase to provide a different defaults in different environments.