FAQ  •  Register  •  Login

Linux permissions for media files

<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Thu Dec 27, 2012 5:15 am

Linux permissions for media files

I am having issues with my current configuration of serviio on Ubuntu 12.04

I created a user named serviio (group serviio)
  Code:
sudo useradd -r -d /usr/bin/serviio -U serviio

Furthermore, the user serviio is added to the group called "home"
  Code:
sudo usermod -a -G home serviio

So, the user serviio is in ther groups...
  Code:
$ groups serviio
serviio : serviio home

Using an upstart script, serviio.sh is called after networking is started.
  Code:
description "Serviio media server"
author "serviio.org"

setuid serviio

start on started networking
script
   /usr/bin/serviio/bin/serviio.sh
end script


All this listed above is working fine. Here is the problem.

My media library (including the folder) is stored by a user other than serviio, but of the group "home"
  Code:
drwxrws--- 9 hwmonkey   home 4096 Dec 26 02:57 videos


Serviio indicates a permission problem...
  Code:
2012-12-27 00:08:31,699 DEBUG [RepositoryDAOImpl] Reading all Repositories
2012-12-27 00:08:31,700 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/videos' is either not an existing directory or cannot be read due to access rights
2012-12-27 00:08:31,701 DEBUG [RepositoryDAOImpl] Marking Repository 1 as scanned with current timestamp
2012-12-27 00:08:31,733 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/audio' is either not an existing directory or cannot be read due to access rights
2012-12-27 00:08:31,733 DEBUG [RepositoryDAOImpl] Marking Repository 2 as scanned with current timestamp


HELP!!
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Fri Dec 28, 2012 1:45 pm

Re: Linux permissions for media files

As a follow-up, I tried changing the directory permissions to:
  Code:
drwxrwsr-- 9 hwmonkey home 4096 Dec 27 23:39 videos


The files have satisfactory permissions too:
  Code:
-rw-rw-r-- 1 hwmonkey home  734220288 Sep  6 01:33 MyMovie.avi


And yet...
  Code:
2012-12-28 08:40:21,937 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/videos' is either not an existing directory or cannot be read due to access rights


So, where is the real permission problem??? Hmm, is it the sticky on the folder?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Dec 28, 2012 3:00 pm

Re: Linux permissions for media files

If you switch to serviio user, can you access the files in the FS?
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Sat Dec 29, 2012 4:42 am

Re: Linux permissions for media files

Yes. Demonstration within the videos directory:
  Code:
$ touch zzz
$ ls -l
-rw-rw-r-- 1 serviio home          0 Dec 28 23:39 zzz

Perhaps it has to do with upstart (???). The process is running as the user serviio though...
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Sat Dec 29, 2012 5:12 am

Re: Linux permissions for media files

Additional follow-up -- I do not see how it could be the upstart. The processes seem to be running under the proper user.
  Code:
$ ps aux | grep servii
serviio   1172  0.0  0.0   4400   612 ?        Ss   Dec28   0:00 /bin/sh -e -c /usr/bin/serviio/bin/serviio.sh /bin/sh
serviio   1173  0.0  0.0   4400   688 ?        S    Dec28   0:00 /bin/sh /usr/bin/serviio/bin/serviio.sh
serviio   1185  0.6  1.1 2896588 89632 ?       Sl   Dec28   0:07 java -Xmx512M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=/usr/bin/serviio/library -Dserviio.home=/usr/bin/serviio -classpath /usr/bin/serviio/lib/*:/usr/bin/serviio/config org.serviio.MediaServer
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Dec 29, 2012 12:43 pm

Re: Linux permissions for media files

Just an idea, but are the home and gazebo folders readable for the group as well?
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Sat Dec 29, 2012 1:25 pm

Re: Linux permissions for media files

The group "home" has read permission for /home/gazebo_shared, but not the /home directory. But, everyone has permission for the /home directory. This is normal:
  Code:
drwxr-xr-x   5 root root  4096 Dec 26 00:06 /home/home
drwxr-sr--  5 gazebo   home     4096 Dec 26 01:14 /home/gazebo_shared
drwxrws--- 2 hwmonkey   home 4096 Dec 26 01:14 /home/gazebo_shared/audio
drwxrwsr-- 9 hwmonkey   home 4096 Dec 28 23:39 /home/gazebo_shared/videos
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Sun Dec 30, 2012 6:18 am

Re: Linux permissions for media files

Maybe something else in the log could help (??)
  Code:
2012-12-30 01:09:55,199 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 01:09:55,199 INFO  [MediaServer] Serviio DLNA media streaming server v 1.1 (rev. 6ba0dd933a8e+)
2012-12-30 01:09:55,199 INFO  [MediaServer] Petr Nejedly 2009-2012
2012-12-30 01:09:55,199 INFO  [MediaServer] http://www.serviio.org
2012-12-30 01:09:55,199 INFO  [MediaServer]
2012-12-30 01:09:55,199 INFO  [MediaServer] Java 1.6.0_24-Sun Microsystems Inc.
2012-12-30 01:09:55,199 INFO  [MediaServer] OS Linux amd64 3.2.0-35-generic
2012-12-30 01:09:55,199 INFO  [MediaServer] File encoding: US-ASCII
2012-12-30 01:09:55,199 INFO  [MediaServer] Headless mode enabled: true
2012-12-30 01:09:55,199 INFO  [MediaServer] User: serviio
2012-12-30 01:09:55,199 INFO  [MediaServer] User home dir: /usr/bin/serviio
2012-12-30 01:09:55,199 INFO  [MediaServer] Temp dir: /tmp
2012-12-30 01:09:55,199 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 01:09:55,255 INFO  [WebServer] Socket buffer set to 65535 bytes
2012-12-30 01:09:55,255 INFO  [RestletServer] Starting Restlet server (/rest) exposed on port 23423
2012-12-30 01:09:55,271 INFO  [RestletServer] Starting Restlet server (/cds) exposed on port 23424
2012-12-30 01:09:55,271 INFO  [RestletServer] Starting Restlet server (/mediabrowser) exposed on port 23424
2012-12-30 01:09:55,277 INFO  [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2012-12-30 01:09:55,880 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 01:09:55,880 INFO  [MediaServer] License: PRO (EVALUATION, id: 11111111-1111-1111-1111-111111111113)
2012-12-30 01:09:55,880 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 01:09:56,001 INFO  [ProfilesDefinitionParser] Parsing Profiles definition
2012-12-30 01:09:56,297 INFO  [ProfilesDefinitionParser] Added profile 'Generic DLNA profile' (id=1)
2012-12-30 01:09:56,474 INFO  [ProfilesDefinitionParser] Added profile 'Samsung TV (B-series)' (id=2)
2012-12-30 01:09:56,579 INFO  [ProfilesDefinitionParser] Added profile 'Xbox 360' (id=3)
2012-12-30 01:09:56,741 INFO  [ProfilesDefinitionParser] Added profile 'Playstation 3' (id=4)
2012-12-30 01:09:56,836 INFO  [ProfilesDefinitionParser] Added profile 'Samsung TV (A-series)' (id=5)
2012-12-30 01:09:56,909 INFO  [ProfilesDefinitionParser] Added profile 'DirecTV HD-DVR' (id=6)
2012-12-30 01:09:57,142 INFO  [ProfilesDefinitionParser] Added profile 'Samsung TV / player (C/D/E-series)' (id=7)
2012-12-30 01:09:57,156 INFO  [ProfilesDefinitionParser] Added profile 'LG TV / player' (id=8)
2012-12-30 01:09:57,517 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2012)' (id=sony2012)
2012-12-30 01:09:57,938 INFO  [ProfilesDefinitionParser] Added profile 'Sony BD Player / SMP' (id=10)
2012-12-30 01:09:58,104 INFO  [ProfilesDefinitionParser] Added profile 'Toshiba REGZA' (id=13)
2012-12-30 01:09:58,199 INFO  [ProfilesDefinitionParser] Added profile 'WDTV Live' (id=14)
2012-12-30 01:09:58,215 INFO  [ProfilesDefinitionParser] Added profile 'LaCie LaCinema Media Player' (id=15)
2012-12-30 01:09:58,298 INFO  [ProfilesDefinitionParser] Added profile 'Manta WIFI Centre' (id=16)
2012-12-30 01:09:58,324 INFO  [ProfilesDefinitionParser] Added profile 'Pure Flow' (id=17)
2012-12-30 01:09:58,460 INFO  [ProfilesDefinitionParser] Added profile 'Sharp Aquos' (id=18)
2012-12-30 01:09:58,530 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2011)' (id=sony2011)
2012-12-30 01:09:58,670 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2010)' (id=sony2010)
2012-12-30 01:09:58,884 INFO  [ProfilesDefinitionParser] Added profile 'Philips' (id=20)
2012-12-30 01:09:58,960 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2009)' (id=sony2009)
2012-12-30 01:09:58,989 INFO  [ProfilesDefinitionParser] Added profile 'Denon AVR' (id=22)
2012-12-30 01:09:59,260 INFO  [ProfilesDefinitionParser] Added profile 'Panasonic Viera G/GT/DT/UT/VT (2011/2012)' (id=viera2011a)
2012-12-30 01:09:59,293 INFO  [ProfilesDefinitionParser] Added profile 'Panasonic Viera E/S/ST/VT (2011)' (id=viera2011)
2012-12-30 01:09:59,332 INFO  [ProfilesDefinitionParser] Added profile 'Panasonic Viera (2010)' (id=viera2010)
2012-12-30 01:09:59,379 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2012) - US' (id=sony2012us)
2012-12-30 01:09:59,425 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2011) - US' (id=sony2011us)
2012-12-30 01:09:59,492 INFO  [ProfilesDefinitionParser] Added profile 'Sony AVReceiver STR' (id=SonySTR)
2012-12-30 01:09:59,529 INFO  [ProfilesDefinitionParser] Added profile 'Sony Audio CMT' (id=SonyCMT)
2012-12-30 01:10:00,018 INFO  [ProfilesDefinitionParser] Added profile 'Hack for Sony BD' (id=eaa)
2012-12-30 01:10:00,038 INFO  [ProfilesDefinitionParser] Parsing Profiles definition
2012-12-30 01:10:00,140 INFO  [ProfilesDefinitionParser] Added profile 'Flash player' (id=flv_player)
2012-12-30 01:10:00,203 INFO  [ProfilesDefinitionParser] Added profile 'ServiiGo' (id=serviigo)
2012-12-30 01:10:00,250 INFO  [ProfilesDefinitionParser] Added profile 'Windows Phone 8' (id=wp8)
2012-12-30 01:10:00,292 INFO  [Device] Created UPnP Device with UUID: (censored), bound address: 172.20.XXX.XXX (censored)
2012-12-30 01:10:00,302 INFO  [PluginCompilerThread] Looking for plugins at /usr/bin/serviio/plugins
2012-12-30 01:10:00,302 INFO  [PluginCompilerThread] Started looking for plugins
2012-12-30 01:10:00,303 INFO  [UpdateChecker] Checking if a new version is available
2012-12-30 01:10:00,323 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "dcraw": java.io.IOException: error=2, No such file or directory
2012-12-30 01:10:00,323 WARN  [MediaServer] DCRAW not found. Support for raw image files will be missing.
2012-12-30 01:10:00,328 INFO  [AbstractTranscodingDeliveryEngine] Cleaning transcode engine and its data
2012-12-30 01:10:00,342 INFO  [WebServer] WebServer starting on port 8895
2012-12-30 01:10:00,344 INFO  [EventSubscriptionExpirationChecker] Starting EventSubscriptionExpirationChecker
2012-12-30 01:10:00,344 INFO  [EventDispatcher] Starting EventDispatcher
2012-12-30 01:10:00,347 INFO  [DiscoverySSDPMessageListener] Starting DiscoverySSDPMessageListener using interface eth0 (eth0) and address 172.20.XXX.XXX, timeout = 0
2012-12-30 01:10:00,348 INFO  [DiscoveryAdvertisementNotifier] Starting DiscoveryAdvertisementNotifier
2012-12-30 01:10:00,350 INFO  [RendererExpirationChecker] Starting RendererExpirationChecker
2012-12-30 01:10:00,350 INFO  [RendererSearchSender] Searching for Renderer devices, will multicast on 1 NICs
2012-12-30 01:10:26,372 INFO  [FeedUpdaterThread] Started looking for information about online resources
2012-12-30 01:10:26,379 INFO  [LibraryAdditionsCheckerThread] Started looking for newly added files
2012-12-30 01:10:26,389 INFO  [LibraryUpdatesCheckerThread] Started looking for updates to currently shared files
2012-12-30 01:10:26,389 INFO  [PlaylistMaintainerThread] Started looking playlist changes
2012-12-30 01:10:26,410 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/videos' is either not an existing directory or cannot be read due to access rights
2012-12-30 01:10:26,476 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/audio' is either not an existing directory or cannot be read due to access rights

Then, there is the log when the process is stopped:
  Code:
2012-12-30 08:55:31,209 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/videos' is either not an existing directory or cannot be read due to access rights
2012-12-30 08:55:31,222 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/audio' is either not an existing directory or cannot be read due to access rights
2012-12-30 08:59:39,673 WARN  [IndexedDiskCache] Region [online_technical_metadata] Disk cache not shutdown properly, shutting down now.
2012-12-30 08:59:39,673 WARN  [IndexedDiskCache] Region [thumbnails] Disk cache not shutdown properly, shutting down now.
2012-12-30 08:59:39,676 INFO  [LibraryAdditionsCheckerThread] Finished looking for newly added files
2012-12-30 08:59:39,776 INFO  [LibraryUpdatesCheckerThread] Finished looking for updates to currently shared files
2012-12-30 08:59:39,876 INFO  [FeedUpdaterThread] Finished looking for online resources information
2012-12-30 08:59:39,976 INFO  [PluginCompilerThread] Finished looking for plugins
2012-12-30 08:59:40,077 INFO  [WebServer] WebServer shutting down
2012-12-30 08:59:40,077 INFO  [DiscoveryAdvertisementNotifier] Leaving DiscoveryAdvertisementNotifier
2012-12-30 08:59:40,078 INFO  [EventSubscriptionExpirationChecker] Leaving EventSubscriptionExpirationChecker, removing all event subscriptions
2012-12-30 08:59:40,078 INFO  [DiscoverySSDPMessageListener] Leaving DiscoverySSDPMessageListener
2012-12-30 08:59:40,078 INFO  [EventDispatcher] Leaving EventDispatcher
2012-12-30 08:59:40,081 INFO  [DatabaseManager] Shutting down database
2012-12-30 08:59:40,245 INFO  [AbstractTranscodingDeliveryEngine] Cleaning transcode engine and its data

But, if run as root, everything is happy (of course):
  Code:
2012-12-30 09:04:11,134 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 09:04:11,134 INFO  [MediaServer] Serviio DLNA media streaming server v 1.1 (rev. 6ba0dd933a8e+)
2012-12-30 09:04:11,134 INFO  [MediaServer] Petr Nejedly 2009-2012
2012-12-30 09:04:11,134 INFO  [MediaServer] http://www.serviio.org
2012-12-30 09:04:11,134 INFO  [MediaServer]
2012-12-30 09:04:11,134 INFO  [MediaServer] Java 1.6.0_24-Sun Microsystems Inc.
2012-12-30 09:04:11,134 INFO  [MediaServer] OS Linux amd64 3.2.0-35-generic
2012-12-30 09:04:11,134 INFO  [MediaServer] File encoding: UTF-8
2012-12-30 09:04:11,134 INFO  [MediaServer] Headless mode enabled: true
2012-12-30 09:04:11,134 INFO  [MediaServer] User: root
2012-12-30 09:04:11,134 INFO  [MediaServer] User home dir: /root
2012-12-30 09:04:11,135 INFO  [MediaServer] Temp dir: /tmp
2012-12-30 09:04:11,135 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 09:04:11,190 INFO  [WebServer] Socket buffer set to 65535 bytes
2012-12-30 09:04:11,191 INFO  [RestletServer] Starting Restlet server (/rest) exposed on port 23423
2012-12-30 09:04:11,206 INFO  [RestletServer] Starting Restlet server (/cds) exposed on port 23424
2012-12-30 09:04:11,207 INFO  [RestletServer] Starting Restlet server (/mediabrowser) exposed on port 23424
2012-12-30 09:04:11,213 INFO  [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2012-12-30 09:04:11,823 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 09:04:11,823 INFO  [MediaServer] License: PRO (EVALUATION, id: 11111111-1111-1111-1111-111111111113)
2012-12-30 09:04:11,823 INFO  [MediaServer] ------------------------------------------------------------------------
2012-12-30 09:04:11,944 INFO  [ProfilesDefinitionParser] Parsing Profiles definition
2012-12-30 09:04:12,241 INFO  [ProfilesDefinitionParser] Added profile 'Generic DLNA profile' (id=1)
2012-12-30 09:04:12,423 INFO  [ProfilesDefinitionParser] Added profile 'Samsung TV (B-series)' (id=2)
2012-12-30 09:04:12,541 INFO  [ProfilesDefinitionParser] Added profile 'Xbox 360' (id=3)
2012-12-30 09:04:12,698 INFO  [ProfilesDefinitionParser] Added profile 'Playstation 3' (id=4)
2012-12-30 09:04:12,805 INFO  [ProfilesDefinitionParser] Added profile 'Samsung TV (A-series)' (id=5)
2012-12-30 09:04:12,883 INFO  [ProfilesDefinitionParser] Added profile 'DirecTV HD-DVR' (id=6)
2012-12-30 09:04:13,145 INFO  [ProfilesDefinitionParser] Added profile 'Samsung TV / player (C/D/E-series)' (id=7)
2012-12-30 09:04:13,159 INFO  [ProfilesDefinitionParser] Added profile 'LG TV / player' (id=8)
2012-12-30 09:04:13,515 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2012)' (id=sony2012)
2012-12-30 09:04:13,905 INFO  [ProfilesDefinitionParser] Added profile 'Sony BD Player / SMP' (id=10)
2012-12-30 09:04:14,074 INFO  [ProfilesDefinitionParser] Added profile 'Toshiba REGZA' (id=13)
2012-12-30 09:04:14,162 INFO  [ProfilesDefinitionParser] Added profile 'WDTV Live' (id=14)
2012-12-30 09:04:14,178 INFO  [ProfilesDefinitionParser] Added profile 'LaCie LaCinema Media Player' (id=15)
2012-12-30 09:04:14,253 INFO  [ProfilesDefinitionParser] Added profile 'Manta WIFI Centre' (id=16)
2012-12-30 09:04:14,280 INFO  [ProfilesDefinitionParser] Added profile 'Pure Flow' (id=17)
2012-12-30 09:04:14,455 INFO  [ProfilesDefinitionParser] Added profile 'Sharp Aquos' (id=18)
2012-12-30 09:04:14,513 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2011)' (id=sony2011)
2012-12-30 09:04:14,660 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2010)' (id=sony2010)
2012-12-30 09:04:14,832 INFO  [ProfilesDefinitionParser] Added profile 'Philips' (id=20)
2012-12-30 09:04:14,892 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2009)' (id=sony2009)
2012-12-30 09:04:14,921 INFO  [ProfilesDefinitionParser] Added profile 'Denon AVR' (id=22)
2012-12-30 09:04:15,188 INFO  [ProfilesDefinitionParser] Added profile 'Panasonic Viera G/GT/DT/UT/VT (2011/2012)' (id=viera2011a)
2012-12-30 09:04:15,226 INFO  [ProfilesDefinitionParser] Added profile 'Panasonic Viera E/S/ST/VT (2011)' (id=viera2011)
2012-12-30 09:04:15,257 INFO  [ProfilesDefinitionParser] Added profile 'Panasonic Viera (2010)' (id=viera2010)
2012-12-30 09:04:15,311 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2012) - US' (id=sony2012us)
2012-12-30 09:04:15,363 INFO  [ProfilesDefinitionParser] Added profile 'Sony Bravia TV (2011) - US' (id=sony2011us)
2012-12-30 09:04:15,430 INFO  [ProfilesDefinitionParser] Added profile 'Sony AVReceiver STR' (id=SonySTR)
2012-12-30 09:04:15,466 INFO  [ProfilesDefinitionParser] Added profile 'Sony Audio CMT' (id=SonyCMT)
2012-12-30 09:04:15,956 INFO  [ProfilesDefinitionParser] Added profile 'Hack for Sony BD' (id=eaa)
2012-12-30 09:04:15,978 INFO  [ProfilesDefinitionParser] Parsing Profiles definition
2012-12-30 09:04:16,085 INFO  [ProfilesDefinitionParser] Added profile 'Flash player' (id=flv_player)
2012-12-30 09:04:16,154 INFO  [ProfilesDefinitionParser] Added profile 'ServiiGo' (id=serviigo)
2012-12-30 09:04:16,203 INFO  [ProfilesDefinitionParser] Added profile 'Windows Phone 8' (id=wp8)
2012-12-30 09:04:16,244 INFO  [Device] Created UPnP Device with UUID: (censored), bound address: 172.20.x.xxx
2012-12-30 09:04:16,254 INFO  [PluginCompilerThread] Looking for plugins at /usr/bin/serviio/plugins
2012-12-30 09:04:16,254 INFO  [PluginCompilerThread] Started looking for plugins
2012-12-30 09:04:16,255 INFO  [UpdateChecker] Checking if a new version is available
2012-12-30 09:04:16,276 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "dcraw": java.io.IOException: error=2, No such file or directory
2012-12-30 09:04:16,276 WARN  [MediaServer] DCRAW not found. Support for raw image files will be missing.
2012-12-30 09:04:16,280 INFO  [AbstractTranscodingDeliveryEngine] Cleaning transcode engine and its data
2012-12-30 09:04:16,291 INFO  [WebServer] WebServer starting on port 8895
2012-12-30 09:04:16,294 INFO  [EventDispatcher] Starting EventDispatcher
2012-12-30 09:04:16,294 INFO  [DiscoveryAdvertisementNotifier] Starting DiscoveryAdvertisementNotifier
2012-12-30 09:04:16,294 INFO  [EventSubscriptionExpirationChecker] Starting EventSubscriptionExpirationChecker
2012-12-30 09:04:16,295 INFO  [DiscoverySSDPMessageListener] Starting DiscoverySSDPMessageListener using interface eth0 (eth0) and address 172.20.x.xxx, timeout = 0
2012-12-30 09:04:16,296 INFO  [RendererExpirationChecker] Starting RendererExpirationChecker
2012-12-30 09:04:16,296 INFO  [RendererSearchSender] Searching for Renderer devices, will multicast on 1 NICs
2012-12-30 09:04:42,317 INFO  [FeedUpdaterThread] Started looking for information about online resources
2012-12-30 09:04:42,327 INFO  [LibraryAdditionsCheckerThread] Started looking for newly added files
2012-12-30 09:04:42,337 INFO  [LibraryUpdatesCheckerThread] Started looking for updates to currently shared files
2012-12-30 09:04:42,337 INFO  [PlaylistMaintainerThread] Started looking playlist changes
2012-12-30 09:04:45,928 INFO  [LibraryAdditionsCheckerThread] Added file 'Aloha Scooby-Doo.mp4' (title: Scooby-Doo) to Library

Now, if run as "serviio" after the user "root" has been shut down, I discovered a few items in the library folder that were now owned/newly created by root. I changed ownership. I did not set a sticky on the folder (although I am tempted to set a user and group sticky for everything in the serviio folder. Anyway, I then started the process as the user "serviio." Guess what happens? It dumps everything in the library after getting the read error.
  Code:
2012-12-30 09:37:46,657 INFO  [PlaylistMaintainerThread] Started looking playlist changes
2012-12-30 09:37:46,686 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/videos' is either not an existing directory or cannot be read due to access rights
2012-12-30 09:37:46,794 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/audio' is either not an existing directory or cannot be read due to access rights
2012-12-30 09:37:46,819 INFO  [LibraryUpdatesCheckerThread] Removing 'Scooby-Doo' (/home/gazebo_shared/videos/Scooby Doo/Aloha Scooby-Doo.mp4) from Library

I am VERY confused about what is going on with permissions.
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Sun Dec 30, 2012 9:57 pm

Re: Linux permissions for media files

Out of desperation, I tried
  Code:
/usr/bin$ sudo chmod -R 775 ./serviio
It did not improve anything. I do not like those permissions and will set them to something more like 700 once things are functional.
So, reluctantly I tried
  Code:
$ sudo chmod 0777 ./videos

It also did not improve anything.
I conclude that the message being presented does not accurately depict the cause of the problem. Is there another level of debug available?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Dec 31, 2012 12:16 am

Re: Linux permissions for media files

The message is a result of calling canRead method on the folder. It returns false if the folder doesn't exist or cannot be read.

http://docs.oracle.com/javase/6/docs/ap ... l#canRead()
http://docs.oracle.com/javase/6/docs/ap ... Directory()

One of the above functions returns false. It might be a bug in Java for your OS, but more likely something in your setup that Java doesn't like.
<<

abubin

Serviio lover

Posts: 80

Joined: Tue Jul 26, 2011 3:54 pm

Post Tue Jan 01, 2013 4:34 pm

Re: Linux permissions for media files

not sure if this is anything but when you run as serviio user, here is the home directory as reported by serviio:
2012-12-30 01:09:55,199 INFO [MediaServer] User home dir: /usr/bin/serviio

Shouldn't it be /home/pc5dczcbl5yt?
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Tue Jan 01, 2013 5:37 pm

Re: Linux permissions for media files

zip wrote:One of the above functions returns false. It might be a bug in Java for your OS, but more likely something in your setup that Java doesn't like.

Well...
  Code:
MainClass.java reads:

import java.io.File;

public class MainClass {
   public static void main(String[] args) {

      File f = null;

      try{
         f = new File("/home/gazebo_shared/videos/");
         // returns true if the file can be read
         boolean bool = f.canRead();
         boolean dool = f.isDirectory();
         // print
         System.out.print("File can be read: "+bool);
         System.out.print("Is Directory: "+dool);

      }catch(Exception e){
         // if any I/O error occurs
         e.printStackTrace();
      }
   }
}


$ javac MainClass.java
$ java MainClass
File can be read: trueIs Directory: true$

The file was created and tested by the user serviio:
  Code:
-rw-rw-r-- 1 serviio serviio  900 Jan  1 12:19 MainClass.class
-rw-rw-r-- 1 serviio serviio  515 Jan  1 12:19 MainClass.java

I honestly believe that the error presented in the debug does not accurately represent what is going on.
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Tue Jan 01, 2013 5:57 pm

Re: Linux permissions for media files

Alright, I did a hard reboot, and upon start-up this time, serviio threw out a bunch of stuff that could be helpful. First, some directory permissions reverted.
  Code:
/usr/bin/serviio/library/cache$ ls -l
total 0
-rwxrwxr-x 1 serviio home 0 Dec 21 00:27 online_technical_metadata.data
-rw-r--r-- 1 root    root 0 Jan  1 12:41 online_technical_metadata.key
-rwxrwxr-x 1 serviio home 0 Dec 21 00:27 thumbnails.data
-rw-r--r-- 1 root    root 0 Jan  1 12:41 thumbnails.key
/usr/bin/serviio/library/cache$

Next, some of the error log
  Code:
2013-01-01 12:42:16,295 INFO  [ProfilesDefinitionParser] Added profile 'Windows Phone 8' (id=wp8)
2013-01-01 12:42:16,329 ERROR [IndexedDiskCache] Region [thumbnails] Failure initializing for fileName: thumbnails and root directory: /usr/bin/serviio/library/cache
java.io.FileNotFoundException: /usr/bin/serviio/library/cache/thumbnails.key (Permission denied)
   at java.io.RandomAccessFile.open(Native Method)
   at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
   at java.io.RandomAccessFile.<init>(RandomAccessFile.java:118)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDisk.<init>(IndexedDisk.java:62)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.<init>(IndexedDiskCache.java:155)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheManager.getCache(IndexedDiskCacheManager.java:130)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory.createCache(IndexedDiskCacheFactory.java:62)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseAuxiliary(CompositeCacheConfigurator.java:554)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:346)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:267)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegions(CompositeCacheConfigurator.java:244)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.doConfigure(CompositeCacheConfigurator.java:139)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:314)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:258)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:245)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:194)
   at org.apache.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:122)
   at org.apache.jcs.JCS.ensureCacheManager(JCS.java:96)
   at org.apache.jcs.JCS.getInstance(JCS.java:64)
   at org.serviio.cache.AbstractCacheDecorator.<init>(AbstractCacheDecorator.java:36)
   at org.serviio.library.online.OnlineContentCacheDecorator.<init>(OnlineContentCacheDecorator.java:25)
   at org.serviio.library.online.OnlineLibraryManager.<init>(OnlineLibraryManager.java:88)
   at org.serviio.library.online.OnlineLibraryManager.getInstance(OnlineLibraryManager.java:78)
   at org.serviio.MediaServer.main(MediaServer.java:117)
2013-01-01 12:42:16,330 ERROR [IndexedDiskCache] Region [online_technical_metadata] Failure initializing for fileName: online_technical_metadata and root directory: /usr/bin/serviio/library/cache
java.io.FileNotFoundException: /usr/bin/serviio/library/cache/online_technical_metadata.key (Permission denied)
   at java.io.RandomAccessFile.open(Native Method)
   at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
   at java.io.RandomAccessFile.<init>(RandomAccessFile.java:118)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDisk.<init>(IndexedDisk.java:62)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.<init>(IndexedDiskCache.java:155)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheManager.getCache(IndexedDiskCacheManager.java:130)
   at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory.createCache(IndexedDiskCacheFactory.java:62)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseAuxiliary(CompositeCacheConfigurator.java:554)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:346)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:267)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegions(CompositeCacheConfigurator.java:244)
   at org.apache.jcs.engine.control.CompositeCacheConfigurator.doConfigure(CompositeCacheConfigurator.java:139)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:314)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:258)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:245)
   at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:194)
   at org.apache.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:122)
   at org.apache.jcs.JCS.ensureCacheManager(JCS.java:96)
   at org.apache.jcs.JCS.getInstance(JCS.java:64)
   at org.serviio.cache.AbstractCacheDecorator.<init>(AbstractCacheDecorator.java:36)
   at org.serviio.library.online.OnlineContentCacheDecorator.<init>(OnlineContentCacheDecorator.java:25)
   at org.serviio.library.online.OnlineLibraryManager.<init>(OnlineLibraryManager.java:88)
   at org.serviio.library.online.OnlineLibraryManager.getInstance(OnlineLibraryManager.java:78)
   at org.serviio.MediaServer.main(MediaServer.java:117)
2013-01-01 12:42:16,339 INFO  [Device] Created UPnP Device with UUID: 283c7121-bacc-3e9a-acd6-b3628ba7da02, bound address: 172.20.3.101
2013-01-01 12:42:16,349 INFO  [PluginCompilerThread] Looking for plugins at /usr/bin/serviio/plugins
2013-01-01 12:42:16,350 INFO  [UpdateChecker] Checking if a new version is available
2013-01-01 12:42:16,350 INFO  [PluginCompilerThread] Started looking for plugins
2013-01-01 12:42:16,365 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "dcraw": java.io.IOException: error=2, No such file or directory
2013-01-01 12:42:16,365 WARN  [MediaServer] DCRAW not found. Support for raw image files will be missing.
2013-01-01 12:42:16,369 INFO  [AbstractTranscodingDeliveryEngine] Cleaning transcode engine and its data
2013-01-01 12:42:16,382 INFO  [WebServer] WebServer starting on port 8895
2013-01-01 12:42:16,384 INFO  [EventSubscriptionExpirationChecker] Starting EventSubscriptionExpirationChecker
2013-01-01 12:42:16,384 INFO  [EventDispatcher] Starting EventDispatcher
2013-01-01 12:42:16,386 INFO  [DiscoverySSDPMessageListener] Starting DiscoverySSDPMessageListener using interface eth0 (eth0) and address 172.20.3.101, timeout = 0
2013-01-01 12:42:16,386 INFO  [DiscoveryAdvertisementNotifier] Starting DiscoveryAdvertisementNotifier
2013-01-01 12:42:16,386 INFO  [RendererExpirationChecker] Starting RendererExpirationChecker
2013-01-01 12:42:16,386 INFO  [RendererSearchSender] Searching for Renderer devices, will multicast on 1 NICs
2013-01-01 12:42:42,401 INFO  [FeedUpdaterThread] Started looking for information about online resources
2013-01-01 12:42:42,404 INFO  [LibraryAdditionsCheckerThread] Started looking for newly added files
2013-01-01 12:42:42,433 INFO  [LibraryUpdatesCheckerThread] Started looking for updates to currently shared files
2013-01-01 12:42:42,433 INFO  [PlaylistMaintainerThread] Started looking playlist changes
2013-01-01 12:42:42,577 WARN  [LibraryAdditionsCheckerThread] Folder '/home/gazebo_shared/videos' is either not an existing directory or cannot be read due to access rights
2013-01-01 12:42:42,710 WARN  [LibraryUpdatesCheckerThread] An error occured while scanning for items to be removed or updated, will continue
org.serviio.db.dao.PersistenceException: Cannot read MediaItems for Repository with id = 1
   at org.serviio.library.dao.MediaItemDAOImpl.getMediaItemsInRepository(MediaItemDAOImpl.java:164)
   at org.serviio.library.local.service.MediaService.getMediaItemsInRepository(MediaService.java:73)
   at org.serviio.library.local.metadata.LibraryUpdatesCheckerThread.searchForRemovedAndUpdatedFiles(LibraryUpdatesCheckerThread.java:157)
   at org.serviio.library.local.metadata.LibraryUpdatesCheckerThread.run(LibraryUpdatesCheckerThread.java:99)
Caused by: java.sql.SQLException: Java exception: ': org.apache.derby.iapi.error.ShutdownException'.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
   at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
   at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
   at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
   at org.serviio.library.dao.MediaItemDAOImpl.getMediaItemsInRepository(MediaItemDAOImpl.java:157)
   ... 3 more
Caused by: java.sql.SQLException: Java exception: ': org.apache.derby.iapi.error.ShutdownException'.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
   ... 18 more
Caused by: org.apache.derby.iapi.error.ShutdownException:
   at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(Unknown Source)
   at org.apache.derby.iapi.services.context.ContextManager.getContext(Unknown Source)
   at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.getStatementContext(Unknown Source)
   at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.doneReading(Unknown Source)
   at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
   at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
   at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
   ... 11 more
2013-01-01 12:42:42,712 WARN  [DBConnectionPool] Can't create a new connection for jdbc:derby:db;create=true
java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@138d107f, see the next exception for details.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
   at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
   at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
   at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
   at java.sql.DriverManager.getConnection(DriverManager.java:620)
   at java.sql.DriverManager.getConnection(DriverManager.java:222)
   at org.serviio.db.DBConnectionPool.newConnection(DBConnetionPool.java:186)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:123)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:113)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:113)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:113)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:149)
   at org.serviio.db.DatabaseManager.getConnection(DatabaseManager.java:66)
   at org.serviio.db.DatabaseManager.getConnection(DatabaseManager.java:59)
   at org.serviio.library.dao.PlaylistDAOImpl.getPlaylistsInRepository(PlaylistDAOImpl.java:194)
   at org.serviio.library.local.service.PlaylistService.getPlaylistsInRepository(PlaylistService.java:82)
   at org.serviio.library.local.metadata.LibraryUpdatesCheckerThread.searchForRemovedPlaylists(LibraryUpdatesCheckerThread.java:216)
   at org.serviio.library.local.metadata.LibraryUpdatesCheckerThread.run(LibraryUpdatesCheckerThread.java:98)
Caused by: java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@138d107f, see the next exception for details.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
   ... 24 more
Caused by: java.sql.SQLException: Derby system shutdown.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
   ... 21 more
Caused by: ERROR XJ015: Derby system shutdown.
   at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
   at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
   ... 21 more
2013-01-01 12:42:42,713 WARN  [DBConnectionPool] Can't create a new connection for jdbc:derby:db;create=true
java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@138d107f, see the next exception for details.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
   at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
   at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
   at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
   at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
   at java.sql.DriverManager.getConnection(DriverManager.java:620)
   at java.sql.DriverManager.getConnection(DriverManager.java:222)
   at org.serviio.db.DBConnectionPool.newConnection(DBConnetionPool.java:186)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:123)
   at org.serviio.db.DBConnectionPool.getConnection(DBConnetionPool.java:149)
   at org.serviio.db.DatabaseManager.getConnection(DatabaseManager.java:66)
   at org.serviio.db.DatabaseManager.getConnection(DatabaseManager.java:59)
   at org.serviio.library.dao.PlaylistDAOImpl.getPlaylistsInRepository(PlaylistDAOImpl.java:194)
   at org.serviio.library.local.service.PlaylistService.getPlaylistsInRepository(PlaylistService.java:82)
   at org.serviio.library.local.metadata.LibraryUpdatesCheckerThread.searchForRemovedPlaylists(LibraryUpdatesCheckerThread.java:216)
   at org.serviio.library.local.metadata.LibraryUpdatesCheckerThread.run(LibraryUpdatesCheckerThread.java:98)
Caused by: java.sql.SQLException: Failed to start database 'db' with class loader sun.misc.Launcher$AppClassLoader@138d107f, see the next exception for details.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
   ... 21 more
Caused by: java.sql.SQLException: Derby system shutdown.
   at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
   at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
   at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
   ... 18 more
Caused by: ERROR XJ015: Derby system shutdown.
   at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
   at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
   at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
   ... 18 more
2013-01-01 12:42:42,782 WARN  [LibraryAdditionsCheckerThread] An error occured while scanning for item to be added, will continue
org.serviio.db.dao.PersistenceException: Cannot mark Repository with id 1 as scanned
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Tue Jan 01, 2013 5:59 pm

Re: Linux permissions for media files

abubin wrote:not sure if this is anything but when you run as serviio user, here is the home directory as reported by serviio:
2012-12-30 01:09:55,199 INFO [MediaServer] User home dir: /usr/bin/serviio

Shouldn't it be /home/serviio?

Thanks. No, I setup a system user with he app directory being the home folder.
<<

hwmonkey

Streaming enthusiast

Posts: 23

Joined: Fri Jul 20, 2012 4:23 am

Post Tue Jan 01, 2013 6:51 pm

Re: Linux permissions for media files

Alright, I think I found it. First, to be certain that a directory ownership issue does not create a problem again, I went ahead and reset the file/folder ownership and set a sticky for both the group permissions
  Code:
/usr/bin$ sudo chown -R serviio:home ./serviio
/usr/bin$ sudo chmod -R g+s ./serviio

Next, I discovered an upstart bug.
setuid does not set supplementary groups, only primary group. See Upstart bug https://bugs.launchpad.net/upstart/+bug/812870

So, I added on line to the upstart so that it now looks like
  Code:
description "Serviio media server"
author "serviio.org"

setuid serviio
setgid home

start on started networking
script
   /usr/bin/serviio/bin/serviio.sh
end script

Now, if you recall, I tried running serviio as the user serviio without upstart, and I received the same errors in the past. However, this time, things executed perfectly without any errors. I suspect that both setting the sticky and changing the upstart is necessary. However, it could also have something to do with restarting the system.

Now, to go back and reset some of those file permissions to be a bit more restrictive...
<<

carlop

Serviio newbie

Posts: 5

Joined: Sun May 26, 2013 7:48 pm

Post Sun May 26, 2013 8:49 pm

Re: Linux permissions for media files

Hello,

I had also some problems with files permissions too on my Gentoo linux and solved them as describe below :

1st : serviio binary daemon etc ... belongs to group serviio and user serviio (cant be run as root)

(in my gentoo serviio install evrything was cool ... except for some "little" things like ffmpeg and java but this is another story and I will try to solve them)

I have a huge drive ((XFS 3To) /dev/sdb1 mounted in /mnt/sdb1) with all my videos and music and all home directories are on another drive, a SSD system drive with root and boot partitions.

I have added my main user (not root but wheel) to serviio group (because I need to be able to share this directory with serviio to add/delete files as user) :

(my user for this example is carlop use your own ^^)

Logged as root (or sudo) :
  Code:
tux #> usermod -aG serviio carlop
tux #> groups carlop
wheel audio users serviio carlop


2nd : Create (2) links in a new forder like : /home/serviiolib

Logged as root (or sudo) :
  Code:
tux #> ln -s /mnt/sdb1/videos /home/serviiolib/videos
tux #> ln -s /mnt/sdb1/music /home/serviiolib/music


3rd: define folder and files permission :

to be sure I have made changes in home directory for links AND in the drive itself

Logged as root (or sudo) :
  Code:
tux #> chown -R serviio.serviio /home/serviiolib
tux #> chmod -R 775 /home/serviiolib
tux #> chmod -R 2775 /home/serviiolib
tux #> chown -R serviio.serviio /mnt/sdb1/music  /mnt/sdb1/videos
tux #> chmod -R 775 /mnt/sdb1/music  /mnt/sdb1/videos
tux #> chmod -R 2775 /mnt/sdb1/music  /mnt/sdb1/videos


chmod -R 2775 is to set sgid bit ...

same than :

chmod -R g+s.

Once that done, without restarting daemon, database update have started and videos/music was readable by clients ...

I hope this will help ...

PS: sorry for my english

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 81 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.