[mythtv-users] backend cannot find mythcommflag

Mark Gardner markgard at gmail.com
Mon Oct 17 22:35:21 EDT 2005


On 10/17/05, Kevin Kuphal <kuphal at dls.net> wrote:
> It's the user that runs mythbackend that you need to examine.  This is
> probably started using an init script in /etc/init.d and generally
> speaking, the paths haven't been set at this point.

Here is the file how mythbackend is started this is a custom init.d
script that I wrote.  how would I ensure that the mythcommflag is set
in the path when this starts.

--
             _\ | /_
            (@ @)
-----oOOo-(_)-oOOo-----
  ~ Mark
         Gardner ~
-------------- next part --------------
#! /bin/sh
# 
# Author: Mark Gardner <markgard at gmail.com>
#
# /etc/init.d/mythbackend
#
### BEGIN INIT INFO
# Provides: mythbackend
# Required-Start: $local_fs $network mysql
# Should-Start: mysql 
# Required-Stop: mysql
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start and Stop MythTv Backend Service
# Description: Starts the mythbackend process as a daemon after the XWindows 
#              system is started, in runlevel 5. This allows scheduled 
#              recordings to occur without manual intervention.
### END INIT INFO
#
#
# Attempt to conform to LSB 3.0 Specs
# http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic
. /lib/lsb/init-functions

#!!!!!!!!!! SHOULD I ADD THIS !!!!!!!!!!!
#PATH=/usr/local/bin:$PATH
#export PATH
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


# Location of Myth Tv Backend Binary
MBE_BIN=/usr/local/bin/mythbackend

#
# Full Path of mythbackend log file
MBE_LOGFILE=/var/log/mythtv/mythbackend.log

#
# Full Path of mythbackend PidFile
MBE_PIDFILE=/var/run/mythbackend.pid
#
# User that Mythtv should run as
MBE_USER=root
test -x $MBE_BIN || exit 5

#
# Full Path of mythbackend config file
# Default: /etc/sysconfig/mythbackend
MBE_CONFIG=/etc/sysconfig/mythbackend

# Source config file if available
if ( test -r $MBE_CONFIG ); then
  #echo Getting config file: $MBE_CONFIG
  . $MBE_CONFIG
fi

#Source in rc.Status functions
# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     ditto but be verbose in local rc status
#      rc_status -v -r  ditto and clear the local rc status
#      rc_failed        set local and overall rc status to failed
#      rc_reset         clear local rc status (overall remains)
#      rc_exit          exit appropriate to overall rc status

. /etc/rc.status

# First reset status of this service
rc_reset

case "$1" in
	start)
		echo "Starting mythbackend service"
		# startproc -u $MBE_USER $MBE_BIN -d -l $MBE_LOGFILE 
		start_daemon -p $MBE_PIDFILE $MBE_BIN -d -l $MBE_LOGFILE --pidfile $MBE_PIDFILE
		rc_status -v
		;;
	stop)
		echo -n "Stopping mythbackend service"
		killproc -p $MBE_PIDFILE -TERM $MBE_BIN
		rc_status -v
		;;
	restart)
		$0 stop
		$0 start
		rc_status -v
		;;
	force-reload)
		$0 stop
		$0 start
		re_status -v
		;;
	status)
	        echo -n "Checking status of mythbacked: "
	        # Check satus with checkproc(8), if process is running
	        ## checkproc will return with exit status 0.
	
	        # Status has a slightly different for the status command:
	        # 0 - service running
		# 1 - service dead, but /var/run/  pid  file exists
        	# 2 - service dead, but /var/lock/ lock file exists
        	# 3 - service not running

        	checkproc $MBE_BIN

	        rc_status -v
        	;;
	*)
		echo "Usage: $0 {start|stop|status}"
		exit 1
	;;
esac
rc_exit


More information about the mythtv-users mailing list