24小时热门版块排行榜    

查看: 1243  |  回复: 5

迷路的游侠

木虫 (正式写手)

[求助] 求助ubuntu下maui的安装配置

这是maui.d的一部分文件:
# Source the library functions
. /etc/rc.d/init.d/redhat_functions

MAUI_PREFIX=/usr/local/maui

# let see how we were called
case "$1" in
        start)
                echo -n "Starting MAUI Scheduler: "
                daemon  $MAUI_PREFIX/sbin/maui
                echo
                ;;
        stop)
                echo -n "Shutting down MAUI Scheduler: "
                killproc maui
。。。。。。
=================================================
而这些start、stop函数是根据redhat的function写的
一下是redhat的functions一部分:
# A function to start a program.
daemon() {
        # Test syntax.
        local gotbase= force= nicelevel corelimit
        local pid base= user= nice= bg= pid_file=
        local cgroup=
        nicelevel=0
        while [ "$1" != "${1##[-+]}" ]; do
          case $1 in
            '')    echo $"$0: Usage: daemon [+/-nicelevel] {program}"
                   return 1;;
            --check)
                   base=$2
                   gotbase="yes"
                   shift 2
                   ;;
            --check=?*)
                   base=${1#--check=}
                   gotbase="yes"
                   shift
                   ;;
            --user)
  user=$2
                   shift 2
                   ;;
            --user=?*)
                   user=${1#--user=}
                   shift
                   ;;
            --pidfile)
                   pid_file=$2
                   shift 2
                   ;;
            --pidfile=?*)
                   pid_file=${1#--pidfile=}
                   shift
                   ;;
            --force)
                   force="force"
                   shift
                   ;;
            [-+][0-9]*)
                   nice="nice -n $1"
                   shift
                   ;;
===============================================
而ubuntu的function是这样写的:
start_daemon () {
#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
#BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

start_daemon () {
    local force nice pidfile exec i args
    force=0
    nice=0
    pidfile=/dev/null

    OPTIND=1
    while getopts fn:p: opt ; do
        case "$opt" in
            f)  force=1;;
            n)  nice="$OPTARG";;
            p)  pidfile="$OPTARG";;
        esac
    done

    shift $(($OPTIND - 1))
    if [ "$1" = '--' ]; then
        shift
    fi

    exec="$1"; shift

    args="--start --nicelevel $nice --quiet --oknodo"
    if [ $force = 1 ]; then
        /sbin/start-stop-daemon $args --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@"
    elif [ $pidfile ]; then
        /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@"
    else
        /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@"
    fi
}

pidofproc () {
    local pidfile line i pids= status specified pid
    pidfile=
    specified=

    OPTIND=1
    while getopts p: opt ; do
        case "$opt" in
            p)  pidfile="$OPTARG"; specified=1;;
        esac
    done
    shift $(($OPTIND - 1))

    base=${1##*/}
    if [ ! "$specified" ]; then
        pidfile="/var/run/$base.pid"
    fi

    if [ -n "${pidfile:-}" -a -r "$pidfile" ]; then
        read pid < "$pidfile"
        if [ -n "${pid:-}" ]; then
            if $(kill -0 "${pid:-}" 2> /dev/null); then
                echo "$pid"
                return 0
            elif ps "${pid:-}" >/dev/null 2>&1; then
                echo "$pid"
                return 0 # program is running, but not owned by this user
            else
                return 1 # program is dead and /var/run pid file exists
            fi
        fi
    fi
    if [ -x /bin/pidof -a ! "$specified" ]; then
        status="0"
        /bin/pidof -o %PPID -x $1 || status="$?"
        if [ "$status" = 1 ]; then
            return 3 # program is not running
        fi
        return 0
    fi
    return 4 # Unable to determine status
}

# start-stop-daemon uses the same algorithm as "pidofproc" above.
        /bin/pidof -o %PPID -x $1 || status="$?"
        if [ "$status" = 1 ]; then
            return 3 # program is not running
        fi
        return 0
    fi
    return 4 # Unable to determine status
}

===================================================
这样我执行start的时候就启动不了了,求高手给出个主意解决一下,别说让我装回redhat。。。。。。
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

bingmou

金虫 (著名写手)

【答案】应助回帖


youzhizhe(金币+1): 谢谢交流。 2011-09-01 11:32:36
迷路的游侠(金币+1): 2011-09-06 20:11:18
首先,这是什么东西?
其次,出现了什么错误提示?
最后,你想要什么?
2楼2011-09-01 11:23:23
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

迷路的游侠

木虫 (正式写手)

引用回帖:
2楼: Originally posted by bingmou at 2011-09-01 11:23:23:
首先,这是什么东西?
其次,出现了什么错误提示?
最后,你想要什么?

这是linux下的队列管理的软件,我想用torque和maui管理我的计算任务的队列啊
关于错误提示ubuntu下是没有rc.d文件夹的,所以原来的错误是找不到/etc/rc.d/init.d/functions,后来我把ubuntu下的/lib.lsb/linit_functions ln过去后就是提示daemon not found ,我把它改成ubuntu下的start_daemon后,就没反应了,但也启动不了。直接把redhat系统的functions copy过来也不能用,我现在的问题就是装完这个软件后没法用它!
3楼2011-09-01 12:04:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

bingmou

金虫 (著名写手)

【答案】应助回帖

★ ★
youzhizhe(金币+2): 谢谢交流。 2011-09-01 19:03:53
迷路的游侠(金币+5): 2011-09-06 20:10:58
这个应该是系统的配置文件布局不同导致的,debian体系和redhat有些东西是不能互用的。我记得debian下面就是没有rc.d的,而是直接的rc0.d,rc1.d....
所以,你要弄懂为什么maui需要redhat的那个functions和这个functions里面有哪些是naui需要的,试试自己在ubuntu里面找到这些functions,或者直接copy过来。
或者你直接apt-get install torque试试
4楼2011-09-01 12:32:10
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

迷路的游侠

木虫 (正式写手)

引用回帖:
4楼: Originally posted by bingmou at 2011-09-01 12:32:10:
这个应该是系统的配置文件布局不同导致的,debian体系和redhat有些东西是不能互用的。我记得debian下面就是没有rc.d的,而是直接的rc0.d,rc1.d....
所以,你要弄懂为什么maui需要redhat的那个functions和这个fun ...

嗯 就是这个伤脑筋啊 关键是我对语言一窍不通,直接copy也试过了不行,torque倒是没问题能用。所以希望能有这方面的高手帮我看看maui.d的配置start/stop/restart/status配置要怎么写
5楼2011-09-01 12:45:02
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

bingmou

金虫 (著名写手)

主要我不用这个,所以提不起兴趣去看这个
6楼2011-09-02 14:30:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 迷路的游侠 的主题更新
信息提示
请填处理意见