I'm using Fatrat (http://fatrat.dolezel.info/) on a headless server. I would like every file and folder it creates (downloads) to be set with permissions umask 770 , so I can delete it via Samba user which is in the same group as the user that runs the Fatrat application

How can I achieve that?


Use the umask command to set the umask before executing Fatrat. umask only changes the umask for the current shell and any commands started from it, so if you are launching Fatrat from a shortcut or window manager keybinding try using sh -c "umask $YOUR_NEW_UMASK; exec fatrat" as the command.

  • I'm launching Fatrat as a headless service on Arch Linux: ExecStart=/usr/bin/fatrat -n and Type=simple. So should I change run the service in one-line: ExecStart=sh -c "umask 007; exec /usr/bin/fatrat -n" or split it to two ExecStart lines? – Joudicek Jouda Oct 29 '13 at 19:28
  • Yes, do it as one line. You actually cannot have multiple ExecStart lines unless the type is oneshot (which isn't what you want here). – wingedsubmariner Oct 29 '13 at 22:00
  • OK, so if anyone else stumbled upon this, the solution for rwxrwx--- is: ExecStart=/bin/sh -c "umask 007 ; /usr/bin/fatrat -n" (drop "exec" from previous versions) – Joudicek Jouda Oct 30 '13 at 12:15
  • The exec will get rid of the no longer needed shell process. Did it not work with exec? – wingedsubmariner Oct 30 '13 at 13:35
  • Yes it did not work - some problem with parameters. – Joudicek Jouda Oct 30 '13 at 16:10

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.