33 lines
894 B
Python
33 lines
894 B
Python
#!/usr/bin/python3
|
|
|
|
# DO NOT MODIFY THIS SCRIPT!
|
|
# For custom scripts use the hookdir /etc/linuxmuster-linuxclient7/onLogin.d
|
|
|
|
# This schript is called in user context when a user logs in
|
|
try:
|
|
import os, sys
|
|
#import traceback
|
|
from linuxmusterLinuxclient7 import logging, hooks, shares, user, constants, gpo, computer, environment
|
|
|
|
logging.info("====== onLogin started ======")
|
|
|
|
# mount sysvol
|
|
rc, sysvolPath = shares.getLocalSysvolPath()
|
|
if rc:
|
|
environment.export(f"SYSVOL={sysvolPath}")
|
|
|
|
# process GPOs
|
|
gpo.processAllPolicies()
|
|
|
|
logging.info("======> onLogin end ======")
|
|
|
|
except Exception as e:
|
|
try:
|
|
#traceback.print_exc()
|
|
logging.exception(e)
|
|
except:
|
|
print("A fatal error occured!")
|
|
|
|
# We need to catch all exceptions and return 0 in any case!
|
|
# If we do not return 0, login will FAIL FOR EVERYONE!
|
|
sys.exit(0)
|