linuxmuster / linuxmuster-linuxclient7

The new approach on connecting linuxclients to the Linuxmuster.net v7 Active Directory server.
3 stars 5 forks source link

onLoginAsRoot scripts not always executed #69

Open kiarn opened 1 year ago

kiarn commented 1 year ago

Hello @dorianim

I've just see that the onLoginAsRoot scripts are not always executed, I ran today in this error:

Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [INFO] ====== onLoginLogoutAsRoot started with PAM_TYPE=open_session PAM_RHOST=None PAM_RUSER=None PAM_SERVICE=lightdm PAM_TTY=:0 PAM_USER=test1 ======
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [DEBUG] Calculating mountpoint of //server.linuxmuster.lan/sysvol
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [DEBUG] Trying to mount //server.linuxmuster.lan/sysvol to /srv/samba/R10106$/sysvol
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [DEBUG] * Creating directory...
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [WARNING] * The target directory already exists, proceeding anyway!
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [ERROR] === An exception occurred ===
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [ERROR] sequence item 0: expected str instance, NoneType found
Jan 16 17:15:52 r10106 linuxmuster-linuxclient7: [ERROR] === end exception ===
...
Jan 16 17:15:53 r10106 linuxmuster-linuxclient7: [INFO] ====== onLogin started ======

Unfortunately I don't have enough time to test more today, I will do it later if you don't see directly a reason for this error. I think this problem occurs each time the mount of sysvol fails.

Thanks

Arnaud

dorianim commented 1 year ago

I haven't seen that before. Thanks for reporting :) I'll look into it when I have time, but let me know when you find the cause.

dorianim commented 1 year ago

@kiarn you can uncomment this line for easier debugging: https://github.com/linuxmuster/linuxmuster-linuxclient7/blob/3dc223a415a03e73796809eab53a01666561a97f/usr/lib/python3/dist-packages/linuxmusterLinuxclient7/logging.py#L67

kiarn commented 1 year ago

Hello @dorianim ,

I'm sorry, I have currently not enough time to debug it, but I will not forget it. Is there for me a quick fix/patch to apply in order to let the onLoginAsRoot scripts be executed, even if sysvol is not mounted ? It would at least solve some problems on our network.

Cheers

Arnaud

dorianim commented 1 year ago

Please uncomment the line from logging.py that I mentioned and post the traceback. Otherwise, It's really hard to debug this, since I can't reproduce it.