Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

12 minutes ago, emb531 said:

So the issue actually appears to be the "Log Deleted Files?" option - once this is enabled the syslog starts being spammed with the smbd_audit logs again.

The part of samba used for the logging of deleted files is generating those messages.  Go to a command line and do this command:

Quote

/etc/rc.d/rc.rsyslogd restart

and see if the messages stop.  Let me know if they do.  I may need to look into a race condition when the plugin installs.

Link to comment
2 hours ago, emb531 said:

I re-enabled the logging, saw entries in syslog, ran the command to restart syslog, messages still continuing.  Thanks for your quick responses!

Guve me the resuts of the following:

ls /etc/rsyslog.d/

and

cat /etc/rsyslog.d/03-recycle-bin.conf

 

Link to comment
6 hours ago, dlandon said:

Guve me the resuts of the following:

ls /etc/rsyslog.d/

and

cat /etc/rsyslog.d/03-recycle-bin.conf

 

Quote

ls /etc/rsyslog.d/
01-blocklist.conf  03-recycle-bin.conf

Quote

cat /etc/rsyslog.d/03-recycle-bin.conf
:msg,contains,"smbd_audit" stop

 

Link to comment

When I start Unraid, if I turn on the recycle bin plug-in, the array starts up very slowly, the longest time is about 10 minutes, the array does not start successfully, I have to stop the recycle bin plug-in and reboot the system.
When I don't turn on the recycle bin plugin, the array can start up quickly in a short time. So, how can I fix this problem?

Link to comment
2 hours ago, dskblh said:

When I start Unraid, if I turn on the recycle bin plug-in, the array starts up very slowly, the longest time is about 10 minutes, the array does not start successfully, I have to stop the recycle bin plug-in and reboot the system.
When I don't turn on the recycle bin plugin, the array can start up quickly in a short time. So, how can I fix this problem?

Post diagnostics.

Link to comment
  • 2 weeks later...

Whats going on with this plugin, constant changes to SMB messing with my config, i am trying to figure out what to do here.

 

I want to log my smb user activity, so i have configured in extra settings:

 

Quote

log level = 2 vfs:2
max log size = 50480
log file = /home/logserver/smblogs/samba.%m
vfs objects = full_audit
full_audit:prefix = %u|%I|%m|%S
full_audit:failure = none
full_audit:success = open

 

This does not appear to work because recycle.bin plugin has put its configuations regarding smb everywhere it seems, first we have:

/etc/samba/smb.conf

 

Quote

        # recycle bin parameters
        syslog only = No
        syslog = 0
        logging = 0
        log level = 0 vfs:0

 

and a little lower in the same conf.smb file:

 

Quote

# hook for recycle bin log settings
        include = /etc/samba/smb-recycle.bin.conf

# recycle_bin
        include = /etc/samba/smb-recycle_bin.conf

 

A double entry to multiple configs, checking these files we have:

smb-recycle.bin.conf

Quote

[global]
   syslog only = No
   syslog = 0
   logging = 0
   log level = 0 vfs:0

smb-recycle_bin.conf

Quote

#vfs_recycle_start
#Recycle bin configuration
[global]
   syslog only = No
   syslog = 0
   logging = 0
   log level = 0 vfs:0
#vfs_recycle_end

 

Is this working as intended? Why is it incisting on being in global, why are these multiple entries leading to the same configurations multiple times?

 

I want to have some kind of acitivty logging of files being accessed via smb, i put this into extra but i believe the global variable that recycle bin plugin puts in many places of loglevel 0 overwrites my settings as it works on unraid without recycle.bin plugin installed.

 

I love this plugin and its a must have, so i really want to make sure i am not breaking anything by fiddling with these settings, your advise would be greatly appreciated, thank you!

Edited by je82
Link to comment
Just now, dlandon said:

Reboot.  Some changes were made and the legacy settings are still in the smb.conf.

damn, my unraid is actually a production server so i cannot reboot it right now, can i just modify the files and run

Quote

smbcontrol all reload-config

samba restart

if yes? which parts would i remove safetly? the entry in smb.conf for recycle.bin i take it? and perhaps one of the multiple includes?

Thank you again for the support.

Link to comment
1 minute ago, dlandon said:

Remove these.

ok, but there is still an recycle.bin entry directly inside smb.conf saying:

        # recycle bin parameters
        syslog only = No
        syslog = 0
        logging = 0
        log level = 0 vfs:0

 

Will this setting not overwrite my own loglevel setting in smb-extra.conf

Link to comment
Just now, je82 said:

ok, but there is still an recycle.bin entry directly inside smb.conf saying:

        # recycle bin parameters
        syslog only = No
        syslog = 0
        logging = 0
        log level = 0 vfs:0

 

Will this setting not overwrite my own loglevel setting in smb-extra.conf

These are correct.  Any settings you put in smb-extra.conf will overwrite those because smb-extra.conf is included after those settings.  The problem with the ones you removed is that they were after the smb-extra.conf include and were overwriting your settings.  You hadn't rebooted in a while and the legacy settings were building up.  Normally this doesn't cause any problems, but you are changing those settings in smb-extra.conf.  This is the reason for my latest changes.

 

You can check your settings with 'testparm' to be sure they are set the way you want.

  • Thanks 1
Link to comment
Just now, dlandon said:

These are correct.  Any settings you put in smb-extra.conf will overwrite those because smb-extra.conf is included after those settings.  The problem with the ones you removed is that they were after the smb-extra.conf include and were overwriting your settings.  You hadn't rebooted in a while and the legacy settings were building up.  Normally this doesn't cause any problems, but you are changing those settings in smb-extra.conf.  This is the reason for my latest changes.

 

You can check your settings with 'testparm' to be sure they are set the way you want.

Thanks, yes i noticed a lot of changes to SMB going on in both recycle.bin and unassigned devices :) All works now, thanks for clarifying! Have a good day and thanks for the amazing plugin!

Link to comment
  • 1 month later...

on RecycleBin settings page i get a error message:

Warning: A non-numeric value encountered in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(694) : eval()'d code on line 37

 

i remove and reinstall plugin version from 2022.12.10 but get same message

Link to comment
41 minutes ago, ichz said:

on RecycleBin settings page i get a error message:

Warning: A non-numeric value encountered in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(694) : eval()'d code on line 37

 

i remove and reinstall plugin version from 2022.12.10 but get same message

Can you show a screen shot of your Recycle Bin settings?

Link to comment

i dont know why but the error message is now no longer there

when i wrote my last message about the error message, it was in the upper left corner next to the title "Recycle Bin".

i have meanwhile changed only exclude directories from "Backups/Portables" to "Data pool/Backups/Portables".

 

20230113_194024.jpg

Link to comment
6 hours ago, ichz said:

i have meanwhile changed only exclude directories from "Backups/Portables" to "Data pool/Backups/Portables".

 

You can only specify a single sub-directory for a share.  Look at the Help:

List of directories to exclude from the Recycle Bin separated by commas. To specify a particular share directory, use 'share/directory'. You can specify up to one sub-directory. Unassigned Devices are specified the same way using 'mountpoint/directory'. Wild cards '*' and '?' are allowed in the directory name.

 

So you specify 'pool/Backups' for the complete 'Backups' directory.  If you are lookiing to exclude only the 'pool/Backups/Portables', specify it like 'pool/Portables'.

 

I see an issue with specifying multiple share folders.  I think this should work 'pool/Backups,pool/Portables', but it looks like only 'Portables' is excluded.  I think the Recycle Bin should exclude both 'Backups' and 'Portables' when specified this way.

 

 

  • Thanks 1
Link to comment

Since the update on 1/14 Recycle Bin is not working correctly, files are being deleted immediately and not being sent to the Recycle Bin.  I can see the parent folder in the Recycle Bin (Movies) but the actual folder/file that was deleted is not present.  Logging is working correctly and shows the unlinkat commands.  I have restarted the plugin but same issue.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.