Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a headless torrent client (Transmission) which downloads files into /home/username/downloads with the username debian-transmission, in the group debian-transmission.

I've added the account username to the group debian-transmission (it's also in the group username), and chmodded the /home/username/downloads folder recursively to 770, but I still can't delete anything when logged in with the username account. The umask set on downloaded files by Transmission is 18, so I don't know if that has something to do with it. Regardless, I chmodded the files manually post-download.

ls -lad /home/username/downloads gives

drwxrwx--- 38 username debian-transmission 4096 2012-04-19 11:39 /home/username/downloads

and

ls -la /home/username/downloads/<a file in this folder that won't delete> gives

ls: cannot open directory /home/username/downloads/<a file in this folder that won't delete>/: Permission denied

I had a look at Why can't I delete a file where I have group write permissions on? but the answer wasn't particularly helpful.

I thought I had got my head round *nix permissions, but obviously not!

share|improve this question
    
Can you provide the output of ls -lad /home/username/downloads and ls -la /home/username/downloads/<a file in this folder that won't delete> –  Paul Apr 19 '12 at 11:54
    
Also what filesystem is this on? Could well be there is an access control list or something there. –  ewanm89 Apr 19 '12 at 11:55
    
If you run the command groups before trying to delete the file, is debian-transmission listed? If not, try newgrp debian-transmission and then once again try to delete the file. If this fixes it, you simply haven't logged in to the new group yet. The group login happens on your next login shell, and if you run a GUI, the easiest way might be to restart it (or the computer, which will imply the first). –  Daniel Andersson Apr 19 '12 at 12:04
    
ls -lad /home/username/downloads gives drwxrwx--- 38 username debian-transmission 4096 2012-04-19 11:39 /home/username/downloads, and ls -la /home/username/downloads/<a file in this folder that won't delete> gives ls: cannot open directory /home/username/downloads/<a file in this folder that won't delete>/: Permission denied (directory name changed, of course) Filesystem is ext4. –  melat0nin Apr 19 '12 at 12:04
    
@DanielAndersson that was it! I hadn't logged in again since adding myself to the group. Thanks! –  melat0nin Apr 19 '12 at 12:07
show 4 more comments

1 Answer

up vote 1 down vote accepted

If you run

groups

before trying to delete the file, is debian-transmission listed?

If not, try

newgrp debian-transmission

and then once again try to delete the file. If this fixes it, you simply haven't logged in to the new group yet.

The group login happens with your next login shell, and if you run a GUI, the easiest way might be to restart it (or the computer, which will imply the first).

share|improve this answer
    
Alternatively, an issue I have with rtorrent and deleting files if they're still open in rtorrent (if they're uploading/downloading or not) –  Rob Apr 19 '12 at 15:56
    
@Rob: what is the issue? You should be able to delete the files, but rTorrent will certainly complain about them being missing if it tries to open the file descriptor (files currently open in rTorrent will actually only be "removed" in the sense that they are not visible from e.g. ls, but rTorrent will keep a hold on the data until it closes the descriptor and only then is the disk space in practice reclaimed as free). I don't think rTorrent recreates files unless specifically asked to, but I haven't done any controlled tests. –  Daniel Andersson Apr 20 '12 at 6:17
    
I've just been unable to delete files while I've had rtorrent running. It's easy enough to pop in, close the torrent, and then delete the files. –  Rob Apr 20 '12 at 23:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.