mongodそこで、デーモン用の Arch Linux rc.d スクリプトを作成しました(例に従って) が、実行すると:
sudo rc.d start mongod
立ち往生するだけです:
:: Starting /usr/bin/mongod          [BUSY]
「DONE」フェーズに移行することはありません。任意のヒント?
これが私のスクリプトです:
#!/bin/bash
# import predefined functions
. /etc/rc.conf
. /etc/rc.d/functions
# Point to the binary
DAEMON=/usr/bin/mongod
# Get the ARGS from the conf
. /etc/conf.d/crond
# Function to get the process id
PID=$(get_pid $DAEMON)
case "$1" in
   start)
    stat_busy "Starting $DAEMON"
    # Check the PID exists - and if it does (returns 0) - do no run
    [ -z "$PID" ] && $DAEMON $ARGS &> /dev/null
    if [ $? = 0 ]; then
        add_daemon $DAEMON
        stat_done
    else
        stat_fail
        exit 1
    fi
    ;;
   stop)
        stat_busy "Stopping $DAEMON"
    kill -HUP $PID &>/dev/null
    rm_daemon $DAEMON
    stat_done
    ;;
   restart)
        $0 stop
    sleep 1
    $0 start
    ;;
    *)
        echo "usage: $0 {start|stop|restart}"
esac
私はApacheがそれをどのように行うかを見てきましたが、彼らが何をしているのか理解できません。これが彼らのhttpdスクリプトの一部です:
case "$1" in
  start)
    stat_busy "Starting Apache Web Server"
    [ ! -d /var/run/httpd ] && install -d /var/run/httpd
    if $APACHECTL start >/dev/null ; then
      add_daemon $daemon_name
      stat_done
    else
      stat_fail
      exit 1
    fi
    ;;