openmediavault-emby plugin (formerly mediabrowser)
-
- OMV 2.x
- Sergio
-
-
Hi gang, I keep getting this error when activating MediaBrowser.
ZitatError #4000: exception 'OMVException' with message 'Failed to execute command 'omv-mkconf mediabrowser moveDbFolder 2>&1': update-rc.d: using dependency based boot sequencing insserv: warning: current start runlevel(s) (empty) of script `mediabrowser' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mediabrowser' overrides LSB defaults (0 1 6). Moving database from </var/lib/mediabrowser> to </media/9b302b5e-387c-4a12-86b7-74f5df36047b>... chown: changing ownership of `/media/9b302b5e-387c-4a12-86b7-74f5df36047b/aquota.group': Operation not permitted chown: changing ownership of `/media/9b302b5e-387c-4a12-86b7-74f5df36047b/aquota.user': Operation not permitted' in /usr/share/openmediavault/engined/module/mediabrowser.inc:98 Stack trace: #0 /usr/share/openmediavault/engined/rpc/config.inc(180): OMVModuleMediaBrowser->applyConfig() #1 [internal function]: OMVRpcServiceConfig->applyChanges(Array, Array) #2 /usr/share/php/openmediavault/rpcservice.inc(125): call_user_func_array(Array, Array) #3 /usr/share/php/openmediavault/rpcservice.inc(158): OMVRpcServiceAbstract->callMethod('applyChanges', Array, Array) #4 /usr/share/openmediavault/engined/rpc/config.inc(224): OMVRpcServiceAbstract->callMethodBg('applyChanges', Array, Array) #5 [internal function]: OMVRpcServiceConfig->applyChangesBg(Array, Array) #6 /usr/share/php/openmediavault/rpcservice.inc(125): call_user_func_array(Array, Array) #7 /usr/share/php/openmediavault/rpc.inc(79): OMVRpcServiceAbstract->callMethod('applyChangesBg', Array, Array) #8 /usr/sbin/omv-engined(501): OMVRpc::exec('Config', 'applyChangesBg', Array, Array, 1) #9 {main}
Any help would be great.
Thanks.
-
Sergio:
maybe you can have a look here:
Disaster - all data lost
ThxEdit:
how about creating a subfolder in the $DATA-directory like:/media/1234-uuid-ofthe-hdd-here-567/shared-folder/mediabrowser-data
where sharedfolder is the DATA-directory setup in the plugin. Then you can easily delete and/or move the mediabrowser-data-folder without loosing other data by mistake.
-
-
the problem is in the current plugin you can't select a specific folder for the database. You can only select the database media. After click save the database folder come by itself and can't change.
-
So telling that the cache folder it's your favorite media folder will obviously be self-defeating.
We have to prevent users to select their media folders, so that they don't loose their data -> create a sub-directory is IMO a must!Edit:
Just tried it in a VM:
I chose /media/6db7602d-5e7a-4580-8cc9-15a3044fb6a2 (testfolder) as the DB-Volume, the DB-folder looks like this:
/media/6db7602d-5e7a-4580-8cc9-15a3044fb6a2
and mediabrowser creates all of its folders in the root of this drive:Code
Alles anzeigen-rw------- 1 root root 6144 Nov 15 11:09 aquota.group -rw------- 1 root root 7168 Nov 15 11:09 aquota.user drwxrwxrwx 4 mediabrowser users 4096 Nov 15 12:42 cache drwxrwxrwx 3 mediabrowser users 4096 Nov 15 12:42 config drwxrwxrwx 7 mediabrowser users 4096 Nov 15 12:43 data drwxrwxrwx 3 mediabrowser users 4096 Nov 15 12:42 ffmpeg drwxrwxrwx 7 mediabrowser users 4096 Nov 15 12:42 ImagesByName drwxrwxrwx 2 mediabrowser users 4096 Nov 15 12:42 localization drwxrwxrwx 2 mediabrowser users 4096 Nov 15 12:42 logs drwxrwxrwx 2 mediabrowser users 16384 Feb 14 2014 lost+found drwxrwxrwx 3 mediabrowser users 4096 Nov 15 12:42 root drwxrwsrwx 2 mediabrowser users 4096 Nov 15 11:35 SharedFolder1 drwxrwsrwx 2 root users 4096 Jul 4 09:51 SharedFolder2 drwxrwsrwx 2 root users 4096 May 28 19:57 test444_SH drwxrwsrwx 2 mediabrowser users 4096 May 27 17:19 testforsmb
If I remove the plugin, it removes /media/6db7602d-5e7a-4580-8cc9-15a3044fb6a2 with ALL the shares!
That is a NoGo!
Create a subfolder in /media/6db7602d-5e7a-4580-8cc9-15a3044fb6a2 like "mediabrowser-db-data" or something like that and you can only delete/move this folder.I can only warn ppl to use version 1.02 of the plugin:
It can delete ALL your Data if it is misconfigured!
I know, you made it clear, but if someone make a wrong click -> BAM!
rm -rf $DATAFOLDER (which is the main root of the drive with all the shares) -
And it would be good if the subdirectory were chown mediabrowser:nogroup and the service was run mediabrowser:nogroup. You may sacrifice the ability of the service to delete media files but is this not a good thing.
More thoughts here:
-
-
<p>Hey guys, i just installed this could add librarys everything but for some reason i am not able to play anything, anbody had something like this before it seems like it isnt encoding anything</p>
-
Changing the ownership of the files would not help. The postrm script runs as root and can delete whatever it wants. I did tell him that most of the plugins don't delete database files and it can be dangerous.
To fix the plugin is easy. The upgrade for people who have the plugin already installed is hard. I will install the plugin and see exactly what files/dirs it installs. Then change the plugin code to move only those exact files/dirs.
-
Read my notes on other post. I saw the postrm. Why is the cache file copied and then removed? Why not just move it?
The ownership should be changed to prevent other problems. I believe the UI gives ability to delete. If that is the case any user could delete files. You do not want this. Service should not run using "users" as group.
With other plugins the package removes it. It is not in the postrm.
-
-
Moving files is dangerous. If you have a glitch in the middle, you could half the files in two locations. Copying is much better.
The ownership doesn't fix the problem. The files are only deleted when the plugin is uninstalled. The plugin (unlike all the other plugins) deletes the database files on uninstallation in the postrm file. I discussed this with Sergio and told him I wouldn't remove them.
If you switch the location, they will be moved but not gone. All of these actions happen as root (just like everything else in OMV), so permissions don't help.
All this would be fixed by using a subfolder. There is nothing wrong with the rest of the plugin.
-
I am not talking about cache files now. I am talking about preventing people's media files being erased by another user in the hosuehold via the UI. I am saying the whole service should be run as mediabrowser:nogroup. It should only need the media folder to be chmod 775 to read them. But you don't want the service to be able to delete any media files. If you make it part of the users group things can be deleted via the UI.
-
I agree with that (and will fix) but that is not the major problem here. Uninstalling this plugin is very dangerous and people will lose everything on that drive!
-
-
Yes, I am just saying I saw 2 major problems. Sorry for confusion...
-
He used the code from other plugins (minidlna, calibre, etc) and the mediabrowser user is added to the user group. I can run the daemon as mediabrowser:nogroup but I don't know if that keeps it from deleting files because the mediabrowser user is still part of the user group. If the mediabrowser user is not part of the user group, will that cause any issues??
-
I don't believe it will cause any issues. It does not in plex. When media shared folders are created they just need to be chmod 775, which is the default.
Where in the code was the mediabrowser user added to the users group??? That should be removed. I wonder what the default is for this program?
It is in the postinst file that he added the mediabrowser user to the users group. Change it to nogroup.
PS- if there were issues changing the user's group there would have been a problem when it was changed to the "users" group.
-
-
The user is created and added to the user group in the postinst file. Calibre does the same thing and the minidlna plugin adds the minidlna user to the user group. Code changed on github.
-
Minidlna does not have a UI where things can be deleted. My opinion is, it is better for people's data to not be deleted by a service, especially where there is a UI with no login required. Some of these programs have apps that would allow deletion too.
You wake up one morning and your kid has deleted "Star Trek Into Darkness".
-
I agree. Testing changes now.
-
-
-
Hopefully not a lot of stuff got ruined at Serg's house. I guess his wife called him at work and he rushed home. Wife said sparks came out of plugs or something. Lightning storm.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!