スクリプト


起動スクリプト

#!/bin/bash
#
# chkconfig: 2345 85 15
# description: mt-daapd is a multi-threaded DAAP server for iTunes
# processname: mt-daapd
# pidfile: /var/run/mt-daapd
#

prog=/usr/local/sbin/mt-daapd

# source function library
. /etc/init.d/functions
[ -e /usr/local/etc/mt-daapd.conf ]

if [ -f /etc/sysconfig/mt-daapd ]; then
# オプションを記述
   . /etc/sysconfig/mt-daapd
fi

RETVAL=0

start() {
        echo -n $"Starting DAAP server: "
        daemon $prog $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mt-daapd
}

stop() {
        echo -n $"Shutting down DAAP server: "
        # This is broken.
        killproc $prog -INT
        RETVAL=$?

        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mt-daapd
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        stop
        start
        RETVAL=$?
        ;;
  status)
        status mt-daapd
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
esac

exit $RETVAL

sysconfig

CONFFILE=/usr/local/etc/mt-daapd.conf
OPTIONS="-c $CONFFILE"

logrotateスクリプト

/var/log/mt-daapd.log {
    missingok
    notifempty
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/mt-daapd.pid 2>/dev/null` 2>  /dev/null || true
    endscript
}

トップ   編集 凍結解除 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-06-11 (金) 22:34:28