#freeze
**スクリプト [#h0a5958b]

#contents

----
***起動スクリプト [#xd4f06bf]
 #!/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 [#k6ab760e]
 CONFFILE=/usr/local/etc/mt-daapd.conf
 OPTIONS="-c $CONFFILE"

***logrotateスクリプト [#j7108a8d]
 /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