0

I would like to set transmission-daemon logging to a different file in order to spare the SD card. I tried to change the OPTIONS parameter in the /etc/default/transmission-daemon as is done in other Debian based systems:

" Default options for daemon, see transmission-daemon(1) for more options
OPTIONS="--config-dir $CONFIG_DIR --logfile /usbtorr/transmission.log"

However, when I start transmission-daemon I get a permissions error message:

$ sudo service transmission-daemon start
[....] Starting bittorrent daemon: transmission-daemonCouldn't open "/usbtorr/transmission.log": Permission denied
. ok 

Even if the file is completely open to everyone:

$ ls -la /usbtorr/transmission.log
-rwxrwxrwx 1 debian-transmission debian-transmission 0 Apr 11 08:48 /usbtorr/transmission.log

How can this made in Raspbian?

  • 1
    How about the permissions on /usbtorr? That's an issue too. Check stat /usbtorr. It should also be 777. – goldilocks Apr 11 '15 at 11:28
  • Thank you goldilocks, that was the issue. Once I switched group ownership of that folder to the debian-transmission things started working. I am glad to accept an answer if you file one. – Luís de Sousa Apr 11 '15 at 14:18
1

In order to write to a file, you need write permission on it, but you also need at least read+execute permission on all the directories leading to it. So for example, if transmission.log is set 666 (everyone can read and write to it) but the directory it is in, /usbtorr, is set 744 (owner rwx, everyone else just read) and you are not the owner, you will not be able to access that directory. This is a little confusing since you don't need execute permission to read a normal file, but you do need it to read/enter a directory.

By the way, you don't need execute permission to write to a file. So, presuming /usbtorr is owned root, the minimal permissions you would need would be 755 (owner rwx, everyone else rx) on /usbtorr and 666 (everyone rw) on transmission.log.

That presumes that transmission.log pre-exists, since without write permission on the directory, transmission won't be able to create the file (but if it is already there and writable, it could write to it, because it can read the directory, and write to a file which is writable for it, but it cannot create a new file there). So the best bet for the directory is actually 777.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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