Alex
2020-Jun-23 10:32 UTC
[Samba] pam_systemd(samba:session): Failed to create session: No such file or directory
Hello, There's a file server running CentOS 7 with packaged Samba: # rpm -qi samba Name : samba Epoch : 0 Version : 4.10.4 Release : 11.el7_8 Architecture: x86_64 ... Source RPM : samba-4.10.4-11.el7_8.src.rpm Build Date : Tue 12 May 2020 04:31:13 PM UTC ... Packager : CentOS BuildSystem <http://bugs.centos.org> When a user opens a file share, there's an error coming up in the syslog (however, it doesn't affect user's ability to open the share): Jun 23 10:14:37 filer-1 smbd[4572]: pam_systemd(samba:session): pam-systemd initializing Jun 23 10:14:37 filer-1 smbd[4572]: pam_systemd(samba:session): Asking logind to create session: uid=16777217 pid=4572 service=samba type=tty class=user desktop= seat= vtnr=0 tty=smb/257860650 display= remote=yes remote_user= remote_host=172.26.10.1 Jun 23 10:14:37 filer-1 smbd[3944]: pam_systemd(samba:session): Failed to create session: No such file or directory Jun 23 10:14:37 filer-1 smbd[3944]: pam_unix(samba:session): session opened for user DOMAIN\user by (uid=0) Jun 23 10:14:47 filer-1 smbd[3944]: pam_unix(samba:session): session closed for user DOMAIN\user Here is the pam settings for samba: # cat /etc/pam.d/samba #%PAM-1.0 auth required pam_nologin.so auth include password-auth account include password-auth session include password-auth password include password-auth # cat /etc/pam.d/password-auth #%PAM-1.0 # This file is auto-generated. # User changes will be destroyed the next time authconfig is run. ... session optional pam_keyinit.so revoke session required pam_limits.so -session optional pam_systemd.so debug session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid session required pam_unix.so I tried strace samba processes but didn't find anything appropriate. Stracing systemd-logind displays: ... connect(23, {sa_family=AF_UNIX, sun_path="/run/samba/winbindd/pipe"}, 110) = 0 poll([{fd=23, events=POLLIN|POLLOUT|POLLHUP}], 1, -1) = 1 ([{fd=23, revents=POLLOUT}]) write(23, "0\10\0\0\0\0\0\0\0\0\0\0\367\4\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2096) = 2096 poll([{fd=23, events=POLLIN|POLLHUP}], 1, 5000) = 1 ([{fd=23, revents=POLLIN|POLLERR|POLLHUP}]) read(23, 0x7ffd24451f50, 4008) = -1 ECONNRESET (Connection reset by peer) close(23) = 0 sendmsg(12, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\3\1\1\36\0\0\0\222\352\30\0W\0\0\0\5\1u\0\2\0\0\0\6\1s\0\t\0\0\0:1.161534\0\0\0\0\0\0\0\4\1s\0'\0\0\0org.freedesktop.DBus.Error.FileNotFound\0\10\1g\0\1s\0\0", iov_len=104}, {iov_base="\31\0\0\0No such file or directory\0", iov_len=30}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 134 ... Any ideas how to get that fixed? -- Best regards, Alex
Rowland penny
2020-Jun-23 10:49 UTC
[Samba] pam_systemd(samba:session): Failed to create session: No such file or directory
On 23/06/2020 11:32, Alex via samba wrote:> Hello, > > There's a file server running CentOS 7 with packaged Samba: > # rpm -qi samba > Name : samba > Epoch : 0 > Version : 4.10.4 > Release : 11.el7_8 > Architecture: x86_64 > ... > Source RPM : samba-4.10.4-11.el7_8.src.rpm > Build Date : Tue 12 May 2020 04:31:13 PM UTC > ... > Packager : CentOS BuildSystem <http://bugs.centos.org> > > When a user opens a file share, there's an error coming up in the syslog (however, > it doesn't affect user's ability to open the share): > Jun 23 10:14:37 filer-1 smbd[4572]: pam_systemd(samba:session): pam-systemd initializing > Jun 23 10:14:37 filer-1 smbd[4572]: pam_systemd(samba:session): Asking logind to create session: uid=16777217 pid=4572 service=samba type=tty class=user desktop= seat= vtnr=0 tty=smb/257860650 display= remote=yes remote_user= remote_host=172.26.10.1 > Jun 23 10:14:37 filer-1 smbd[3944]: pam_systemd(samba:session): Failed to create session: No such file or directory > Jun 23 10:14:37 filer-1 smbd[3944]: pam_unix(samba:session): session opened for user DOMAIN\user by (uid=0) > Jun 23 10:14:47 filer-1 smbd[3944]: pam_unix(samba:session): session closed for user DOMAIN\user >Are you using sssd ? If so, then I would advise you to stop using sssd and use winbind instead. Sorry, but you cannot use sssd with Samba >= 4.8.0 and shares. Rowland
Alex
2020-Jun-23 11:04 UTC
[Samba] pam_systemd(samba:session): Failed to create session: No such file or directory
Hello Rowland, No sssd in use: # ps -ef|grep sssd root 6909 23270 0 11:03 pts/2 00:00:00 grep --color=auto sssd> On 23/06/2020 11:32, Alex via samba wrote: >> Hello, >> >> There's a file server running CentOS 7 with packaged Samba: >> # rpm -qi samba >> Name : samba >> Epoch : 0 >> Version : 4.10.4 >> Release : 11.el7_8 >> Architecture: x86_64 >> ... >> Source RPM : samba-4.10.4-11.el7_8.src.rpm >> Build Date : Tue 12 May 2020 04:31:13 PM UTC >> ... >> Packager : CentOS BuildSystem <http://bugs.centos.org> >> >> When a user opens a file share, there's an error coming up in the syslog (however, >> it doesn't affect user's ability to open the share): >> Jun 23 10:14:37 filer-1 smbd[4572]: pam_systemd(samba:session): pam-systemd initializing >> Jun 23 10:14:37 filer-1 smbd[4572]: pam_systemd(samba:session): Asking logind to create session: uid=16777217 pid=4572 service=samba type=tty class=user desktop= seat= vtnr=0 tty=smb/257860650 display= remote=yes remote_user= remote_host=172.26.10.1 >> Jun 23 10:14:37 filer-1 smbd[3944]: pam_systemd(samba:session): Failed to create session: No such file or directory >> Jun 23 10:14:37 filer-1 smbd[3944]: pam_unix(samba:session): session opened for user DOMAIN\user by (uid=0) >> Jun 23 10:14:47 filer-1 smbd[3944]: pam_unix(samba:session): session closed for user DOMAIN\user >> > Are you using sssd ?> If so, then I would advise you to stop using sssd and use winbind > instead. Sorry, but you cannot use sssd with Samba >= 4.8.0 and shares.-- Best regards, Alex