PhrozenByte / rmtrash

Put files (and directories) in trash using the `trash-put` command in a way that is, otherwise as `trash-put` itself, compatible to GNUs `rm` and `rmdir`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`rmdirtrash` blowing up in loop

kleinjm opened this issue · comments

When running the redirtrash I see the following

tty: illegal option -- -
usage: tty [-s]

Followed by a stream of

/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
/usr/local/bin/rmdirtrash: fork: Resource temporarily unavailable
basename: illegal option -- o
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]
rmdirtrash: failed to remove '-o': No such file or directory
tty: illegal option -- -
usage: tty [-s]

That happens in an endless loop till I kill it

Obviously I'll need some more info 😉 Like what distribution are you using, which utilities (GNU, Busybox, ...), what shell (dash, bash, ...), some info about the device (embedded?) and so on.

The tty issue doesn't seem to be the only one, the biggest issue is probably fork: Resource temporarily unavailable, indicating that you're running out of file descriptors. Very weird, this should be quite impossible on an ordinary system and under normal circumstances, so my assumption is that there's something sustainable going wrong on your system. Nevertheless, you can try replacing the following line

tty --quiet

by

tty > /dev/null 2>&1

Does this change anything (I guess not, but let's try...)?