デーモンの起動
録画に必要な標準ファームのデーモンを起動します。
rc スクリプトの作成
起動するものがたくさんあるので、スクリプトにします。
sil:/etc/init.d# vi /etc/init.d/buffalodaemon
:
:
sil:/etc/init.d# cat /etc/init.d/buffalodaemon
#!/bin/sh
case "$1" in
start)
chroot /usr/local/buffalo mount /proc
for prog in httpd.sh pcastd.sh epg.sh clientUtil_servd.sh ltbootd.sh
do
chroot /usr/local/buffalo etc/init.d/$prog start
done
;;
stop)
for prog in ltbootd.sh clientUtil_servd.sh epg.sh pcastd.sh httpd.sh
do
chroot /usr/local/buffalo etc/init.d/$prog stop
done
chroot /usr/local/buffalo umount /proc
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
sil:/etc/init.d# chmod 755 buffalodaemon
sil:/etc/init.d#
手動で起動
sil:/etc/init.d# /etc/init.d/buffalodaemon start
start
Starting HTTPD services: /usr/local/apache/bin/apachectl start: httpd started
killall: chk_mediaserver.sh: no process killed
Start services: pcastd scheduler
pcastd 0.5.9 start.
key='server', value='on'
key='media', value='/mnt/disk1/share'
Set pcast_mp2000 seting media=global_param.public_root
key='usbdisk', value='1'
key='limit_media', value=''
key='limit_pass', value=''
EOF Detect.
config '/etc/pcast/pcastd.conf' open.
key='server_port', value='8000'
key='client_language_code', value='sjis'
key='skin_root', value='/etc/pcast/theme/pcast'
key='us_skin_root', value='/etc/pcast/theme_us/pcast'
key='flag_unknown_extention_file_hide', value='true'
key='flag_image_viewer', value='false'
key='flag_daemon', value='true'
key='flag_debug_log_output', value='false'
key='debug_log_filename', value='/mnt/disk1/_share/pcastd_debug.log'
EOF Detect.
Daemoning....
killall: mt-daapd: no process killed
Start services: EPGd iRCommander
EPGd : version 1.1.0
0.2.0
Starting clientUtil_server:starting on eth0
Starting services: rarpd tftpd rarpcfgd fwupdated.
sil:/etc/init.d# find: /proc/1/task: Permission denied
find: /proc/1/fd: Permission denied
:
:
:
Start services: mediaserver
Not connect at BufPCastDLNAAccessControl.pm line 425.
HwCtrlPid = [1059]
Permission denied がたくさん表示されますが、
気にしなくても良いようです。
自動起動の設定
sil:/etc/init.d# cd ..
sil:/etc# ln -s ../init.d/buffalodaemon rc0.d/K10buffalodaemon
sil:/etc# ln -s ../init.d/buffalodaemon rc6.d/K10buffalodaemon
sil:/etc# ln -s ../init.d/buffalodaemon rc2.d/S90buffalodaemon
sil:/etc# ls -l */*buffalodaemon*
-rwxr-xr-x 1 root root 449 Jul 1 03:38 init.d/buffalodaemon
lrwxrwxrwx 1 root root 23 Jul 1 03:42 rc0.d/K10buffalodaemon -> ../init.d/buffalodaemon
lrwxrwxrwx 1 root root 23 Jul 1 03:44 rc2.d/S90buffalodaemon -> ../init.d/buffalodaemon
lrwxrwxrwx 1 root root 23 Jul 1 03:42 rc6.d/K10buffalodaemon -> ../init.d/buffalodaemon
sil:/etc#
確認
ps を実行して、必要なプロセスが起動できているかを確認します。
sil:~# ps -aux
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 6.2 0.4 1896 624 ? S 05:05 0:04 init [2]
root 2 0.0 0.0 0 0 ? SN 05:05 0:00 [ksoftirqd/0]
root 3 0.0 0.0 0 0 ? S< 05:05 0:00 [events/0]
root 4 0.0 0.0 0 0 ? S< 05:05 0:00 [khelper]
root 5 0.0 0.0 0 0 ? S< 05:05 0:00 [kthread]
root 11 0.0 0.0 0 0 ? S< 05:05 0:00 [kblockd/0]
root 14 0.0 0.0 0 0 ? S< 05:05 0:00 [khubd]
root 29 0.0 0.0 0 0 ? S 05:05 0:00 [crypto]
root 30 0.0 0.0 0 0 ? S 05:05 0:00 [crypto_ret]
root 51 0.0 0.0 0 0 ? S 05:05 0:00 [pdflush]
root 52 0.0 0.0 0 0 ? S 05:05 0:00 [pdflush]
root 54 0.0 0.0 0 0 ? S< 05:05 0:00 [aio/0]
root 53 0.0 0.0 0 0 ? S 05:05 0:00 [kswapd0]
root 55 0.0 0.0 0 0 ? S< 05:05 0:00 [xfslogd/0]
root 56 0.0 0.0 0 0 ? S< 05:05 0:00 [xfsdatad/0]
root 180 0.0 0.0 0 0 ? S< 05:05 0:00 [scsi_eh_0]
root 181 0.0 0.0 0 0 ? S< 05:05 0:00 [scsi_eh_1]
root 194 0.0 0.0 0 0 ? S 05:05 0:00 [mtdblockd]
root 232 0.0 0.0 0 0 ? S< 05:05 0:00 [xfsbufd]
root 233 0.0 0.0 0 0 ? S< 05:05 0:00 [xfssyncd]
root 428 0.0 0.0 0 0 ? S 05:05 0:00 [kjournald]
root 430 0.0 0.0 0 0 ? S< 05:05 0:00 [xfsbufd]
root 431 0.0 0.0 0 0 ? S< 05:05 0:00 [xfssyncd]
root 577 0.0 0.9 2656 1180 ? S 05:05 0:00 /bin/sh /usr/local/sbin/kernelmon
root 592 0.0 0.2 1436 360 ? S 05:05 0:00 cat /proc/buffalo/kernevnt
root 598 0.1 0.4 1520 596 ? Ss 05:05 0:00 /sbin/syslogd
root 604 0.0 0.2 1448 368 ? Ss 05:05 0:00 /sbin/klogd -x
102 650 0.0 0.7 5848 952 ? Ss 05:05 0:00 /usr/sbin/exim4 -bd -q30m
root 662 0.0 0.4 1696 564 ? Ss 05:05 0:00 /usr/sbin/inetd
daemon 681 0.0 0.3 1856 400 ? Ss 05:05 0:00 /usr/sbin/atd
root 688 0.0 0.5 2272 736 ? Ss 05:05 0:00 /usr/sbin/cron
root 704 0.0 0.7 3204 924 ? Ss 05:05 0:00 /usr/local/apache/bin/httpd
root 706 0.0 0.5 3260 672 ? S 05:05 0:00 /usr/local/apache/bin/httpd
root 707 0.0 0.5 3260 672 ? S 05:05 0:00 /usr/local/apache/bin/httpd
root 708 0.0 0.5 3260 672 ? S 05:05 0:00 /usr/local/apache/bin/httpd
root 709 0.0 0.5 3260 672 ? S 05:06 0:00 /usr/local/apache/bin/httpd
root 712 0.0 0.7 3204 928 ? Ss 05:06 0:00 /usr/local/apache/bin/httpd -f /etc/apache/httpd8080.conf
root 714 0.0 0.5 3260 676 ? S 05:06 0:00 /usr/local/apache/bin/httpd -f /etc/apache/httpd8080.conf
root 715 0.0 0.5 3260 676 ? S 05:06 0:00 /usr/local/apache/bin/httpd -f /etc/apache/httpd8080.conf
root 716 0.0 0.5 3260 676 ? S 05:06 0:00 /usr/local/apache/bin/httpd -f /etc/apache/httpd8080.conf
root 717 0.0 0.5 3260 676 ? S 05:06 0:00 /usr/local/apache/bin/httpd -f /etc/apache/httpd8080.conf
root 720 0.0 0.5 3260 676 ? S 05:06 0:00 /usr/local/apache/bin/httpd
root 721 0.0 0.5 3260 680 ? S 05:06 0:00 /usr/local/apache/bin/httpd -f /etc/apache/httpd8080.conf
root 789 0.0 0.0 0 0 ? S 05:06 0:00 [M803 reader[0]]
root 796 1.0 5.2 42944 6612 ? Ssl 05:06 0:00 /usr/local/PCast/Scheduler
root 799 0.0 0.4 5304 540 ? S 05:06 0:00 /usr/local/PCast/pcastd
root 800 0.0 0.5 5304 660 ? S 05:06 0:00 /usr/local/PCast/pcastd
root 927 0.9 7.3 9940 9296 ? SNLl 05:06 0:00 /usr/mediaserver/mediaserver
root 958 1.4 0.8 2188 1132 ? S 05:06 0:00 /bin/sh /usr/local/bin/chk_mediaserver.sh
root 969 0.0 0.4 3016 524 ? Ss 05:06 0:00 /usr/local/PCast/EPGd
root 971 0.0 0.4 3612 540 ? Ss 05:06 0:00 /usr/local/PCast/iRCommander
root 997 0.0 0.2 1860 264 ? S 05:06 0:00 /usr/local/sbin/clientUtil_server -i eth0
root 1004 0.0 0.2 17936 372 ? Ssl 05:06 0:00 /usr/local/BootServer/rarpd
root 1011 0.0 0.1 1544 196 ? Ss 05:06 0:00 /usr/local/BootServer/tftpd
root 1016 0.0 0.2 9736 360 ? Ssl 05:06 0:00 /usr/local/BootServer/rarpcfgd
root 1018 0.0 0.1 1412 220 ? Ss 05:06 0:00 /usr/local/BootServer/fwupdated
root 1058 0.0 0.4 1444 512 ttyS0 Ss+ 05:06 0:00 /sbin/getty -L ttyS0 115200 vt100
root 1152 1.1 0.8 38036 1092 ? Sl 05:06 0:00 /usr/local/PCast/Scheduler
root 1279 0.6 0.5 1772 744 ? Ss 05:06 0:00 in.telnetd: muramasal.yamasita.jp
root 1280 0.8 0.9 3180 1144 pts/0 Ss 05:06 0:00 login -h muramasal.yamasita.jp -p
yasunari 1326 17.5 2.0 4004 2544 pts/0 S 05:06 0:01 -bash
root 1392 1.5 0.7 2780 988 pts/0 S 05:06 0:00 su - root
root 1397 1.6 1.1 2740 1484 pts/0 S 05:06 0:00 -su
root 1442 2.0 0.3 2792 416 ? S 05:06 0:00 sleep 1
root 1443 0.0 0.7 2220 884 pts/0 R+ 05:06 0:00 ps -aux
sil:~#
apache, Scheduler, pcastd, mediaserver, EPGd, iRCommander, clientUtil_server, rarpd, tftpd, rarpcfgd, fwupdated が動いていれば OK です。
参考ハックの記録:
Copyright (C) 2007-2008 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市