Auto-starting Elseed

1 post / 0 new
Auto-starting Elseed

what changes do I need to make to the File: /etc/rc.d/rc.sysinit to make elseed run automatically?  Specifically, what is the syntax and where do I put the syntax?  I have included the jargon below.  Thanks.

 

#!/bin/bash
##############################################################################
#
#   File: /etc/rc.d/rc.sysinit
#
#   Description: System startup script, run once at boot time
#
#   Copyright (c) 2003 TiVo Inc.
#
#############################################################################

#
# Given a filename, determine if it should be filtered out, based
# on whether or not any . separated piece of the filename matches
# a prefix and not the filter target
#
function FilterOut () {
    local filename=$1
    local prefix=$2
    local filter=$3

    local fragment_1 fragment_2 fragment_3 fragment_4 fragment_5

    fragment_1=${filename#*.$prefix}
    if [ "$filename" != "$fragment_1" ]; then
        # prefix found, now check the filter target
        fragment_2=${fragment_1%%.*}
        if [ "$fragment_2" = "other" ]; then
            fragment_3=${filename#/*/rc.Sequence*.}
            fragment_4=${fragment_3%%.*}
            fragment_5=${filename%$fragment_3}
            if [ -f $fragment_5$fragment_4.*$prefix$filter.*sh ]; then
                # true: filter this one out, this is an "other" script
                # where a script exists that matches both the filter
                # target and the main script name
                # NOTE: this doesn't verfiy that any other filters
                # match, which can get a little hairy
                if [ "$DebugStartupScripts" = "true" ]; then
                    echo -n "Skipping script $filename because of target match:"
                    echo " " $fragment_5$fragment_4.*$prefix$filter.*sh
                fi
                return 0
            fi
        elif [ "$fragment_2" != "$filter" ]; then
            # true: filter this one out
            return 0
        fi
    fi

    # false: don't filter this one out (keep it)
    return 1
}

#
# Run all the scripts that pass the filter for a given stage
#
function RunStage () {
    local StageToRun=$1

    echo "Running boot Stage $StageToRun scripts"

    for ScriptFragmentFile in /etc/rc.d/Stage$StageToRun/rc.Sequence_*.sh ; do

        # If .Platform_<platform> specified, filter it against
        # our detected platform
        if FilterOut $ScriptFragmentFile Platform_ $HpkPlatform; then
            continue
        fi

        # If .Implementation_<implementation> specified, filter it against
        # our detected implementation
        if FilterOut $ScriptFragmentFile Implementation_ $HpkImplementation; then
            continue
        fi

        # If .Implementer_<implementer> specified, filter it against
        # our detected implementer
        if FilterOut $ScriptFragmentFile Implementer_ $HpkImplementer; then
            continue
        fi

        if [ -f $ScriptFragmentFile ]; then
            if [ "$DebugStartupScripts" = "true" ]; then
                echo "About to invoke $ScriptFragmentFile"
            fi
            source $ScriptFragmentFile
        else
            # May be a dangling symlink, directory, or no scripts present
            echo "$ScriptFragmentFile cannot be run"
        fi
    done
}

echo "Starting rc.sysinit"

for SysinitStage in A_PreKickstart \
                    B_PostKickstart \
                    C_MediaInitialization \
                    D_PreMfs \
                    E_PreApplication \
                    F_ApplicationLaunch \
                    G_PostApplication ; do
    RunStage $SysinitStage
done

echo "rc.sysinit is complete"