Author Topic: Permissions issues  (Read 1790 times)

Offline SpicyRichter

  • Junior Indexer
  • **
  • Posts: 9
  • Helpful: +0/-0
Permissions issues
« on: 2017-08-14, 11:48:05 am »
I'm having what would seem like a simple permissions issue, but there's a conflict between the webserver and tmux

I'm getting constant errors in my php log:
Code: [Select]
[14-Aug-2017 04:04:32 America/New_York] PHP Warning:  gzopen(/var/www/nzedb/resources/nzb/9/e/b/5/9eb587f5f90b39fb5bb41191250b6d5710fc0322.nzb.gz): failed to open stream: Permission denied in /var/www/nzedb/nzedb/NZB.php on line 246
[14-Aug-2017 04:14:48 America/New_York] PHP Warning:  gzopen(/var/www/nzedb/resources/nzb/9/d/6/a/9d6abc7ba3c17473d31d8ee285679e3aee19ce0f.nzb.gz): failed to open stream: Permission denied in /var/www/nzedb/nzedb/NZB.php on line 246
[14-Aug-2017 04:31:49 America/New_York] PHP Warning:  chmod(): Operation not permitted in /var/www/nzedb/nzedb/NZB.php on line 275
[14-Aug-2017 04:36:28 America/New_York] PHP Warning:  gzopen(/var/www/nzedb/resources/nzb/4/5/6/f/456f321f79420f689e6fc4427c0f422ac5d396c5.nzb.gz): failed to open stream: Permission denied in /var/www/nzedb/nzedb/NZB.php on line 246

Now I've been doing a sudo chown -R www-data:www-data /var/www/nzedb/resources/nzb/ over and over but this issue seems to be that the new subfolders folders created in /nzb have permissions of:
Code: [Select]
drwxr-xr-x 2 root     root     4096 Aug 14 11:34 0

My tmux script doing post-processing doesn't have permissions to write to this folder... any ideas how to get around this?

Offline Darius

  • Enforcer
  • *****
  • Posts: 121
  • Helpful: +8/-1
Re: Permissions issues
« Reply #1 on: 2017-08-15, 12:40:13 am »
Are you running tmux as root?

Offline SpicyRichter

  • Junior Indexer
  • **
  • Posts: 9
  • Helpful: +0/-0
Re: Permissions issues
« Reply #2 on: 2017-08-15, 02:14:28 pm »
No, should I be?

Offline kaibosh

  • Overlord
  • ******
  • Posts: 161
  • Helpful: +18/-0
Re: Permissions issues
« Reply #3 on: 2017-08-15, 06:06:57 pm »
No the tmux scripts should never be run as root. However, that example directory is owned by root so it looks like either tmux was run by root, or perhaps a chown command.

Based on the chown command you're using there, you must be running the scripts as the www-data user, correct?

Offline Darius

  • Enforcer
  • *****
  • Posts: 121
  • Helpful: +8/-1
Re: Permissions issues
« Reply #4 on: 2017-08-15, 11:44:57 pm »
Tmux should be run as normal user, not root, not www-data. www-data is used only for web part.

Offline SpicyRichter

  • Junior Indexer
  • **
  • Posts: 9
  • Helpful: +0/-0
Re: Permissions issues
« Reply #5 on: 2017-08-18, 07:49:57 pm »
Thanks guys, I figured it out, I think I may have run tmux as root once by accident