Trash as root (BUG report!!!)

Archived topics about LMDE 1 and LMDE 2
Locked
Ady

Trash as root (BUG report!!!)

Post by Ady »

[EDIT_UPDATE]
This is now a BUG report. See reply#10+)
[/EDIT_UPDATE]

I use LMDE Xfce x32. Using the file manager, I sometimes need to open a directory as root. If I delete some file as the root user, the file goes to the Trash.

But the Trash is not easily found when I am the root user. I am able to find the hidden directories that are the equivalent to the Trash, but I'd much rather find a way to show and open (and empty) the Trash as root.

Is there any way to activate this function? Does this feature depends on some configuration I would need to change? Or maybe by using a different file manager? Is/are there some command(s) (line) that can perform the same functions as the Trash does in a GUI file manager?

Any advice is appreciated. TIA.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Ady

Re: Trash as root

Post by Ady »

This is the third topic I open in the LMDE forum, and there is no answer :(. I don't think the topic is _that_ strange (nor my previous topics). Maybe I am posting in the incorrect forum :?: .
Ady

Re: Trash as root

Post by Ady »

Thank you for the reply. Unfortunately, those topics are not directly related nor describing my question.

In short: I want to have the Trash displayed in the file manager, not only when the file manager is used by my normal user (which is already the normal current default state), but also when I use the file manager as the root user.

I have also tried using another file manager in the same LMDE Xfce x32, and I also tried using a couple of LIVE Linux systems (I could provide more specific details if needed), but I was unable to see the Trash as root.

To be clear, I am able to find the respective ".Trash" directory in the file manager as root, but what I want is to be able to use the Trash in the same manner as when I open the file manager as the normal user. Maybe using a different specific file manager that is known to work correctly with the Trash as root user? Or perhaps, is there any option / preference I should change in the file manager in LMDE Xfce so to display the Trash when using it as root user?

Anyone, any thoughts, tips, ideas, suggestions?

TIA.
Ady

Re: Trash as root

Post by Ady »

Seriously, am I posting in the wrong section or what?
baptiste

Re: Trash as root

Post by baptiste »

it's just that there's not that many people reading the section, or people that know to answer that question.
and yes, maybe you should have gone into "desktops and window managers", then "xfce"

besides, you get what you've paid for. I'm here by chance and I'm only looking at this because of the funny title and because root is involved :o

did you try pcmanfm?
well I just did, and clicking on trash gives "operation not supported".

dunno why you would really want to manage files as root, but I've seen some people doing it. in xfce, xubuntu 10.04. someone added a hard drive, and a mounting point that belonged to root so only root could write to it.

that was solved by properly managing permissions and groups, which you can try do do as much as you can with the graphical tools (including a file manager as root if that's work for you).

for emptying the root's trash why not do a :
sudo rm -rf /root/.Trash/*

or put it in a script, in one of your folders
#!/bin/bash
gksudo "rm -rf /root/.Trash"

make the script executable and now you can empty the trash with a double click. and destroy it but I've tested the script and had some weird woes if I wrote .Trash/*
Ady

Re: Trash as root

Post by Ady »

Thanks for the reply.

Since I'm not using Linux Mint Xfce, but LMDE Xfce, I didn't think that posting in that other forum section was adequate.

A script is not really relevant in this topic. As I said, I am able to find the hidden root Trash and delete the files, whether from the file manager as root or from a root terminal. There are also scripts you could find with a web search. Unfortunately, that's not the point of this topic.

My intention is to be able to perform the same tasks on the root Trash as I do as a normal user.

For example, as a normal user you can empty the Trash with a couple of clicks in the file manager, independently of the source location of the original deleted file. I'd like to find some GUI (or TUI) file manager that could be able to perform the same Trash tasks as root, even if that means using a LIVE system instead of the installed LMDE Xfce.

I have read some post here about Ubuntu LIVE being able to show the root Trash, but since no specific details were provided (which version, which file manager, some preference or option used, anything), then I won't be able to replicate it.

If anyone knows about some GUI/TUI file manager that has root Trash capabilities (in whichever Linux OS, even a LIVE one), it will be appreciated.

TIA.
craigevil

Re: Trash as root

Post by craigevil »

Just empty the Trash from a terminal.

Code: Select all

rm -rf ~/.Trash/*
No clue how thunar works, but most file manager have a setting that can be changed so files are deleted and not sent to the trash.
Ady

Re: Trash as root

Post by Ady »

Thanks for the reply.
craigevil wrote:Just empty the Trash from a terminal.

Code: Select all

rm -rf ~/.Trash/*
The root terminal, a command line or a script are NOT what I'm interested in. I am able to do it, but this topic is not about that. In addition, that would be about one root Trash task only: to empty it.
No clue how thunar works, but most file manager have a setting that can be changed so files are deleted and not sent to the trash.
Such option would completely take out the root Trash tasks, so that's not what I'm looking for.

I'm looking for a GUI/TUI tool (file manager or otherwise) that would allow me to use the Trash when I'm using the GUI/TUI tool as root, just with the same methods a normal user would. For typical file managers, this would mean the capabilities to:

_ recover files from, or;
_ view, or;
_ empty

the root Trash when using the file manager as root, just as when we use the same file manager as normal user and we click over the Trash to see the content of the "normal user's" Trash.

In other words, I'm looking for a GUI/TUI file manager that supports the same features (including the Trash related features) when using it as the root user as when using it as a normal user, except for the relevant differences of permissions, owner, group and location of the respective Trash (and whatever else is different between the normal Trash and the root Trash).

Does anyone know about such GUI/TUI tool (for LMDE or for a different distro)? Maybe from a LIVE system? Maybe it won't be a file manager but a different kind of GUI/TUI tool?

Could it be possible that no file manager behaves the same (or has the same features) when using it as normal user than when using it as root?

TIA.
baptiste

Re: Trash as root

Post by baptiste »

actually there's a "desktop stuff -> xfce" section in the LMDE forum ;)

I believe you're being picky, if you already navigate to the Trash directory then why not be content with that. running software as root other than a shell prompt and system tools isn't typical.

/edit : see my second post ! it's fixed :)

maybe you should try to run thre whole graphical session as root. i.e. you try to log in as root from the login screen.
yes this will make any sysadmin scream like hell but why not :), you will be taking any and all responsibility and can only disrupt your own computer anyway. you're free to do anything, I'm not one of those types that say "only use sudo! root is dangerous and forbidden"

I guess the trash is handled by "GVFS" which is what gnome-like file managers rely on as a backend. it does automounting of USB drives, and stuff, and the trash.
the file managers crap themselves, probably developers of the file managers or GVFS didn't really test your use case.

but, I've found something, a command that moves a file to trash!
http://www.unix.com/man-page/OpenSolaris/1/gvfs-trash/
I've tested it and it works, both as user and root. looks like the trash actually is in ~/.local/share/Trash !
I could Trash a file as root!

I guess you can use that, hehe. to restore a file just move it back to its former location (the info is in ~/.local/share/Trash/info , feel free to have a look)
I guess I *could* possibly write a dirty tool. I think of a script that uses a zenity file chooser.
but try to run this command from a terminal : zenity --file-selection
as user, it perfectly works. it shows a graphical file chooser, you can choose your file, the window closes and it prints out the path and file name in the terminal. how cute of a command :D. it allows to build crude "applications" as scripts.

if I run the same as root it says : (I just used su or sudo su in a terminal)
(zenity:8045): GVFS-RemoteVolumeMonitor-WARNING **: cannot connect to the session bus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
I guess dbus doesn't work as root or something. please try to run the whole desktop and tell us if it works..
Last edited by baptiste on Thu May 10, 2012 9:55 pm, edited 1 time in total.
baptiste

Re: Trash as root

Post by baptiste »

I've tried another file manager called xfe. my intuition was already calling for it.
it's technically much simpler than the usual ones, few dependencies yet has a fairly familiar interface. doesn't muck with gvfs, dbus etc.

running it as root is okay, and it access Trash!, from the top menu bar.
Ady

Re: Trash as root

Post by Ady »

Thanks for the replies.

There seems to be a BUG in Thunar.

I installed Xfe with all the dependencies, even when it meant several unnecessary packages and additional (unnecessary) tools added.

Until now, I was using my normal user login and then opening the file manager I was testing (Thunar, Xfe and whichever file manager I tested before) as root user.

I now made several tests using Thunar and Xfe under 3 situations:
1_ Login as normal user and using the file manager as normal user.
2_ Login as normal user and using the file manager as root user.
3_ Login as root user and using the file manager as root user.

I deleted a file to the respective Trash under #1, #2 and #3 situations above.

The results:

1.A_ Using Xfe, the deleted-to-Trash file goes to

Code: Select all

/home/normal_user/.local/share/Trash
1.B_ Using Thunar, the deleted-to-Trash file goes to

Code: Select all

/home/normal_user/.local/share/Trash
So for #1, there is no difference.

2.A_ Using Xfe, the deleted-to-Trash file goes to

Code: Select all

/root/.local/share/Trash
2.B_ Using Thunar, the deleted-to-Trash file goes to

Code: Select all

/home/.Trash-0
So for #2, it seems as if the root Trash location is different depending on the file manager used.

3.A_ Using Xfe, the deleted-to-Trash file goes to

Code: Select all

/root/.local/share/Trash
3.B_ Using Thunar, the deleted-to-Trash file goes to

Code: Select all

/home/.Trash-0
So for #3, it seems as if the root Trash location is different depending on the file manager used.

Now the good news:

Under #3, Thunar finally shows the Trash and all normal tasks can be performed (show the root Trash, empty it and so on). So the moved-to-root-Trash files while using #3.A (Xfe) are correctly seen in the root Trash in Thunar (left panel in Thunar), as in

Code: Select all

/root/.local/share/Trash
.

So, there is a feature request and a bug for Thunar in LMDE Xfce x32.


Feature request:

When login as normal user and the user opens Thunar as root (by means of the mouse menu), Thunar should be able to display the root Trash at its left-side panel, just as it can display it when we login to the Xfce session as root.


Bug in Thunar:

Although the root Trash location is

Code: Select all

/root/.local/share/Trash
Thunar deleted-to-root-Trash files are going to the wrong location

Code: Select all

/home/.Trash-0
.


I'd like to know if this is only happening in LMDE Xfce x32, or maybe it is something that a newer version of Thunar should correct. According to the answer, I'd like to know where this bug should be reported (to Thunar?, to Debian?, to LMDE?, to Xfce?), or if using a newer version of Thunar should solve this problem (bug corrected).

Or maybe the problem is in (some configuration file in) LMDE Xfce, and Thunar is working as it should?

Since Xfe is based on FOX toolkit and is working correctly in LMDE, then maybe the problem is not only in Thunar, but in every file manager based on GTK+2?

Any advice / tip / help is appreciated.

TIA.
Ady

Re: Trash as root (BUG report!!!)

Post by Ady »

I wish someone could reply so to report this bug to LMDE developers!!!

With further investigations, it seems that Thunar itself is not the problem, and this seems to be also related to the issues presented in other topics (like the ones presented in reply#2 above in this same topic).

The problem, as far as i can tell, is gvfs-trash from Gnome, which is a common dependency of GTK+2 based file managers, like Thunar. I could be wrong, but anyway this MUST be investigated by LMDE devs.

That's why gvfs-trash command line is also not performing the same as other command line Trash implementations (and there are many reports about this in different distros; just perform a web search).

From the freedesktop.org Trash specification (http://freedesktop.org/wiki/Specifications/trash-spec and http://www.ramendik.ru/docs/trashspec.html):
For showing trashed files, implementations SHOULD support (1) and (2) at the same time (i.e. if both $topdir/.Trash/$uid and $topdir/.Trash-$uid are present, it should list trashed files from both of them).
The final result for Thunar should be that "Trash:///" should show (and act) simultaneously with both the cases mentioned in the freedesktop specification (1) and (2), which represent the two different paths for the root superuser

Code: Select all

/root/.local/share/Trash
and

Code: Select all

/home/.Trash-0
.

This is a BUG in LMDE (Xfce).

Resolving this issue will also resolve the problems presented by others with external devices and/or FAT filesystems in relation to Trash (including potential recovery of move-to-trash files).

So, please, how can we effectively report this BUG issue so it will be resolved for all LMDE users (and possibly for other distros too)?
baptiste

Re: Trash as root (BUG report!!!)

Post by baptiste »

I bet the people responsible for gvfs would be interested, or that at least it would be relevant for them.

maybe you can "abuse" the ubuntu community and bug reporting tool, I suggest you try reproducing bug in xubuntu 12.04 (and why not lubuntu), which if you have enough memory is trivial to install under virtualbox.

here an exemple of a bug report I've found, related to another gvfs feature
https://bugs.launchpad.net/ubuntu/+sour ... bug/212789
Ady

Re: Trash as root (BUG report!!!)

Post by Ady »

Thanks for the reply. Really.

I actually tried testing with several other LIVE distros (booting with them the same system where LMDE Xfce x32 is installed), with LXDE or Xfce (both based on GTK+2).

Although the Xfce website mentions some gvfs plug in for the trash features, I wasn't able to actually find such thing. Now I'm not sure where the source of the problem is. I decided to stop trying to find out and leave that part to the relevant developers. Instead, I decided to report this as a simple user and nothing more (which is BTW accurate).

I opened a new topic in the forum, focused only on the reproducible bug report. Maybe the relevant LMDE Xfce Team will at least take note, and hopefully maybe 3 years from now we'll see some movement.

The new bug report topic is located at http://forums.linuxmint.com/viewtopic.p ... 0&t=102061.

I confess I am a little bit disappointed on the forum. A user trying to report a problem is supposed to get yet an additional account :!: , this time in Launchpad. Then I see SO many reports not even acknowledged :shock: , and even the relevant tags are not updated. That's a general impression, and my personal short experience here is that I shouldn't expect much answers, with maybe some rare exceptions. I only can hope to be proved wrong.
baptiste

Re: Trash as root (BUG report!!!)

Post by baptiste »

you're welcome ; I saw you really insisting on it again so I took a bit of my time to see how far can we get this (not much at the moment, really)

thing is your bug is merely an inconsistency, not a show stopping one, and rather on a corner case.
file manager as root is rare, and so trash as root is even more rare, and especially "power users" who only do root things at the terminal and don't use trash much if at all, wouldn't even think of doing that or it being important.

your bug interested me and especially the question "how to report it", well maybe I've filed one bug in my whole life, I don't remember.
learning how to reach the relevant community, support forum or other place is not trivial. this is why I'm taking time with you, as I'm learning it as well ;)

have in mind there are no professionnal, paid-for support employees! except some staff at Canonical, or support for the Red Hat (RHEL) distros that is sold to corporate customers.
only curious people like me wasting their time, developers giving theirs, and a few various other people.

an attitude of "this is A BUG! please FIX IT NOW!!" won't get you much sympathy actually. you will just turn people off. I found you a bit aggressive and just stayed because I was curious and had a lot of free time. not many people waste as much time as I do.
also LMDE forum is quite small and now one is paid for scanning threads all day and forwarding requests.

one nice way to reach people is to use IRC. it's yet some work (find chat program, connect to server etc.) but no registration needed, you get a more speech-like, immediate communication and it's quite comfortable - some involved people monitor it, others come by and start or pick up a conversation.
again, the big pile of software that runs your desktop is so complex, it's hard to find who is "responsible" for the bug or who is willing to help you. why not the xfce community support - I've just hit this web page, which is damn siimple and helpful. whovever did the site did a good job.
http://www.xfce.org/community

IMO reaching the IRC channel and dropping your question would be interesting. (let the chat open for a good while)
Ady

Re: Trash as root (BUG report!!!)

Post by Ady »

I'd like to clarify my comments.

First, the bug is not a show-stopper for me, but it is clearly present in many systems, as a web search will show. Many users won't notice this issue as a root Trash problem, but instead would see it as some wasted space / size not being available after deleting files, usually from FAT or NTFS partitions, or from external media. Hence, we should not think of this as an uncommon situation (like using Thunar as root, which I'm not doing all the time, but only for a specific purpose). Moreover, advance users will be able to solve the question about "why I don't gain available space when deleting files" by themselves, but less experienced user won't. As I demonstrated in my bug report posted at http://forums.linuxmint.com/viewtopic.p ... 0&t=102061, using a command line utility (trash-cli), the problem could be “solved” (workaround), so again this issue affects less experienced users.

My second main point is that, as explained in the freedesktop.org trash specs, the Trash function should work correctly, period. If Thunar claims to follow the specs (which it indeed claims), and a bug is discovered, they should try to solve it. Currently this is being ignored.

Since, as you said, not many users will take the time to answer, much less to report a bug, and much less to report it in a way that is reproducible and useful for the devs, then the bug report system should be as clear, useful and usable as it can. It isn't. When I, as a user, see hundreds of bug reports not being acknowledged at all (for Mint, LMDE and Xfce respectively), the impression is..., well, not a good one. I have found out I'm certainly not the only one getting this impression.

Before my bug report at http://forums.linuxmint.com/viewtopic.p ... 0&t=102061 I took the time to reproduce the problem under different situations and compare it with other versions of Xfce and Thunar. For each of my posts (not just in this topic), I patiently waited for days for some kind of answer.

For some reason, you (wrongly) interpreted my words as "I want this solved, and I want it now!", which I haven't said at all. My comments about the time it would take to solve this problem is not about me (as said, _I_ am able to survive without it :P ).

Let's think about it for a second. This has been reported in Launchpad for Linux Mint before. This has been reported to Xfce before. The reports are there for years (I actually searched for them). They are not as detailed as mine in http://forums.linuxmint.com/viewtopic.p ... 0&t=102061, but they are there. Yet, not even acknowledged. So there is no way we could expect this to be solved in the near future. In addition, Xfce 4.10 has been released, but it won't get into Debian 7.0, so it won't get into Debian Testing repos until next year, at best. But then, Xfce 4.10 will probably won't correct the problem either (the reports are not acknowledged, and the changelog doesn't include any Trash bugfixes from Thunar 1.2.3 to the current 1.4 included in Xfce 4.10).

My comment about the time will take for this issue to be resolved in LMDE is about the process of bug reports from users, and effectively solving them. But if this were to be a show-stopper, then what a user should expect? To post a question, wait for 10 days, realize there is not going to be an answer, and reinstall the OS (or move on to another distro)? The forum has plenty of repeating questions and old “announcement / sticky” topics with meaningless polls, but the bug-report system is not being attended as it should :?:.

My intention was NOT selfish ("I want this solved for me, and I want it now, and for free" :shock: ); not at all. I took the time to test it, I'm trying to bring attention from the relevant people here (LMDE Team) not for me but for all LMDE users (and probably for all Thunar users). I'm trying to contribute, but the impression is that I shouldn't expect this to be solved in the near future. If no LMDE Team (nor Thunar Team) member cares enough, or if they don't have the time, or if the whole bug report system has effectively crashed, then I guess this won't get to be solved. It's a pity for ALL users, not just for the one that is just trying to report a bug (and will somehow survive anyway if it is not solved).

Sorry for the rant. I wanted to clarify my words and maybe change the (wrong) impression I might have left.
titetanium
Level 2
Level 2
Posts: 81
Joined: Mon Jun 18, 2012 4:26 pm

Re: Trash as root (BUG report!!!)

Post by titetanium »

Hi,

Just for this, I took your challenge and figured a way you can do this, but not through thunar or pcmanfm. My solution is to use rox-filer, which I use extensively. It has features no other file manager can match, save for midnight commander, IMO.
Then download the trashcan applet for rox-filer and extract to your home directory. Open rox-filer as user then from inside that, open another folder as root. Delete a test file and open the trashcan, you can see all the files you deleted as root. Back up to the home folder and right-click the trashcan. Files are gone, no muss, no fuss, and no prompts for root password either. Best I can come up with for you and you can have your cake and eat it too.
Ady

Re: Trash as root (BUG report!!!)

Post by Ady »

@titetanium,

Thank you for your suggestion.

I already tried several different file managers (Rox included), and most of them, including Rox, add too many packages. It is a waste of resources, just to try to have a workaround for what should already work correctly in Thunar itself. Moreover, each file manager adds also its own "quirks" about the Trash management.

As I already mentioned, trash-cli seems to be the most effective WORKAROUND.

A real solution (as oppose to a workaround) would be for Thunar's developers to correctly handle the Trash as root (super)user. I may push this bug report some day, by posting in the Xfce.org forum, or maybe some developer of some distro :shock: :mrgreen: using Xfce and Thunar might be interested enough to report this issue upstream.
Locked

Return to “LMDE Archive”