Comments (6)
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.
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.
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.
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.
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.
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)
- Add support for WPA3 authentication for wireless connections
- Hostname change on interface causes raspberry os lite to fail on boot HOT 5
- .sh-script in Openmediavault HOT 2
- Raid 1 mounting problem exists after clean install of OMV HOT 1
- Some plugins are missing from OMV7 HOT 2
- Basic auth
- Only using NFSv2 and/or NFSv3 disabling NFS via TCP HOT 1
- OMV7 Fresh install on RPi 5 8GB - default admin user and password not working. HOT 1
- System Logs viewer cuts of messages containing text matching "<[A-Za-z]"
- IsDirty: Exception when executed without parameters HOT 1
- Add running tasks list, with option to stop/cancel HOT 1
- Log per task run with status indication HOT 1
- Provide known hosts handling from GUI HOT 2
- Best way to configure alerts on drive smart changes HOT 14
- Add python support to codeEditor component
- Allow codeEditor language to be dynamically changed
- re-creating a logical volume causes error 500 HOT 9
- Imported groups with GID > 65500 do not appear in the GUI HOT 1
- SSL-certs - something creates an empty folder named like a openmediavault cert - anacron job "check_ssl_cert_expiry" fails HOT 3
- Allow arbitrary UID/GID in rsync module. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmediavault.