Bug 56455 - cron error mail every day by univention-pam/ldap-group-to-file when unjoined
cron error mail every day by univention-pam/ldap-group-to-file when unjoined
Status: NEW
Product: UCS
Classification: Unclassified
Component: PAM
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on: 56378 56454
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-18 12:51 CEST by Philipp Hahn
Modified: 2023-08-18 12:51 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.006
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2023-08-18 12:51:15 CEST
+++ This bug was initially created as a clone of Bug #56454 +++
+++ This bug was initially created as a clone of Bug #56378 +++

/etc/cron.d/univention-pam runs
  [ -x /usr/lib/univention-pam/ldap-group-to-file.py ] && /usr/sbin/jitter 1800 /usr/lib/univention-pam/ldap-group-to-file.py 
every day by default, which fails is the system is not joined yet:
  Traceback (most recent call last):
    File "/usr/lib/univention-pam/ldap-group-to-file.py", line 151, in <module>
      main()
    File "/usr/lib/univention-pam/ldap-group-to-file.py", line 102, in main
      lo = univention.uldap.getMachineConnection(ldap_master=False, random_server=True)
    File "/usr/lib/python3/dist-packages/univention/uldap.py", line 172, in getMachineConnection
      bindpw = open(secret_file).read().rstrip('\n')
  FileNotFoundError: [Errno 2] No such file or directory: '/etc/machine.secret'

root@korpon:/etc/cron.d# grep -c /usr/lib/univention-pam/ldap-group-to-file.py /var/mail/systemmail 
54

The script should not run (or exit cleanly) if the system is not joined yet, e.g.
  [ -f /var/univention-join/joined ] || exit 0