[How-To] Giving Plugins Write Permissions to Your Data

Status
Not open for further replies.

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I don't see anything in the OP about sickrage. Should we be updating from the git or from freenas? I know before I used this:

chown -R media:media /usr/pbi/sickbeard-amd64/share/sickbeard/*

To be able to update from the git.
MJk4DSc.png
You should be using that "Update Now" button (which uses github.org, doesn't actually use 'git').
The command you posted was one step of converting a sickbeard plugin to sickrage, but... that whole process is no longer relevant.
 

Supa

Patron
Joined
Jan 10, 2014
Messages
204
I've ran the commands to add the user but I'm still getting permission denied when trying to update. Is there something else I'm missing?

S
WkVl8mO.png


I have given all my folders access as well.

9XOvSfj.png



Ended up just doing "CHMOD -R 777 /usr/pbi"
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I've ran the commands to add the user but I'm still getting permission denied when trying to update. Is there something else I'm missing?

S
WkVl8mO.png


I have given all my folders access as well.

9XOvSfj.png



Ended up just doing "CHMOD -R 777 /usr/pbi"
Your last attempt to "chmod -R 777 /usr/pbi" will probably break stuff. This issue here is that in order for a program to update itself it needs write permissions to it's source files.
Code:
chown -R guest:guest /usr/pbi/sickrage-amd64/share/sickrage
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So any way to undo what I did? or would I have to reinstall?
Did you invest alot into that sickrage/jail? If so I can try giving you some steps to fix it.
But... if not, I suggest you just delete sickrage, reinstall sickrage, and do your user changes again.
 

Supa

Patron
Joined
Jan 10, 2014
Messages
204
I've re-installed it but I can't start the plugin now...

This is after adding the user and everything. I made sure to re-mount the storage as well.

PID dir: /var/run/sickrage must be writable (write permissions). Exiting.
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I've re-installed it but I can't start the plugin now...

This is after adding the user and everything. I made sure to re-mount the storage as well.

PID dir: /var/run/sickrage must be writable (write permissions). Exiting.
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
I little detail I left out of the OP... gotta delete/chown the pid directory.
Code:
rm -r /var/run/sickrage
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I guess restoring the config through the sickrage gui doesn't really restore anything huh.
Not sure. If I want to restore an install I always just back+restore my /var/db/sickrage directory
 

Supa

Patron
Joined
Jan 10, 2014
Messages
204
So everything including the TV show list in Sickrage and the Movie wanted list in CP should be able to be restored from that folder correct? As well as the settings?

/var/db/PLUGIN.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So everything including the TV show list in Sickrage and the Movie wanted list in CP should be able to be restored from that folder correct? As well as the settings?

/var/db/PLUGIN.
yes
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
did you try 'service mediabrowser onestart' and see the error. it might have been the pidfile folder wasn't writable. deleting it should fix this 'rm /var/run/mediabrowser.pid'

I am revisiting this and still no luck.

I even tried just changing the UID of the emby user in the jail from 989 to what I need. When I do a service emby-server onestart I get:

Code:
root@emby_1:/var/run # service emby-server onestart
Starting emby_server.


but the server does not start.

Would really love to figure this out.

Cheers,
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I am revisiting this and still no luck.

I even tried just changing the UID of the emby user in the jail from 989 to what I need. When I do a service emby-server onestart I get:

Code:
root@emby_1:/var/run # service emby-server onestart
Starting emby_server.


but the server does not start.

Would really love to figure this out.

Cheers,
mind summarizing what you did exactly. your trying solution 2 right? none of these solutions require changing the UID of a user, and that would require resetting the ownership of the data directory/pidfile directory as those files are still owned by the old UID.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
OK, I think I may have got it.

What I did was:

Code:
service emby-server onestop
pw usermod emby -n emby -u ###
pw usermod emby -n emby -g ###
(where ### is the UID and GID of the user I want it to be)
chown -R emby:emby /var/db/emby-server
sysrc 'emby-server_user=emby'
service emby-server start


Now the service seems to start and emby-server is able to write to my mount points with the proper user in both the jail and the native FreeNAS system.

I will keep trucking with this and see if it works. Would be nice to not need VirtualBox for Emby.

Cheers,
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
OK, I think I may have got it.

What I did was:

Code:
service emby-server onestop
pw usermod emby -n emby -u ###
pw usermod emby -n emby -g ###
(where ### is the UID and GID of the user I want it to be)
chown -R emby:emby /var/db/emby-server
sysrc 'emby-server_user=emby'
service emby-server start


Now the service seems to start and emby-server is able to write to my mount points with the proper user in both the jail and the native FreeNAS system.

I will keep trucking with this and see if it works. Would be nice to not need VirtualBox for Emby.

Cheers,
Looks like a good set of steps to me. The sysrc command you have isn't necessary since you are still using the default user.
It should continue to work. I personally run Emby (and rely on it for streaming to Kodi + Remotely) so I'll know if it ever doesn't work on FreeNAS.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
Looks like a good set of steps to me. The sysrc command you have isn't necessary since you are still using the default user.
It should continue to work. I personally run Emby (and rely on it for streaming to Kodi + Remotely) so I'll know if it ever doesn't work on FreeNAS.

Thanks for the information. Prior to me executing 3, 5 & 6 above, the service would not start. It did not give me an error, it just would not run. So, I am not sure if the chown or sysrc commands are needed as and ls -l showed the owner of the /var/db/emby-server as emby:emby after 2 and 3 were completed.

At least it is running, will do a bit of testing and see how it goes! Thank you for the help.

Cheers,
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks for the information. Prior to me executing 3, 5 & 6 above, the service would not start. It did not give me an error, it just would not run. So, I am not sure if the chown or sysrc commands are needed as and ls -l showed the owner of the /var/db/emby-server as emby:emby after 2 and 3 were completed.

At least it is running, will do a bit of testing and see how it goes! Thank you for the help.

Cheers,
I would think it would show the owner as 989 (which is no longer mapped to a user in the jail). but, I actually haven't tried changing a users UID before.

either way, glad you have it working.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
I would think it would show the owner as 989 (which is no longer mapped to a user in the jail). but, I actually haven't tried changing a users UID before.

either way, glad you have it working.
I would have to check out what happens to the folder...

Now the question is: does the UID get changed if I update Emby to the next release when that comes out?

Cheers,
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I would have to check out what happens to the folder...

Now the question is: does the UID get changed if I update Emby to the next release when that comes out?

Cheers,
I don't think so. when the new emby pbi installs it will see an emby user exists (not caring about the UID) and not create any new users.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
ohh and I think I know why Solution 2 didn't work for you creating a new user. your sysrc command is wrong for emby
it should be..
Code:
sysrc emby_server_user=USER
 
Status
Not open for further replies.
Top