Giter VIP home page Giter VIP logo

Comments (6)

votdev avatar votdev commented on May 29, 2024 4

The bug here is the line in the script:

run-parts --regex='samba-recycle-*' /var/lib/openmediavault/cron.d &> /dev/null

The script is running /bin/sh and &> is not a valid redirect. This only works inbash. The result is that when the command runs it interpretes &> as just a background command, then opens the stdin for writing to /dev/null. Nothing ever closes the open file handle so the process hangs waiting for input.

The quick fix is to just use the correct sh file redirect syntax ...

run-parts --regex='samba-recycle-*' /var/lib/openmediavault/cron.d > /dev/null 2>&1

Fixed in openmediavault 6.0.11, see 8ce5a0f.

from openmediavault.

cmcginty avatar cmcginty commented on May 29, 2024 1

The bug here is the line in the script:

run-parts --regex='samba-recycle-*' /var/lib/openmediavault/cron.d &> /dev/null

The script is running /bin/sh and &> is not a valid redirect. This only works inbash. The result is that when the command runs it interpretes &> as just a background command, then opens the stdin for writing to /dev/null. Nothing ever closes the open file handle so the process hangs waiting for input.

The quick fix is to just use the correct sh file redirect syntax ...

run-parts --regex='samba-recycle-*' /var/lib/openmediavault/cron.d > /dev/null 2>&1

from openmediavault.

h45rd avatar h45rd commented on May 29, 2024

Been having the same issue for a while as well.
Also see various reports in the OMV board, e.g. here.
@votdev's change to the trapping did not fix the problem for me either.

Gave up debugging and working around the issue with a custom cronjob for now until I upgrade to OMV4 and have some spare time.

from openmediavault.

Fantu avatar Fantu commented on May 29, 2024

I tried to add some logging on the script, on start, on end and on trap execute including exit status.
executing them manually all works, from omv cron instead in few day never end logging, only 2 trap (1 exit0 and 1 exit1), some lock remained and other never started.
I not understand what happen and what is the cause of issue :(

EDIT:
I just noticed a difference, dash should be the default shell in this version of debian:
ls -alh /bin/sh
lrwxrwxrwx 1 root root 4 mag 9 2017 /bin/sh -> dash
the script from first line having /bin/sh should use it, root instead from env SHELL=/bin/bash, tried to change the first line of both in /bin/bash FWIK should use bash instead and I'll see if will be execute without issue also from cron.

from openmediavault.

Fantu avatar Fantu commented on May 29, 2024

Finally seems working also automatically with cron: #80
Someone that have the same issue can tests it and tell me if ok please? Is not fast do accurate check on production system where I use it because have a very big amount of files with hundreds or more delete each hour, tried to execute manually 3 hours after cron and gave me another big list of delete but with a fast look on recycle on latest change date of files seems ok.
I also spotted that delete of empty directory works only with latest of tree, for example:
....recycle/dir1/dir2/dir3/.../dirN/
delete only dirN and the command that delete empty dir. should be execute many times to do a full clean, I added 7 times on my system but I not added in PR as it not seems good.

from openmediavault.

h45rd avatar h45rd commented on May 29, 2024

I think I finally figured out what was still causing this issue for me (even on OMV4 with the latest patchlevel).

The other day I deleted a rather large directory consuming a lot of inodes on my mergerfs union and ran into rm: fts_read failed.
As my .recycle tends to get quite big before automatic deletion would/should occur, I assume OMV's samba-recycler script occasionally ran into the same issue, which caused the exit trap to fail and the lock to stay in place. Resulting in the recycler not getting deleted until manual intervention.

Since setting mergerfs' hard_remove mount option a couple of weeks ago, the samba recycling is back to working as intended.

from openmediavault.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.