Dario Lesca
2021-May-19 08:28 UTC
[Samba] Samba 4.10.x on centos7: smbd daemon it does not free the disk space used by the temporary files of shared printers
After a while, the /var filesystem is full because the smbd samba daemon cannot release the space of job files removed, created from the shared printers To release this space I must restart the service or kill -15 the process that already use this file. This is the situation after some hours of work: # lsof |grep smbprn. smbd????? 10099????????? root?? 34u????? REG????????????? 253,7???? 129691???????? 82 /var/spool/samba/smbprn.Y44hEB (deleted) smbd????? 10099????????? root?? 36u????? REG????????????? 253,7???? 190666???????? 72 /var/spool/samba/smbprn.Jqx29D (deleted) smbd????? 10099????????? root?? 38u????? REG????????????? 253,7? 461718458???????? 73 /var/spool/samba/smbprn.sY0OzI (deleted) smbd????? 10099????????? root?? 41u????? REG????????????? 253,7???? 129347???????? 93 /var/spool/samba/smbprn.i7fjQ6 (deleted) smbd????? 10099????????? root?? 42u????? REG????????????? 253,7???? 128170???????? 79 /var/spool/samba/smbprn.gdEDXN (deleted) smbd????? 10099????????? root?? 45u????? REG????????????? 253,7???? 229790???????? 80 /var/spool/samba/smbprn.qjm2NL (deleted) smbd????? 10099????????? root?? 46u????? REG????????????? 253,7????? 43076???????? 97 /var/spool/samba/smbprn.z0etcZ (deleted) smbd????? 10099????????? root?? 48u????? REG????????????? 253,7???? 129339???????? 95 /var/spool/samba/smbprn.GHcowo (deleted) smbd????? 10099????????? root?? 49u????? REG????????????? 253,7???? 216893???????? 98 /var/spool/samba/smbprn.2cqa6X (deleted) smbd????? 10099????????? root?? 52u????? REG????????????? 253,7???? 130143???????? 87 /var/spool/samba/smbprn.QimHW4 (deleted) smbd????? 10099????????? root?? 55u????? REG????????????? 253,7????? 52581??????? 100 /var/spool/samba/smbprn.snvGa3 (deleted) smbd????? 10099????????? root?? 56u????? REG????????????? 253,7???? 129623???????? 94 /var/spool/samba/smbprn.w7L8y6 (deleted) smbd????? 10099????????? root?? 68u????? REG????????????? 253,7????? 64781???????? 99 /var/spool/samba/smbprn.2uHnut (deleted) smbd????? 10099????????? root?? 69u????? REG????????????? 253,7????? 52581??????? 101 /var/spool/samba/smbprn.Exeq3U (deleted) smbd????? 10099????????? root?? 70u????? REG????????????? 253,7????? 43681??????? 106 /var/spool/samba/smbprn.REFsbL (deleted) smbd????? 10099????????? root?? 71u????? REG????????????? 253,7???? 342598??????? 102 /var/spool/samba/smbprn.8Dka0u (deleted) smbd????? 10099????????? root?? 72u????? REG????????????? 253,7???? 222603??????? 104 /var/spool/samba/smbprn.q6ZPY7 (deleted) smbd????? 10099????????? root?? 73u????? REG????????????? 253,7???? 221328??????? 109 /var/spool/samba/smbprn.K2YwWA (deleted) smbd????? 10099????????? root?? 74u????? REG????????????? 253,7????? 43780??????? 107 /var/spool/samba/smbprn.1o6uIX (deleted) smbd????? 10099????????? root?? 75u????? REG????????????? 253,7???? 221019??????? 108 /var/spool/samba/smbprn.KeH0O3 (deleted) smbd????? 10099????????? root?? 77u????? REG????????????? 253,7????? 43315??????? 111 /var/spool/samba/smbprn.KBL8ic (deleted) smbd????? 10100????????? root?? 34u????? REG????????????? 253,7???? 142770???????? 77 /var/spool/samba/smbprn.s1h496 (deleted) smbd????? 10100????????? root?? 35u????? REG????????????? 253,7????? 33696???????? 78 /var/spool/samba/smbprn.GncIKK (deleted) smbd????? 10101????????? root?? 33u????? REG????????????? 253,7???? 240900???????? 69 /var/spool/samba/smbprn.3WQlx1 (deleted) smbd????? 10101????????? root?? 34u????? REG????????????? 253,7???? 409379???????? 96 /var/spool/samba/smbprn.zZ5RbD (deleted) smbd????? 10101????????? root?? 35u????? REG????????????? 253,7???? 162610???????? 67 /var/spool/samba/smbprn.ziDbOl (deleted) smbd????? 10101????????? root?? 38u????? REG????????????? 253,7???? 242494???????? 68 /var/spool/samba/smbprn.X0YIZT (deleted) smbd????? 10101????????? root?? 42u????? REG????????????? 253,7???? 327729???????? 70 /var/spool/samba/smbprn.ZUwcjE (deleted) smbd????? 10101????????? root?? 43u????? REG????????????? 253,7???? 429289???????? 71 /var/spool/samba/smbprn.n5YHhG (deleted) smbd????? 11962??????? nobody?? 16u????? REG????????????? 253,7???? 123406???????? 74 /var/spool/samba/smbprn.Wclp0q (deleted) smbd????? 11962??????? nobody?? 33u????? REG????????????? 253,7??? 2804169???????? 86 /var/spool/samba/smbprn.BrKhuU (deleted) smbd????? 11962??????? nobody?? 35u????? REG????????????? 253,7????? 63284???????? 75 /var/spool/samba/smbprn.Aoq7I2 (deleted) smbd????? 11962??????? nobody?? 40u????? REG????????????? 253,7??? 4814097???????? 76 /var/spool/samba/smbprn.ZZy1rS (deleted) smbd????? 11962??????? nobody?? 41u????? REG????????????? 253,7????? 82282???????? 88 /var/spool/samba/smbprn.rAIBil (deleted) smbd????? 11962??????? nobody?? 42u????? REG????????????? 253,7???? 602346???????? 81 /var/spool/samba/smbprn.4ZTHAL (deleted) smbd????? 11962??????? nobody?? 44u????? REG????????????? 253,7?? 28309942???????? 83 /var/spool/samba/smbprn.45x0K9 (deleted) smbd????? 11962??????? nobody?? 45u????? REG????????????? 253,7??? 5608461???????? 84 /var/spool/samba/smbprn.bLuZXv (deleted) smbd????? 11962??????? nobody?? 46u????? REG????????????? 253,7??? 5603883???????? 85 /var/spool/samba/smbprn.MIA8uL (deleted) smbd????? 11962??????? nobody?? 47u????? REG????????????? 253,7???? 129605??????? 103 /var/spool/samba/smbprn.vv4vRt (deleted) smbd????? 11962??????? nobody?? 48u????? REG????????????? 253,7????? 82219??????? 115 /var/spool/samba/smbprn.dHbGuR (deleted) smbd????? 11962??????? nobody?? 49u????? REG????????????? 253,7????? 65393???????? 89 /var/spool/samba/smbprn.btj79i (deleted) smbd????? 11962??????? nobody?? 50u????? REG????????????? 253,7???? 774651???????? 90 /var/spool/samba/smbprn.6bMjov (deleted) smbd????? 11962??????? nobody?? 51u????? REG????????????? 253,7???? 873423???????? 91 /var/spool/samba/smbprn.qM3VjY (deleted) The /var/spool/samba folder is empty, but the smbprn.* temp file still use the space on filesystem because the file is already open, and after a while i get a filesystem full on /var. On this server I use the standard samba package release from Centos7: [root at server ~]# smbclient --version Version 4.10.16 [root at server ~]# rpm -q samba samba-4.10.16-13.el7_9.x86_64 samba is configured to share only a folder and some printers via cups with "security = user" and "map to guest = Bad User" Is this a know issue of this old version? There is some suggest to debug why the temp spool file is removed but not closed? Many thanks -- Dario Lesca (inviato dal mio Linux Fedora 33 Workstation)
Dario Lesca
2021-May-21 12:57 UTC
[Samba] Samba 4.10.x on centos7: smbd daemon it does not free the disk space used by the temporary files of shared printers
Il giorno mer, 19/05/2021 alle 10.28 +0200, Dario Lesca via samba ha scritto:> There is some suggest to debug why the temp spool file is removed but > not closed? > > Many thanks >I have investigate with cups log and inotifywait command and I have generate this log: [root at server ~]# tail -f /var/log/cups/access_log & [root at server ~]# [root at server ~]# inotifywait --monitor /var/spool/samba Setting up watches. Watches established. /var/spool/samba/ CREATE smbprn.arQ3mW /var/spool/samba/ OPEN smbprn.arQ3mW /var/spool/samba/ MODIFY smbprn.arQ3mW /var/spool/samba/ ATTRIB smbprn.arQ3mW /var/spool/samba/ MODIFY smbprn.arQ3mW /var/spool/samba/ MODIFY smbprn.arQ3mW /var/spool/samba/ MODIFY smbprn.arQ3mW /var/spool/samba/ MODIFY smbprn.arQ3mW /var/spool/samba/ OPEN smbprn.arQ3mW /var/spool/samba/ ACCESS smbprn.arQ3mW localhost - - [21/May/2021:14:37:45 +0200] "POST /printers/las2x HTTP/1.1" 200 37067 Print-Job successful-ok /var/spool/samba/ CLOSE_NOWRITE,CLOSE smbprn.arQ3mW /var/spool/samba/ DELETE smbprn.arQ3mW /var/spool/samba/ OPEN,ISDIR /var/spool/samba/ CLOSE_NOWRITE,CLOSE,ISDIR /var/spool/samba/ OPEN,ISDIR /var/spool/samba/ CLOSE_NOWRITE,CLOSE,ISDIR ^C [root at server ~]# lsof |grep smbprn.arQ3mW smbd 12915 root 97u REG 253,7 36770 191650 /var/spool/samba/smbprn.arQ3mW (deleted) [root at server ~]# ls -l /var/spool/samba/smbprn.arQ3mW ls: cannot access /var/spool/samba/smbprn.arQ3mW: No such file or directory Like you see, when the job is send to samba from windows, smbd daemon create a temp file, modify it, passed to cups to print and removed. But if I monitor the process via lsof, the temp file is still opened from smbd daemon also it's removed from disk. Someone can suggest to me some other test to try to know what's up? Many thanks -- Dario Lesca (inviato dal mio Linux Fedora 33 Workstation)
Dario Lesca
2021-Jun-14 19:45 UTC
[Samba] Samba 4.10.x on centos7: smbd daemon it does not free the disk space used by the temporary files of shared printers
Il giorno ven, 21/05/2021 alle 14.57 +0200, Dario Lesca via samba ha scritto:> Someone can suggest to me some other test to try to know what's up?My problem still exist. Sometime I must restart samba to free space I have notes that this problem only happens when I print from Windows on a printer queue configured in CUPS as classes. https://hub.packtpub.com/cups-how-manage-multiple-printers/ But the basic problem is that samba remove a temp jobs before close it.? Someone con help me to debug what's happen? Many thanks Dario