permissions problem

Get help, report and discuss bugs.
Post Reply
scoobynz
Posts: 15
Joined: 25 Jan 2010, 22:24

permissions problem

Post by scoobynz » 14 Feb 2010, 17:59

Hello,

If it isnt broken dont touch it. . . . they say.

I adjusted my nzbget.conf file to specify the path names so that the server could start and server shutdown would work via the web interface – this is now working!

However, since doing this I note that everything I download does not post-process, the error message is that the post-process script cannot start due to “permission denied.”

I therefore had a look at the permissions on the folders that had been downloaded. Whilst the permissions used to be read/write for all (i.e. drwxrwxrwx 2 craig users), the permissions are now drwxr-xr-x 2 www-data www-data. The files are downloading into home/craig/download/dst.

I note that I used to start manually through screen from home/craig/nzbget-0.7.0, using the conmand nzbget -D. The command I am now using is /usr/local/bin/nzbget -D -c /home/craig/.nzbget 2>&1 from within the nzbget.conf file.

Permissions etc are not my strength any suggestions would be appreciated.

Regards,
Craig

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: permissions problem

Post by hugbug » 15 Feb 2010, 08:20

Can you please post your log-file at the point where it report the problem with few extra line before it to see the context.
It could be permissions on the post-processing script or its configuration file.

scoobynz
Posts: 15
Joined: 25 Jan 2010, 22:24

Re: permissions problem

Post by scoobynz » 15 Feb 2010, 12:07

Below is an excerpt of my logfile, showing the problem.

Code: Select all

Successfully downloaded The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip/BSP11_Disc2.part051.rar [198/211]
Sun Feb 14 17:25:57 2010	DETAIL	Successfully downloaded The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip/BSP11_Disc2.part051.rar [149/211]
Sun Feb 14 17:25:57 2010	DETAIL	Checking articles for The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip/BSP11_Disc2.part051.rar
Sun Feb 14 17:25:57 2010	INFO	Successfully downloaded The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip/BSP11_Disc2.part051.rar
Sun Feb 14 17:25:57 2010	INFO	Collection The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip completely downloaded
Sun Feb 14 17:25:57 2010	INFO	Queueing The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip for post-process-script
Sun Feb 14 17:25:57 2010	INFO	Pausing queue before post-process-script
Sun Feb 14 17:25:57 2010	INFO	Executing post-process-script for The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip
Sun Feb 14 17:25:57 2010	ERROR	Could not start script: Permission denied
Sun Feb 14 17:25:57 2010	INFO	Completed post-process-script for The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip
Sun Feb 14 17:25:57 2010	INFO	post-process-script for The_Boy_in_the_Striped_Pyjamas_(2008)_dvdrip terminated with unknown status
Sun Feb 14 17:25:57 2010	INFO	Unpausing queue after post-process-script
Sun Feb 14 17:26:58 2010	INFO	Stopping, please wait...
Sun Feb 14 17:26:58 2010	INFO	Deleting lock file
Sun Feb 14 17:43:33 2010	INFO	nzbget 0.7.0-testing-r374 daemon-mode
Sun Feb 14 17:43:33 2010	INFO	Scheduler: set download rate to 50 KB/s

Before I used to have the DestDir as ~/download/dst (where ~ was home/craig/) but when I started the server via the web interface is would say, cannot create the folder www/var/download/dst, folder does not exist and do not have permissions. I therefore changed the nzbget.conf to explicitly state the path, i.e. I replaced ~ with /home/craig/ in the nzbget.conf file. I think this is related to this problem, seeing as previously is was trying to create the directory in www/var etc, now it is saying that the owner / user of the folders created in /home/craig/download/dst is www.

To clarify, I installed nzbget and keep the config file in /home/craig. The nzbgetweb.php is kept in /home/web/ as this is where my webserver looks for web interfaces.

Many thanks.
C

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: permissions problem

Post by hugbug » 15 Feb 2010, 12:39

It can't start the pp-script.
Check the permissions for post-processing script. It should have permission "execute by others" in order to be started by user "www".

Add the permission "execute for all":

Code: Select all

chmod +x postprocess-example.sh
or give the file ALL permissions (read/write/execute for all users, not recommended if you care about security):

Code: Select all

chmod 777 postprocess-example.sh
or set the owner to "www":

Code: Select all

chown www postprocess-example.sh
For more info google "linux file permissions".

scoobynz
Posts: 15
Joined: 25 Jan 2010, 22:24

Re: permissions problem

Post by scoobynz » 15 Feb 2010, 13:39

Thanks, have changed the permissions on the postprocess and this works now - good advice as usual!

However, it doesn’t seem correct that even though the folders created by nzbget are created in home/craig/download/dst they not owned by “craig.” The owner is “www-data” and not “craig” which leads to problems when I want to use the folders / files from my user craig. Is there a way to have nzbget change the permissions of the folders it creates so that they are accessible by craig from craig. This is what used to happen, not to sure why the folder and file owner has changed. . . . . but guess it has something to do with where the program is started (i.e. i used to start it from within craig but now the start-up script from the web interface starts it from usr/local/bin etc. . . ..

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: permissions problem

Post by hugbug » 15 Feb 2010, 14:16

scoobynz wrote:but guess it has something to do with where the program is started
It's important who (what user) starts the program, not where it is located. In your case NZBGet is started by web-server running under a special user account. All created files are assigned to that user.

Set the option UMask to "000" in nzbget.conf. This will give the all access permissions for all users to all created files and directories.
See UMask in wikipedia for more info.

scoobynz
Posts: 15
Joined: 25 Jan 2010, 22:24

Re: permissions problem

Post by scoobynz » 15 Feb 2010, 14:38

Perfect, thank-you!

Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests