Skip to content

Printers are not uninstalled when a user logs out #93

Closed

Description

@garblixa

In a Debian installation, printers are not uninstalled when a user logs out.
The reason is that, apparently, the PAM environment only has the environment variable PATH=/bin:/usr/bin when logging out, and therefore lpadmin cannot be found.

/usr/lib/python3/dist-packages/linuxmusterLinuxclient7/printers.py:

def _uninstallPrinter(name):
logging.info(f"Uninstall Printer {name}")
uninstallCommand = ["timeout", "10", "lpadmin", "-x", name]

FIX:
def _uninstallPrinter(name):
logging.info(f"Uninstall Printer {name}")
uninstallCommand = ["timeout", "10", "/usr/sbin/lpadmin", "-x", name]

Activity

  1. dorianim commented on Jul 7, 2026

    @dorianim
    Member

    Is lpadmin guaranteed to always be located at /usr/sbin/lpadmin on all platforms?

  2. garblixa commented on Jul 8, 2026

    @garblixa
    Author

    @dorianim
    That's a good question. In the distributions I maintain, lpadmin is indeed located in /usr/sbin. It would probably be cleaner to either expand the PATH variable when the script is called, or check the standard paths to see where lpadmin is located.

  3. added a commit that references this issue on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions