[SOLVED] ClearOS; Cannot run program ffmpeg
Encountering the following problem....
I set up a service to start serviio on system start up. The service (see code below) is set up by example from clearfoundation forum. The service it self works fine (starting, stopping etc). However on start I get the error in the serviio.log stating Cannot run program "ffmpeg": java.io.IOException: error=2, No such file or directory (see below for complete log).
When I run ffmpeg from the prompt it shows its version etc., so the PATH should be fine I guess.
I think the error is caused as the system on start up logs in as serviio user which cannot locate the file?? When I run serviio.sh manually from ../serviio/bin, serviio runs perfectly, but in this case I'm logged in as root. As I'm getting tired to manually start serviio again, I really wishes the service will run the same perfect way! Any suggestions to solve this are appreciated.
-Frank
Service script
- Code:
#! /bin/sh
#
# /etc/init.d/serviio
#
#
### BEGIN INIT INFO
# Provides: serviio
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start the serviio DLNA server in headless mode
### END INIT INFO
SERVIIO_HOME="/usr/share/serviio"
SERVIIO_DAEMON="serviio.sh"
SERVIIO_BIN="$SERVIIO_HOME/bin/$SERVIIO_DAEMON"
SERVIIO_USER="serviio"
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
check() {
# Check that we're a privileged user
[ $(id -u) = 0 ] || exit 4
# Check if SERVIIO_HOME exists
test -d "$SERVIIO_HOME" || exit 5
# Check if SERVIIO_BIN is executable
test -x "$SERVIIO_BIN" || exit 5
}
start() {
check
echo -n "Starting Serviio DLNA server: "
/usr/bin/sudo -u $SERVIIO_USER -H $SERVIIO_BIN -headless &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/serviio.sh
echo_success
else
echo_failure
fi
echo
return $RETVAL
}
stop() {
check
echo -n "Shutting down Serviio DLNA daemon: "
killproc "$SERVIIO_BIN"
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/serviio.sh
echo
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
force-reload)
restart
;;
restart)
restart
;;
condrestart)
if [ -f /var/lock/subsys/serviio.sh ]; then
restart
fi
;;
status)
status serviio.sh
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|force-reload}"
RETVAL=2
esac
exit $RETVAL
Serviio.log
- Code:
2011-12-12 21:49:03,166 ERROR [ApplicationInstanceManager] Error connecting to local port for single instance notification
2011-12-12 21:49:03,192 ERROR [ApplicationInstanceManager] No route to host
java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.serviio.ApplicationInstanceManager.registerInstance(ApplicationInstanceManager.java:105)
at org.serviio.MediaServer.checkForRunningInstances(MediaServer.java:242)
at org.serviio.MediaServer.main(MediaServer.java:93)
2011-12-12 21:49:03,198 INFO [MediaServer] ------------------------------------------------------------------------
2011-12-12 21:49:03,198 INFO [MediaServer] Serviio DLNA media streaming server v 0.6.0.1 (rev. 8e4ee98bff12)
2011-12-12 21:49:03,198 INFO [MediaServer] Petr Nejedly 2009-2011
2011-12-12 21:49:03,198 INFO [MediaServer] http://www.serviio.org
2011-12-12 21:49:03,198 INFO [MediaServer]
2011-12-12 21:49:03,198 INFO [MediaServer] Java 1.6.0_29-Sun Microsystems Inc.
2011-12-12 21:49:03,198 INFO [MediaServer] OS Linux i386 2.6.18-194.8.1.v5PAE
2011-12-12 21:49:03,198 INFO [MediaServer] File encoding: UTF-8
2011-12-12 21:49:03,199 INFO [MediaServer] Headless mode enabled: true
2011-12-12 21:49:03,199 INFO [MediaServer] User home dir: /usr/share/serviio
2011-12-12 21:49:03,199 INFO [MediaServer] Temp dir: /tmp
2011-12-12 21:49:03,199 INFO [MediaServer] ------------------------------------------------------------------------
2011-12-12 21:49:03,268 INFO [RestletServer] Starting Restlet server exposed on 192.168.1.2:23423
2011-12-12 21:49:03,298 INFO [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2011-12-12 21:49:04,052 INFO [ProfilesDefinitionParser] Parsing Profiles definition
2011-12-12 21:49:04,317 INFO [ProfilesDefinitionParser] Added profile 'Generic DLNA profile' (id=1)
2011-12-12 21:49:04,425 INFO [ProfilesDefinitionParser] Added profile 'Samsung TV (B-series)' (id=2)
2011-12-12 21:49:04,482 INFO [ProfilesDefinitionParser] Added profile 'XBox 360' (id=3)
2011-12-12 21:49:04,536 INFO [ProfilesDefinitionParser] Added profile 'Playstation 3' (id=4)
2011-12-12 21:49:04,592 INFO [ProfilesDefinitionParser] Added profile 'Samsung TV (A-series)' (id=5)
2011-12-12 21:49:04,635 INFO [ProfilesDefinitionParser] Added profile 'DirecTV HD-DVR' (id=6)
2011-12-12 21:49:04,746 INFO [ProfilesDefinitionParser] Added profile 'Samsung TV / player (C/D-series)' (id=7)
2011-12-12 21:49:04,763 INFO [ProfilesDefinitionParser] Added profile 'LG TV / player' (id=8)
2011-12-12 21:49:04,911 INFO [ProfilesDefinitionParser] Added profile 'Sony Bravia TV' (id=9)
2011-12-12 21:49:05,133 INFO [ProfilesDefinitionParser] Added profile 'Sony BD Player' (id=10)
2011-12-12 21:49:05,221 INFO [ProfilesDefinitionParser] Added profile 'Panasonic Viera' (id=12)
2011-12-12 21:49:05,304 INFO [ProfilesDefinitionParser] Added profile 'Toshiba REGZA' (id=13)
2011-12-12 21:49:05,328 INFO [ProfilesDefinitionParser] Added profile 'WDTV Live' (id=14)
2011-12-12 21:49:05,341 INFO [ProfilesDefinitionParser] Added profile 'LaCie LaCinema Media Player' (id=15)
2011-12-12 21:49:05,383 INFO [ProfilesDefinitionParser] Added profile 'Manta WIFI Centre' (id=16)
2011-12-12 21:49:05,402 INFO [ProfilesDefinitionParser] Added profile 'Pure Flow' (id=17)
2011-12-12 21:49:05,447 INFO [ProfilesDefinitionParser] Added profile 'Sharp Aquos' (id=18)
2011-12-12 21:49:05,602 INFO [ProfilesDefinitionParser] Added profile 'Sony Bravia TV 2011' (id=19)
2011-12-12 21:49:05,741 INFO [ProfilesDefinitionParser] Added profile 'Sony SMP-N100' (id=20)
2011-12-12 21:49:05,752 INFO [CompositeCacheManager] Creating cache manager from config file: /cache.ccf
2011-12-12 21:49:05,755 INFO [ThreadPoolManager] thread_pool.default PoolConfiguration = useBoundary = [true] boundarySize = [2000] maximumPoolSize = [150] minimumPoolSize = [4] keepAliveTime = [300000] whenBlockedPolicy = [RUN] startUpSize = [4]
2011-12-12 21:49:05,757 INFO [CompositeCacheConfigurator] Setting default auxiliaries to null
2011-12-12 21:49:05,757 INFO [CompositeCacheConfigurator] No special CompositeCacheAttributes class defined for key [jcs.default.cacheattributes], using default class.
2011-12-12 21:49:05,758 INFO [CompositeCacheConfigurator] setting defaultCompositeCacheAttributes to [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 100, maxSpoolPerRun = -1, diskUsagePattern = 0 ]
2011-12-12 21:49:05,758 INFO [CompositeCacheConfigurator] No special ElementAttribute class defined for key [jcs.default.elementattributes], using default class.
2011-12-12 21:49:05,758 INFO [CompositeCacheConfigurator] setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL = true, IS_REMOTE = true, IS_ETERNAL = true, MaxLifeSeconds = -1, IdleTime = -1, CreateTime = 1323722945758, LastAccessTime = 1323722945758, getTimeToLiveSeconds() = -1, createTime = 1323722945758 ]
2011-12-12 21:49:05,776 INFO [LRUMemoryCache] initialized LRUMemoryCache for thumbnails
2011-12-12 21:49:05,776 INFO [CompositeCache] Constructed cache with name [thumbnails] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1, diskUsagePattern = 0 ]
2011-12-12 21:49:05,777 INFO [LRUMemoryCache] initialized LRUMemoryCache for online_feeds
2011-12-12 21:49:05,777 INFO [CompositeCache] Constructed cache with name [online_feeds] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1, diskUsagePattern = 0 ]
2011-12-12 21:49:05,777 INFO [CompositeCacheConfigurator] No special ElementAttribute class defined for key [jcs.region.local_default.elementattributes], using default class.
2011-12-12 21:49:05,777 INFO [LRUMemoryCache] initialized LRUMemoryCache for local_default
2011-12-12 21:49:05,777 INFO [CompositeCache] Constructed cache with name [local_default] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1, diskUsagePattern = 0 ]
2011-12-12 21:49:05,777 INFO [CompositeCacheConfigurator] No special ElementAttribute class defined for key [jcs.region.local_resetafterplay.elementattributes], using default class.
2011-12-12 21:49:05,777 INFO [LRUMemoryCache] initialized LRUMemoryCache for local_resetafterplay
2011-12-12 21:49:05,777 INFO [CompositeCache] Constructed cache with name [local_resetafterplay] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1, diskUsagePattern = 0 ]
2011-12-12 21:49:05,778 INFO [CompositeCacheConfigurator] Parsed regions [thumbnails, online_feeds, local_default, local_resetafterplay]
2011-12-12 21:49:05,778 INFO [CompositeCacheConfigurator] Finished configuration in 22 ms.
2011-12-12 21:49:05,802 INFO [WebServer] Socket buffer set to 65535 bytes
2011-12-12 21:49:05,802 INFO [Device] Created UPnP Device with UUID: 83403509-60a4-3ac0-bae1-94340baf2344, bound address: 192.168.1.2
2011-12-12 21:49:05,820 INFO [PluginCompilerThread] Looking for plugins at /usr/share/serviio/plugins
2011-12-12 21:49:05,820 INFO [PluginCompilerThread] Started looking for plugins
2011-12-12 21:49:05,826 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "ffmpeg": java.io.IOException: error=2, No such file or directory
2011-12-12 21:49:05,826 ERROR [MediaServer] An unexpected error occured. Ending the application. Message: null
java.lang.NullPointerException
at org.serviio.external.ProcessExecutor.closeStreams(ProcessExecutor.java:273)
at org.serviio.external.ProcessExecutor.run(ProcessExecutor.java:162)
at org.serviio.external.FFMPEGWrapper.ffmpegPresent(FFMPEGWrapper.java:109)
at org.serviio.MediaServer.main(MediaServer.java:112)
2011-12-12 21:49:05,830 INFO [PluginCompilerThread] Finished looking for plugins
2011-12-12 21:49:05,932 INFO [DatabaseManager] Shutting down database
2011-12-12 21:49:06,077 INFO [AbstractTranscodingDeliveryEngine] Cleaning transcode engine and its data