ページ更新: 2015-12-21 (月) (2594日前)
(2011-08-20 新規作成) QNAP 社 の NAS についてのメモ。 目次
現在の用途 (2015-06-22) #TS-239II+:
TS-231:
TS-112:
情報源 #
Firmvare v3.6:
Firmware v3.5:
Firmware v3.4: Kirkwood Cryptographic engine (使用してるかどうかはわからない):
メモ #[編集]TS-239II+, Dropboxとの同期を Dropbox Sync から Cound Drive Sync に変更 (2015-12-21) #「Dropbox Sync」が動かなくなっていたので、「QNAP Could Drive Dync APP」に乗り換えた。 /home/Dropbox を新規作成し、これと Dropboxの/ を同期させた。現在処理中。 ところで、これ、Dropbox の LAN同期 (LAN sync) 機能は持っているのだろうか? [編集]TS-231 を追加, TS-239II+ のHDDを4TB×2に交換, ファームウェア 4.1.4 に更新 (2015-06-20) #TS-231 (ARM Cortex-A9×2) と 4TB HDD×2台を追加した。 状況:
構成変更
作業手順
wol.cgi #1. 管理画面にログインし、QPKG の Python 2.7 をインストールする。Webサーバを有効にする。 2. 「Web」共有フォルダ内に cgi-bin ディレクトリと logs ディレクトリを作成し、以下の内容で Web\cgi-bin\wol.cgi を作成する。 中身は #wol_cgi_python と同じ。ただし、1行目は #!/usr/bin/python に変更した。 3. SSH でログインして、以下の作業を行う。 /etc/config/apache/apache.conf の末尾に以下の行をエディタ(vim)で追加する。 ScriptAlias /cgi-bin "/share/Web/cgi-bin" ErrorLog /share/Web/logs/error.log LogLevel error wol.cgi に実行権限を付加する。 # cd /share/Web/cgi-bin # chmod +x wol.cgi apache.conf を検査する。 # /usr/local/apache/bin/apachectl configtest Apacheを再起動してapache.confを読み込ませる。 # /usr/local/apache/bin/apachectl restart Web ブラウザで http://NASのIP/cgi-bin/wol.cgi を開く。 問題があれば、共有フォルダ Web の log\error.log を見て修正する。 問題が無ければ、/etc/config/apache/apache.conf LogLevel error を LogLevel crit に書き換えて、再度 apachectl configtest と apachectl restart を実行する。 [編集]mpd (Music Player Daemon) #1. QNAP のサイトで NAS の機種を選択し、アプリケーションで Optware ipkg をダウンロードする。 2. NASの理画面にログインし、Optware ipkg をインストールする。 3. NAS に ssh でログインして、以下の作業を行う。 mpd と、動作確認用に mpc をインストールする。 # ipkg update # ipkg install mpd # ipkg install mpc USBオーディオI/F (Texas Instruments PCM2704) を2台取り付けてみた: # lsusb Bus 002 Device 002: ID 1005:b155 Apacer Technology, Inc. Bus 002 Device 004: ID 0424:2524 Standard Microsystems Corp. USB MultiSwitch Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 006: ID 08bb:2704 Texas Instruments Japan Bus 002 Device 007: ID 056d:0002 EIZO Corp. HID Monitor Controls Bus 007 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 002: ID 08bb:2704 Texas Instruments Japan Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub サンプリングレートを確認する: # lsusb -s 002:006 -v | grep -i freq bSamFreqType 3 Discrete tSamFreq[ 0] 32000 tSamFreq[ 1] 44100 tSamFreq[ 2] 48000 bSamFreqType 3 Discrete tSamFreq[ 0] 32000 tSamFreq[ 1] 44100 tSamFreq[ 2] 48000 # lsusb -s 002:006 -v | grep -i freq bSamFreqType 3 Discrete tSamFreq[ 0] 32000 tSamFreq[ 1] 44100 tSamFreq[ 2] 48000 bSamFreqType 3 Discrete tSamFreq[ 0] 32000 tSamFreq[ 1] 44100 tSamFreq[ 2] 48000 カーネルモジュールを確認する: # lsmod | grep snd snd_usb_caiaq 30391 0 - Live 0xf8b64000 snd_usb_audio 74698 0 - Live 0xf8b3a000 snd_usbmidi_lib 14991 1 snd_usb_audio, Live 0xf8a3b000 snd_hwdep 4523 1 snd_usb_audio, Live 0xf8a2f000 snd_seq_midi 3880 0 - Live 0xf8a27000 snd_rawmidi 14005 3 snd_usb_caiaq,snd_usbmidi_lib,snd_seq_midi, Live 0xf8a1b000 usbcore 171287 12 uvcvideo,snd_usb_caiaq,snd_usb_audio,snd_usbmidi_lib,xhci_hcd,usblp,usbhid,usb_storage,uhci_hcd,ehci_hcd, Live 0xf8141000 OSS のデバイスファイルを確認する: # ls /dev/dsp* /dev/dsp@ /dev/dsp0 /dev/dsp1 /dev/dsp2 /dev/dsp3 /dev/dsp4 # ls /dev/mixer* /dev/mixer@ /dev/mixer0 /dev/mixer1 /dev/mixer2 /dev/mixer3 /dev/mixer4 設定ファイル mpd.conf を作成する。
# cp /opt/share/doc/mpd/mpdconf.example /opt/etc/mpd.conf # diff mpdconf.example mpd.conf 13c13 < #music_directory "~/music" --- > music_directory "/share/Multimedia/music" 20c20 < #playlist_directory "~/.mpd/playlists" --- > playlist_directory "/share/Multimedia/music/mpd_playlists" 28c28 < #db_file "~/.mpd/database" --- > db_file "/share/Multimedia/music/mpd_playlists/database.db" 189,192c189,192 < #audio_output { < # type "oss" < # name "My OSS Device" < ## device "/dev/dsp" # optional --- > audio_output { > type "oss" > name "dsp0" > device "/dev/dsp0" # optional 194c194 < ## mixer_device "/dev/mixer" # optional --- > mixer_device "/dev/mixer0" # optional 196c196,205 < #} --- > } > audio_output { > type "oss" > name "dsp1" > device "/dev/dsp1" # optional > ## format "44100:16:2" # optional > mixer_device "/dev/mixer1" # optional > ## mixer_control "PCM" # optional > } > 221,223c230,232 < #audio_output { < # type "httpd" < # name "My HTTP Stream" --- > audio_output { > type "httpd" > name "HTTPStream" 227c236 < # bitrate "128" # do not define if quality is defined --- > bitrate "128" # do not define if quality is defined 229c238 < #} --- > } 331c340 < #audio_buffer_size "2048" --- > audio_buffer_size "16384" 369a379 > id3v1_encoding "UTF-16" 動作を確認する。ctrl-C で終了できる。 # /opt/bin/mpd --no-daemon --verbose --stdout /opt/etc/mpd.conf ... ^C 自動起動用にファイル /opt/etc/init.d/S99mpd を作成する。 #!/bin/sh if [ -n "`/opt/bin/pidof mpd`" ]; then /opt/bin/killall mpd 2>/dev/null fi /opt/bin/mpd /opt/etc/mpd.conf # chmod +x /opt/etc/init.d/S99mpd[編集] /opt/etc/init.d/* の 自動起動 (QTS 4.1.4) #mpd の起動/再起動 用に /opt/etc/init.d/S99mpd を作成したので、/opt/etc/init.d/S??* をNASの起動時に実行されるようにする。 情報源:
1. /etc/init.d/Optware.sh に以下のパッチを当てる。 差分: # diff Optware.sh.original Optware.sh 94c94,121 < --- > > # Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG > /bin/echo "Run Optware/ipkg /opt/etc/init.d/*" > source /etc/profile > # Start all init scripts in /opt/etc/init.d > # executing them in numerical order. > # > for i in /opt/etc/init.d/S??* ;do > # Ignore dangling symlinks (if any). > #[ ! -f "$i" ] && continue > > case "$i" in > *.sh) > # Source shell script for speed. > ( > trap - INT QUIT TSTP > set start > . $i > ) > ;; > *) > # No sh extension, so fork subprocess. > $i start > ;; > esac > done > # End patch > 117d143 <[編集] TS-239II+, TS-112: ファームウェア 4.1.1 build 1101 に更新 #(2014-12-20) 4.1.1 build 1003 から更新した。 以下のファームウェアを用いた。
手順:
TS-239II+, TS-112: ファームウェア 4.1.1 build 1003 に更新 #(2014-10-06) v3.7.3 から更新した。 以下のファームウェアを用いた。
A. Dropbox アプリケーションを念のため無効化しておく。
B. システム設定を保存、ファームウェア更新、システム設定を復元、不要なアプリケーションとサービスを停止。
C. 以前に設置した wol.cgi の修正
bash ShellShock 情報リンク
現時点の問題とTODO
QTS 4.1 へのアップデートの準備 (2014-05-23) #以下の条件を満たしたら、ファームウェアをバージョンアップする。
今回のsamba は SMB 2.1 (Windows 7,..) に対応しているので、速くなりそうだから。
アップデート前後にやること
TS-239II+, TS-112: QUSBCam 2.0 を試してみたが失敗(サポート外のカメラだから?) #(2012-09-14, 作業中) Webカメラの動作確認: PC上で、OpenCV 2.4.2 で、opencv.jp - OpenCV: ビデオ入出力(Video I/O)サンプルコード - をを参考にキャプチャ画像を表示するツールを作って実行した。2台ともOK。 #include <cctype> // isdigit #include "opencv2/opencv.hpp" int main(int argc, char *argv[]) { //const double w = 640, h = 480; const double w = 800, h = 600; //const double w = 1024, h = 768; const char * window_name = "Capture: ESC-key to Exit"; const char ESC_KEY = '\x1b'; // (1)コマンド引数によって指定された番号のカメラに対するキャプチャ構造体を作成する int camera_no = 0; if (argc == 1 || (argc == 2 && strlen (argv[1]) == 1 && isdigit (argv[1][0]))) camera_no = (argc == 2) ? argv[1][0] - '0' : 0; CvCapture *capture = cvCreateCameraCapture(camera_no); /* この設定は,利用するカメラに依存する */ // (2)キャプチャサイズを設定する. cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, w); cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, h); // (3)カメラから画像をキャプチャする cvNamedWindow(window_name, CV_WINDOW_AUTOSIZE); for (;;) { const IplImage * const frame = cvQueryFrame(capture); cvShowImage(window_name, frame); const int c = cvWaitKey(2); if (c == ESC_KEY) break; } cvDestroyWindow(window_name); cvReleaseCapture(&capture); return 0; } 以下、後でまとめる:
TS-239II+, TS-112: ファームウェア 3.7.3 に更新 #(2012-09-08)
TS-239ProII+: ||Number||Type||Date||Time||Users||Source IP||Computer name||Content|| ||1306||Information||2012/9/8||14:45:29||System||127.0.0.1||localhost||System started.|| ||1305||Information||2012/9/8||14:42:44||System||127.0.0.1||localhost||System was shut down on Sat Sep 8 14:42:44 JST 2012.|| ||1304||Information||2012/9/8||14:41:23||System||127.0.0.1||localhost||System updated successfully from 3.7.1 to 3.7.3.|| ||1303||Information||2012/9/8||14:39:07||System||127.0.0.1||localhost||[Firmware Upgrade] Start to update the firmware.|| TS-112: ||Number||Type||Date||Time||Users||Source IP||Computer name||Content|| ||3042||Information||2012/9/8||14:55:30||System||127.0.0.1||localhost||System started.|| ||3041||Information||2012/9/8||14:52:46||System||127.0.0.1||localhost||System was shut down on Sat Sep 8 14:52:46 JST 2012.|| ||3040||Information||2012/9/8||14:51:18||System||127.0.0.1||localhost||System updated successfully from 3.7.1 to 3.7.3.|| ||3039||Information||2012/9/8||14:47:39||System||127.0.0.1||localhost||[Firmware Upgrade] Start to update the firmware.||[編集] TS-239II+: RAID (md) メモ #(2012-07-11) RAID1 で運用している TS-239II+ の /dev/md* を ssh で接続して調べてみた。 [~] # cat /proc/mdstat Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] md0 : active raid1 sda3[0] sdb3[1] 1951945536 blocks [2/2] [UU] md2 : active raid1 sdb2[1] sda2[0] 530048 blocks [2/2] [UU] md13 : active raid1 sda4[0] sdb4[1] 458880 blocks [2/2] [UU] bitmap: 0/57 pages [0KB], 4KB chunk md9 : active raid1 sda1[0] sdb1[1] 530048 blocks [2/2] [UU] bitmap: 0/65 pages [0KB], 4KB chunk [~] # mount /proc on /proc type proc (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) sysfs on /sys type sysfs (rw) tmpfs on /tmp type tmpfs (rw,size=64M) none on /proc/bus/usb type usbfs (rw) /dev/sda4 on /mnt/ext type ext3 (rw) /dev/md9 on /mnt/HDA_ROOT type ext3 (rw) /dev/md0 on /share/MD0_DATA type ext4 (rw,usrjquota=aquota.user, jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl) tmpfs on /.eaccelerator.tmp type tmpfs (rw,size=32M) [~] # parted /dev/sda print Model: Seagate ST2000DL003-9VT1 (scsi) Disk /dev/sda: 2000GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 20.5kB 543MB 543MB primary ext3 2 543MB 1086MB 543MB primary linux-swap(v1) 3 1086MB 2000GB 1999GB primary ext4 4 2000GB 2000GB 510MB primary ext3 [~] # parted /dev/sdb print Model: Seagate ST2000DL003-9VT1 (scsi) Disk /dev/sdb: 2000GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 20.5kB 543MB 543MB primary ext3 2 543MB 1086MB 543MB primary linux-swap(v1) 3 1086MB 2000GB 1999GB primary ext4 4 2000GB 2000GB 510MB primary ext3 [~] # mdadm -Q /dev/md9 /dev/md9: 517.63MiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail. [~] # mdadm -Q /dev/md0 /dev/md0: 1861.52GiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail. [~] # mdadm -Q --detail /dev/md0 /dev/md0: Version : 00.90.03 Creation Time : Sun Dec 18 17:25:12 2011 Raid Level : raid1 Array Size : 1951945536 (1861.52 GiB 1998.79 GB) Used Dev Size : 1951945536 (1861.52 GiB 1998.79 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Wed Jul 11 20:32:12 2012 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 UUID : 0e553cf4:f7f5b6c5:9884be3a:b58eb359 Events : 0.13910 Number Major Minor RaidDevice State 0 8 3 0 active sync /dev/sda3 1 8 19 1 active sync /dev/sdb3 [~] # mdadm -Q --detail /dev/md9 /dev/md9: Version : 00.90.03 Creation Time : Sun Dec 18 12:22:29 2011 Raid Level : raid1 Array Size : 530048 (517.71 MiB 542.77 MB) Used Dev Size : 530048 (517.71 MiB 542.77 MB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 9 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Wed Jul 11 20:34:28 2012 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 UUID : 46da1312:95b92ad0:966a0745:15b98b67 Events : 0.694 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 8 17 1 active sync /dev/sdb1 [~] #[編集] TS-112, TS-239II+: ファームウェア 3.7.1 に更新 #(2012-06-17)
[Major Bug Fixes] - Applied the following patches for security enhancements: CVE-2012-1182, 2012-21111, CVE-2011-3192
TS-112 : 3.7.1にアップデートしてもファームウェアの表記が「3.6.1」のままだったので (QFinder, Web)、手動で再移動したら 3.7.1 と表示されるようになった。
TS-239II+ :
TS-112, TS-239II+: CVE-2012-1182 のパッチを当てた #(2012-05-26)
手順はファームウェアの更新と同じ。更新すると、以下のエラーメッセージが表示される: 更新に失敗しました。ファームウェアのバージョンを確認してください。 でも、ログを見ると、特に問題は無いようだ: TS-112 Number Type Date Time Users Source IP Computer name Content 1819 Information 2012/5/26 20:57:30 System 127.0.0.1 localhost SambaFix 1.0.0 installation succeeded. TS-239II+ Number Type Date Time Users Source IP Computer name Content 804 Information 2012/5/26 21:09:05 System 127.0.0.1 localhost SambaFix 1.0.0 installation succeeded. なお、以下の脆弱性については、(たぶん)未対策だと思う:
TS-112, TS-239II+: ファームウェア 3.6.1 build 0302 に更新 #(2012-03-04)
TS-239 Pro II+:
TS-239II+: Music Station で USB Audio DAC を使う #(2012-02-25) USB Audio DAC (Digital Analog Converter) には EIZO HD2452W 内蔵の Texas Instruments PCM2704 を使った。 (PC/QNAP TurboNAS#USBAudio と同じ) ssh で TS-239II+ に接続して、EIZO HD2452W (PCM2704) を接続前後の状態を確認: ★接続前 [~] # lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 002: ID 1005:b155 Apacer Technology, Inc. Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub ★接続後 [~] # lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 002: ID 1005:b155 Apacer Technology, Inc. Bus 002 Device 003: ID 0424:2524 Standard Microsystems Corp. USB MultiSwitch Hub ★HD2452W 内蔵 USBハブ Bus 002 Device 004: ID 08bb:2704 Texas Instruments Japan ★HD2452W 内蔵 USB Audio DAC Bus 002 Device 005: ID 056d:0002 EIZO Corp. HID Monitor Controls ★HD2452W 制御用 Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub [~] # ★USB Audio DAC のベンダー名と製品名を表示 [~] # lsusb -d 08bb:2704 -v | egrep -i 'product|vendor' idVendor 0x08bb Texas Instruments Japan idProduct 0x2704 iProduct 2 USB Audio DAC 設定〜ローカル再生までの手順:
TS-112: ファームウェア 3.6.0 build 0210 に更新 #(2012-02-25) 手順 (今回は QNAP Finder 経由でアップグレードしてみる)
所要時間は 20分程度。(1〜3で) システムログを見る限りでは、異常は見あたらなかった。 なお、以下のアプリケーションにも影響はなかった:
TS-239II+: ファームウェア 3.6.0 build 0210 に更新 #(2012-02-15) 今回の新機能は CPU 負荷が高そうなので、TS-112 (ARM) は 3.5.2 のままにして、TS-239II+ に入れてみることにした。 手順 (今回は QNAP Finder 経由でアップグレードしてみる)
所要時間は 15分程度。(1〜3で) システムログを見る限りでは、異常は見あたらなかった。 [編集]TS-112, TS-239II+: iperf #(2012-02-11, 2012-01-08) NAS に iperf をインストールして、PC との通信速度を計測してみた。
結果:
以下、作業のメモ。 TS-112 (3.5.2) に iperf をインストールする: # ipkg update ... # ipkg list | grep iperf iperf - 2.0.4-1 - A tool for measuring TCP and UDP bandwidth performance. # ipkg info iperf Package: iperf Version: 2.0.4-1 Status: install user installed Section: net Architecture: arm maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com> MD5Sum: 65eb80f57e7c2d09297aa0c5c06720c3 Size: 29424 Filename: iperf_2.0.4-1_arm.ipk Source: http://easynews.dl.sf.net/sourceforge/iperf/iperf-2.0.4.tar.gz Description: A tool for measuring TCP and UDP bandwidth performance. Successfully terminated. # ipkg install iperf ... # ipkg files iperf Package iperf (2.0.4-1) is installed on root and has the following files: /opt/share/man/man1/iperf.1 /opt/bin/iperf TS-239II+ (3.5.2) に iperf をインストールする: # ipkg update ... # ipkg list | grep iperf iperf - 2.0.4-1 - A tool for measuring TCP and UDP bandwidth performance. # ipkg info iperf Package: iperf Version: 2.0.4-1 Status: install user installed Section: net Architecture: i686 maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com> MD5Sum: ef6ea98998dccebc0582cbd74e1412c8 Size: 27406 Filename: iperf_2.0.4-1_i686.ipk Source: http://easynews.dl.sf.net/sourceforge/iperf/iperf-2.0.4.tar.gz Description: A tool for measuring TCP and UDP bandwidth performance. # ipkg install iperf ... # ipkg files iperf Package iperf (2.0.4-1) is installed on root and has the following files: /opt/share/man/man1/iperf.1 /opt/bin/iperf (Windows + Cygwin で iperf をビルド〜インストール) $ uname -sr CYGWIN_NT-6.1-WOW64 1.7.10(0.259/5/3) $ tar zxf iperf-2.0.5.tar.gz $ cd iperf-2.0.5 $ ./configure ... $ make install ... NAS で iperf -s を実行したのち、PC で iperf -c を実行して速度を計測する。 (Ubuntu) $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=11.10 DISTRIB_CODENAME=oneiric DISTRIB_DESCRIPTION="Ubuntu 11.10" $ iperf -v iperf version 2.0.5 (08 Jul 2010) pthreads $ iperf -c 192.168.1.6 ★TS-112 ------------------------------------------------------------ Client connecting to 192.168.1.6, TCP port 5001 TCP window size: 16.0 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.9 port 45037 connected with 192.168.1.6 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 646 MBytes 542 Mbits/sec $ iperf -c 192.168.1.12 ★TS-239II+ ------------------------------------------------------------ Client connecting to 192.168.1.12, TCP port 5001 TCP window size: 16.0 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.9 port 47343 connected with 192.168.1.12 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 1.10 GBytes 944 Mbits/sec (Windows + Cygwin) $ iperf --version iperf version 2.0.5 (08 Jul 2010) pthreads $ iperf -c 192.168.1.6 ------------------------------------------------------------ Client connecting to 192.168.1.6, TCP port 5001 TCP window size: 64.0 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.5 port 52103 connected with 192.168.1.6 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 687 MBytes 576 Mbits/sec $ iperf -c 192.168.1.12 ------------------------------------------------------------ Client connecting to 192.168.1.12, TCP port 5001 TCP window size: 64.0 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.5 port 52105 connected with 192.168.1.12 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 914 MBytes 767 Mbits/sec[編集] TS-239II+: Dropbox #(2012-05-01, 2012-03-24, 2012-03-20) 情報:
Dropbox_120408_x86 (2012-05-01) #
# /sbin/set_volume_mode Dropbox Volume: Dropbox Path: /share/MD0_DATA/Dropbox Set directory mode to 0777 and file mode to 0666(keep execute permission) 毎回ログインするのは面倒なので、Cygwin ssh や 他の ssh から実行するようにした: $ ssh admin@QNAPのIPアドレス "/sbin/set_volume_mode Dropbox" admin@XXX.XXX.XXX.XXX's password: Volume: Dropbox Path: /share/MD0_DATA/Dropbox Set directory mode to 0777 and file mode to 0666(keep execute permission) set_volume_mode コマンドの詳細: # which set_volume_mode /sbin/set_volume_mode # file `which set_volume_mode` /sbin/set_volume_mode: symbolic link to `nasutil' # ls -l `which set_volume_mode` lrwxrwxrwx 1 admin administ 7 Mar 2 06:59 /sbin/set_volume_mode -> nasutil* # file /sbin/nasutil /sbin/nasutil: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped # strings /sbin/nasutil | grep help --help --help -h, Display this help and exit. --help -?, --help show this help statement -h, --help Display help help help -h, --help Display this help and exit. # /sbin/nasutil --help nasutil multi-call binary [function] [arguments]... Current defined functions: init_nas_cache, init_admin_group, set_file_owner, chk_flash, reset_all, chk10198, get_trusted_domain, update_krb5_ticket rescan_hd, check_e2key, burn_e2key, cnt_phy_nic, http_link, ip_filter, hdusb_copy, ims, qpkg, gen_upnp_desc, scanafpdb eset_system, umount_all_vdd, sss_convert, httpd_init, get_hwsn, setsum, getsum, rsyslog_util, radius_util, send_alert_mail, rsync_util acl_cmd
# /etc/init.d/dropbox.sh status Dropbox: running (pid 7830) Indexing 16,807 files...
# /bin/check_dropbox.sh Dropbox command-line interface commands: Note: use dropbox help <command> to view usage for a specific command. status get current status of the dropboxd help provide help puburl get public url of a file in your dropbox stop stop dropboxd running return whether dropbox is running start start dropboxd filestatus get current sync status of one or more files ls list directory contents with current sync status autostart automatically start dropbox at login exclude ignores/excludes a directory from syncing lansync enables or disables LAN sync # cat /bin/check_dropbox.sh HOME=/share/homes/dropbox /share/MD0_DATA/.qpkg/Dropbox/tools/dropbox.py $* # /bin/check_dropbox.sh lansync enables or disables LAN sync dropbox lansync [y/n] options: y dropbox will use LAN sync (default) n dropbox will not use LAN sync # /bin/check_dropbox.sh lansync y[編集] Dropbox 1.2.52 (2012-03-24) #
共有フォルダ Dropbox に、他のPCのDropboxから全ファイルをコピーして、dropbox との同期中にNASを再起動したところ、障害が発生した (dropbox と同期しなくなった)。でも解決できた。 以下経緯を記載する。 1. /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh stop で dropbox を停止した。 2. 他のPCのDropboxから全ファイルをコピーした。 3. /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh start で dropbox を起動した。 4. 30分ほど経過して、まだ Dropbox との同期が完了していない時点で NAS を再起動したら、Public/Dropbox_status に以下のメッセージが記載された: Couldn't locate your Dropbox folder. Did you move it somewhere? なお、このとき、dropbox のデーモンは動いている: # /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh status dropboxd: running (pid 5702) # ps aux | grep dropbox 5702 admin 14880 S /share/MD0_DATA/.qpkg/Dropbox/dropbox 7709 admin 560 S grep dropbox Dropbox の設定やファイル一覧はこうなっていた: # ls -a /share/MD0_DATA/.qpkg/Dropbox/root/.dropbox ./ config.db filecache.dbx hostkeys sigstore.dbx ../ config.dbx host.db iface_socket= unlink.db command_socket= dropbox.pid host.dbx l/ 5. 共有フォルダ Dropbox 内の desktop.ini を全部消した # find /share/Dropbox/ -name desktop.ini | xargs rm 6. /share/MD0_DATA/.qpkg/Dropbox/root/.dropbox を消して、/share/MD0_DATA/.qpkg/Dropbox/dropbox.sh restart を実行し、再度リンクさせた(Public/Dropbox_status.txt に記載されたURLにアクセス)。 7. 数時間放置して、Dropbox との同期が完了したらしいことを確認して (ipkg の htop と iotop で dropbox プロセス の挙動を確認)、NAS を再起動した。Public/Dropbox_status.txt にはエラーは記載されていない。 8. Dropbox とリンクしているPCを2台つかって、ファイルの追加・削除・移動を行ってみた。いずれもちゃんと動作 (NAS, PC1, PC2 が同期) した。(なお、このときはやたら高速だったので、LAN sync していると思う) 以上。 [編集]Dropbox 1.1.45 (2012-03-20, 問題あり:Dropboxが自動アップデートされて動かなくなる) #QNAP NAS Community Forum • View topic - [QPKG] Dropbox 1.1.45 (X86 only) を見ながら作業した。
起動と終了は、/share/MD0_DATA/.qpkg/Dropbox/dropbox.sh を使う: # /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh status dropboxd: not running. # /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh start performing prestart checks for Dropbox Configuring environment for Dropbox Starting Dropbox # /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh status dropboxd: running (pid 19462) # /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh restart Stopping Dropbox rm: /var/lock/subsys: is a directory performing prestart checks for Dropbox Configuring environment for Dropbox Starting Dropbox # /share/MD0_DATA/.qpkg/Dropbox/dropbox.sh status dropboxd: running (pid 19652) 念のため、QNAP NAS を再起動してみた。ちゃんと Dropbox も起動されてた。 問題あり。しばらくすると、Dropbox がバージョンアップされて、動かなくなる。
TS-239II+: 入手, RAID1, CrystalDiskMark, cpuinfo #(2011-12-18) 手持ちの HDD 2台 (Seagate ST2000DL003 - SATA3 2TB 5900rpm 64MB) を取り付けて、RAID1 にした。 RAID1の構築は約7時間かかった。 ベンチマークはさすがに TS-112 より速い。(Sequential Read: 1.13倍、Sequential Write: 1.93倍) TS-239II+: ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 83.752 MB/s Sequential Write : 110.194 MB/s Random Read 512KB : 84.092 MB/s Random Write 512KB : 105.619 MB/s Random Read 4KB (QD=1) : 16.019 MB/s [ 3910.9 IOPS] Random Write 4KB (QD=1) : 13.668 MB/s [ 3336.9 IOPS] Random Read 4KB (QD=32) : 22.519 MB/s [ 5497.8 IOPS] Random Write 4KB (QD=32) : 14.329 MB/s [ 3498.3 IOPS] Test : 100 MB [Z: 24.6% (450.5/1832.3 GB)] (x5) Date : 2011/12/20 1:45:23 OS : Windows 7 SP1 [6.1 Build 7601] (x64) (たぶん、職場の TS-119P+ より速いのだろうけど、職場のは SSD 入れてあるから比較しにくい) TS-112: ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 74.073 MB/s Sequential Write : 57.034 MB/s Random Read 512KB : 73.916 MB/s Random Write 512KB : 55.526 MB/s Random Read 4KB (QD=1) : 9.559 MB/s [ 2333.8 IOPS] Random Write 4KB (QD=1) : 3.581 MB/s [ 874.2 IOPS] Random Read 4KB (QD=32) : 15.780 MB/s [ 3852.5 IOPS] Random Write 4KB (QD=32) : 3.244 MB/s [ 792.1 IOPS] Test : 100 MB [Z: 24.6% (451.0/1832.3 GB)] (x5) Date : 2011/12/24 15:37:21 OS : Windows 7 SP1 [6.1 Build 7601] (x64) Seagate ST31500341AS (1.5TB): ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 130.643 MB/s Sequential Write : 126.716 MB/s Random Read 512KB : 54.971 MB/s Random Write 512KB : 92.194 MB/s Random Read 4KB (QD=1) : 0.850 MB/s [ 207.5 IOPS] Random Write 4KB (QD=1) : 1.504 MB/s [ 367.1 IOPS] Random Read 4KB (QD=32) : 1.320 MB/s [ 322.3 IOPS] Random Write 4KB (QD=32) : 1.323 MB/s [ 323.1 IOPS] Test : 100 MB [F: 0.4% (6.0/1397.3 GB)] (x5) Date : 2011/12/24 15:43:37 OS : Windows 7 SP1 [6.1 Build 7601] (x64) Intel SSDSA2CW300G3 (300GB): ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 255.418 MB/s Sequential Write : 199.634 MB/s Random Read 512KB : 179.527 MB/s Random Write 512KB : 188.336 MB/s Random Read 4KB (QD=1) : 19.618 MB/s [ 4789.6 IOPS] Random Write 4KB (QD=1) : 35.387 MB/s [ 8639.3 IOPS] Random Read 4KB (QD=32) : 137.875 MB/s [ 33661.0 IOPS] Random Write 4KB (QD=32) : 71.697 MB/s [ 17504.2 IOPS] Test : 100 MB [C: 39.8% (111.2/279.4 GB)] (x5) Date : 2011/12/24 15:51:39 OS : Windows 7 SP1 [6.1 Build 7601] (x64) ssh でログインして、/proc/cpuinfo を表示: [~] # cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU D425 @ 1.80GHz stepping : 10 cpu MHz : 1795.643 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arc h_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm bogomips : 3591.28 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU D425 @ 1.80GHz stepping : 10 cpu MHz : 1795.643 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 1 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arc h_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm bogomips : 3590.23 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: (関連: Linux/cpuinfo) [編集]TS-112: ファームウェア 3.5.2 build 1124 → build 1126 に更新 #(2011-11-29) 特に問題なく作業を完了した。所要時間は10分くらい。 [編集]TS-112: ファームウェア 3.5.1 build 1002 → 3.5.2 build 1124 に更新 #(2011-11-26) ファームウェアを 3.5.1 から 3.5.2 Build 1124 にアップデートした。 所要時間は10分くらい (ファームウェアのダウンロードに掛かった時間を除く)
とりあえず、特に設定は変化しなかったようだ。 また、自分で入れた ntpd, ntpqを実行するCGI(shスクリプト), mpd (Music Player Daemon) は特に問題なく動作している。 # uname -r 2.6.33.2[編集] TS-112: GNU screen (2011-10-14, 作業中) ## which screen /usr/sbin/screen # screen /var/run/utmp: No such file or directory Cannot find termcap entry for 'vt100'. # ls /var/run/utmp ls: /var/run/utmp: No such file or directory # touch /var/run/utmp # screen Cannot find termcap entry for 'vt100'. # ipkg install screen Installing screen (4.0.3-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/screen_4.0.3-2_arm.ipk Installing termcap (1.3.1-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/termcap_1.3.1-2_arm.ipk Configuring screen chown: unknown group name: root Configuring termcap Successfully terminated. # ipkg files screen Package screen (4.0.3-2) is installed on root and has the following files: /opt/share/screen/utf8encodings/bf /opt/share/screen/utf8encodings/cd /opt/share/screen/utf8encodings/cc /opt/share/screen/utf8encodings/d6 /opt/share/screen/utf8encodings/c8 /opt/share/screen/utf8encodings/c6 /opt/share/screen/utf8encodings/c7 /opt/share/screen/utf8encodings/c4 /opt/share/screen/utf8encodings/c2 /opt/share/screen/utf8encodings/c3 /opt/share/screen/utf8encodings/a1 /opt/man/man1/screen.1 /opt/info/screen.info-2 /opt/info/screen.info-3 /opt/info/screen.info-1 /opt/info/screen.info-4 /opt/info/screen.info-5 /opt/share/screen/utf8encodings/18 /opt/share/screen/utf8encodings/19 /opt/share/screen/utf8encodings/04 /opt/share/screen/utf8encodings/02 /opt/share/screen/utf8encodings/03 /opt/share/screen/utf8encodings/01 /opt/bin/screen /opt/bin/screen-4.0.3 /opt/info/screen.info # ipkg files termcap Package termcap (1.3.1-2) is installed on root and has the following files: /opt/etc/termcap /opt/lib/libtermcap.a /opt/include/termcap.h # which screen /usr/sbin/screen # /usr/sbin/screen -v Screen version 4.00.03 (FAU) 23-Oct-06 # screen Cannot find termcap entry for 'vt100'. # /opt/bin/screen -v # /opt/bin/screen Screen version 4.00.03 (FAU) 23-Oct-06 Copyright (c) 1993-2002 Juergen Weigert, Michael Schroeder Copyright (c) 1987 Oliver Laumann .... [Press Space or Return to end.] # exit [screen is terminating] #[編集] TS-112: ファームウェア 3.5.0 → 3.5.1 build 1002 に更新 #(2011-10-05 開始) 手順:
2.の直前のベンチマーク (Windows 7 SP1 64bit (Core2Quad Q9550, 8GB) -- GbE ハブ -- TS-112): ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 63.406 MB/s Sequential Write : 53.594 MB/s Random Read 512KB : 48.739 MB/s Random Write 512KB : 55.116 MB/s Random Read 4KB (QD=1) : 2.727 MB/s [ 665.8 IOPS] Random Write 4KB (QD=1) : 2.937 MB/s [ 717.0 IOPS] Random Read 4KB (QD=32) : 0.662 MB/s [ 161.6 IOPS] Random Write 4KB (QD=32) : 3.058 MB/s [ 746.6 IOPS] Test : 100 MB [Z: 24.8% (454.7/1832.3 GB)] (x5) Date : 2011/10/06 21:27:47 OS : Windows 7 SP1 [6.1 Build 7601] (x64) 3.の直後 (起動10分後) のベンチマーク (Windows 7 SP1 64bit (Core2Quad Q9550, 8GB) -- GbE ハブ -- TS-112): ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 72.008 MB/s Sequential Write : 55.568 MB/s Random Read 512KB : 71.891 MB/s Random Write 512KB : 55.043 MB/s Random Read 4KB (QD=1) : 8.245 MB/s [ 2012.9 IOPS] Random Write 4KB (QD=1) : 3.261 MB/s [ 796.2 IOPS] Random Read 4KB (QD=32) : 3.312 MB/s [ 808.6 IOPS] Random Write 4KB (QD=32) : 3.393 MB/s [ 828.5 IOPS] Test : 100 MB [Z: 24.8% (454.7/1832.3 GB)] (x5) Date : 2011/10/06 22:20:34 OS : Windows 7 SP1 [6.1 Build 7601] (x64)[編集] TS-112: デーモンの自動起動 (2011-09-20) #QNAPの起動時に /opt/etc/init.d/* を実行する処理を /etc/init.d/Optware.sh (/opt/Optware.sh) に追加する。 参考: # cd /etc/init.d # (Optware.sh を修正) 修正個所 (Install Optware IPKG - QNAPedia を追加しただけ): [/etc/init.d] # diff -U 3 Optware.sh.org Optware.sh --- Optware.sh.org +++ Optware.sh @@ -50,6 +50,34 @@ # adding Ipkg apps into system path ... /bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null [ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile + + # Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG + /bin/echo "Run Optware/ipkg /opt/etc/init.d/*" + source /etc/profile + # Start all init scripts in /opt/etc/init.d + # executing them in numerical order. + # + for i in /opt/etc/init.d/S??* ;do + # Ignore dangling symlinks (if any). + #[ ! -f "$i" ] && continue + + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set start + . $i + ) + ;; + *) + # No sh extension, so fork subprocess. + $i start + ;; + esac + done + # End patch + ;; stop) /bin/echo "Disable Optware/ipkg" 今回、以下のディレクトリの起動スクリプトが実行されればOK: # ls -l /opt/etc/init.d -rwxr-xr-x 1 admin administ 1714 Nov 30 2010 S20dbus* -rwxr-xr-x 1 admin administ 288 Nov 2 2010 S77ntp* -rwxr-xr-x 1 admin administ 123 Sep 19 21:02 S99mpd* QNAP を再起動し、ntp と mpd がちゃんと起動していることを確認した: # ps auz | egrep 'ntpd|mpd' 2651 admin 212 S /usr/sbin/ntpdated 3086 admin 832 S /opt/bin/ntpd -c /opt/etc/ntp/ntp.conf -f /var/spool/ntp/ntp.drift -s /var/spool/nt 3441 admin 5156 S /opt/bin/mpd /opt/etc/mpd.conf 9652 admin 564 R egrep ntpd|mpd[編集] TS-112: USB Audio DAC, mp3blaster, mpd/mpc (2011-09-20) #USB Audio DAC (Digital Analog Converter) を繋いで、ジュークボックスにする。 出来たこと:
まだやってないこと。
カーネルモジュールのうち、sound 関連の物を表示: [~] # lsmod | grep snd snd_usb_caiaq 17633 0 - Live 0xbf435000 snd_usb_audio 61533 0 - Live 0xbf419000 snd_usb_lib 15164 1 snd_usb_audio, Live 0xbf40f000 snd_hwdep 4809 1 snd_usb_audio, Live 0xbf408000 snd_pcm_oss 35595 0 - Live 0xbf3f8000 snd_mixer_oss 13108 1 snd_pcm_oss, Live 0xbf3ef000 snd_pcm 56634 3 snd_usb_caiaq,snd_usb_audio,snd_pcm_oss, Live 0xbf3d8000 snd_seq_oss 25585 0 - Live 0xbf3ca000 snd_seq_midi 3874 0 - Live 0xbf3c4000 snd_seq_midi_event 4566 2 snd_seq_oss,snd_seq_midi, Live 0xbf3bd000 snd_seq 43233 5 snd_seq_oss,snd_seq_midi,snd_seq_midi_event, Live 0xbf3aa000 snd_rawmidi 15853 3 snd_usb_caiaq,snd_usb_lib,snd_seq_midi, Live 0xbf3a0000 snd_page_alloc 4715 1 snd_pcm, Live 0xbf399000 snd_seq_device 4739 4 snd_seq_oss,snd_seq_midi,snd_seq,snd_rawmidi, Live 0xbf392000 snd_timer 16026 2 snd_pcm,snd_seq, Live 0xbf388000 snd 37095 12 snd_usb_caiaq,snd_usb_audio,snd_usb_lib,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,s nd_seq,snd_rawmidi,snd_seq_device,snd_timer, Live 0xbf375000 soundcore 4763 1 snd, Live 0xbf36e000 [~] # sound関連のモジュールが既に組み込まれていた。 USB デバイスの一覧: [~] # lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS ★無停電電源 [~] # USB デバイスの一覧 (HD2452Wを接続した後): [~] # lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 001 Device 004: ID 0424:2524 Standard Microsystems Corp. USB MultiSwitch Hub ★HD2452W 内蔵 USBハブ Bus 001 Device 005: ID 08bb:2704 Texas Instruments Japan ★HD2452W 内蔵 USB Audio DAC Bus 001 Device 006: ID 056d:0002 EIZO Corp. HID Monitor Controls ★HD2452W 制御用 [~] # HD2452W の USB Audio : ID 08bb:2704 Texas Instruments Japan の詳細 (たぶん TI PCM2704): [~] # lsusb -d 08bb:2704 -v Bus 001 Device 005: ID 08bb:2704 Texas Instruments Japan Device Descriptor: ... idVendor 0x08bb Texas Instruments Japan idProduct 0x2704 bcdDevice 1.00 iManufacturer 1 Burr-Brown from TI iProduct 2 USB Audio DAC iSerial 0 ... AudioStreaming Interface Descriptor: ... bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType 3 Discrete tSamFreq[ 0] 32000 ★ 32.0 kHz tSamFreq[ 1] 44100 ★ 44.1 kHz tSamFreq[ 2] 48000 ★ 48.0 kHz HD2453W 接続後のオーディオデバイスの一覧: [~] # ls -l /dev/audio* lrwxrwxrwx 1 admin administ 6 Sep 17 00:00 /dev/audio -> audio0 crw-rw-rw- 1 admin administ 14, 4 Sep 17 00:00 /dev/audio0 crw-rw-rw- 1 admin administ 14, 20 Sep 17 00:00 /dev/audio1 crw-rw-rw- 1 admin administ 14, 36 Sep 17 00:00 /dev/audio2 crw-rw-rw- 1 admin administ 14, 52 Sep 17 00:00 /dev/audio3 crw-rw-rw- 1 admin administ 14, 68 Sep 17 00:00 /dev/audio4 [~] # (2011-09-19) DN-USBDAC ZY を接続してみた: [~] # lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 001 Device 004: ID 08bb:2704 Texas Instruments Japan ★ [~] # [~] # lsusb -d 08bb:2704 -v Bus 001 Device 004: ID 08bb:2704 Texas Instruments Japan Device Descriptor: ... idVendor 0x08bb Texas Instruments Japan idProduct 0x2704 bcdDevice 1.00 iManufacturer 1 Burr-Brown from TI iProduct 2 USB Audio DAC iSerial 0 ... AudioStreaming Interface Descriptor: ... bNrChannels 2 bSubframeSize 2 bBitResolution 16 bSamFreqType 3 Discrete tSamFreq[ 0] 32000 tSamFreq[ 1] 44100 tSamFreq[ 2] 48000 ipkg で mp3 を再生できるソフトウェアを探してインストールする: [~] # ipkg list | grep -i mp3 ices0 - 0.4-2 - source client for broadcasting in MP3 format to an icecast2 server lame - 3.98.4-1 - LAME is an LGPL MP3 encoder. moc - 2.4.3-1 - MOC (music on console) is a console audio player with a simple ncurses interface in playmp3lis t style. mp3blaster - 3.2.3-2 - interactive text-based program that plays MP3, Ogg Vorbis, wav, and sid audio files mp3info - 0.8.5a-1 - A little utility used to read and modify the ID3 tags of MP3 files. [~] # [~] # ipkg install mp3blaster Installing mp3blaster (3.2.3-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/mp3blaster_3.2.3-2_arm.ipk Configuring mp3blaster Successfully terminated. [~] # [/var/log] # ipkg files mp3blaster Package mp3blaster (3.2.3-2) is installed on root and has the following files: /opt/share/mp3blaster/sample.mp3blasterrc /opt/share/mp3blaster/commands.txt /opt/bin/mp3tag /opt/share/mp3blaster/charmap/makefile.charmap /opt/share/mp3blaster/charmap/win1251 /opt/share/man/man1/mp3blaster.1 /opt/bin/splay /opt/bin/nmixer /opt/share/mp3blaster/charmap/README /opt/share/mp3blaster/charmap/koi8-r /opt/share/mp3blaster/charmap/maketbl.c /opt/share/mp3blaster/charmap/win2koi.tbl /opt/share/mp3blaster/charmap/chargen.c /opt/share/man/man1/nmixer.1 /opt/share/man/man1/splay.1 /opt/bin/mp3blaster Successfully terminated. mp3blaster を実行したところ、エラーが発生。libvorbisfile.so.3 が必要とのこと。libvorbis (と libogg) をインストールして解決した: [~] # mp3blaster test.mp3 mp3blaster: error while loading shared libraries: libvorbisfile.so.3: cannot open shared object file: No such file or directory [~] # ipkg list | grep vorbis fuppes - SVN-578-1 - FUPPES is a free, multiplatform UPnP (TM) A/V MediaServer, with optional on-the-fly audio transcondig from ogg/vorbis, mpc/muse ivorbis-tools - 1.0-7 - Tools to allow you to play, encode, and manage Ogg Vorbis files. This version is hacke d to use the Tremor integer decoder. libvorbis - 1.3.2-1 - Ogg Vorbis compressed audio format. libvorbisidec - cvs-20050221-2 - libvorbisidec is the integer-only ogg decoder library, AKA Tremor vorbis-tools - 1.1.1-5 - A set of tools to manipulate ogg-vorbis files. [~] # ipkg install libvorbis Installing libvorbis (1.3.2-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libvorbis_1.3.2-1_arm.ipk Installing libogg (1.2.1-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libogg_1.2.1-1_arm.ipk Configuring libogg Configuring libvorbis Successfully terminated. [~] # ランダム再生で、指定したプレイリストをすぐに再生する: [~] # /opt/bin/mp3blaster -p allrandom -a /root/cd_etc.m3u Music Player Daemon も IPKG に用意されていた: [~] # ipkg list | grep -i music ccxstream - 1.0.15-4 - A server to stream music and video to an XBox running Xbo x Media Player using XBMSP protocol moc - 2.4.3-1 - MOC (music on console) is a console audio player with a simple n curses interface in playmp3list style. mpd - 0.15.15-2 - Music Player Daemon (MPD) allows remote access for playing mus ic. ncmpc - 0.16.1-1 - A curses client for the Music Player Daemon (MPD). [~] # [~] # ipkg list | egrep 'mpd|mpc' fuppes - SVN-578-1 - FUPPES is a free, multiplatform UPnP (TM) A/V MediaServer, with optional on-the-fly audio transcondig from ogg/vorbis, mpc/muse libmpcdec - 1.2.6-1 - Portable Musepack decoder library. libmpdclient - 2.1-1 - A stable, documented, asynchronous API library for interf acing MPD in the C, C++ & Objective C languages mini-snmpd - 1.0-1 - SNMP server for embedded systems mpc - 0.19-1 - A command line tool to interface MPD. mpd - 0.15.15-2 - Music Player Daemon (MPD) allows remote access for playing mus ic. mpdscribble - 0.19-1 - Last.fm reporting client for mpd. ncmpc - 0.16.1-1 - A curses client for the Music Player Daemon (MPD). scrobby - 0.1-1 - an audioscrobbler mpd client written in C++ [~] # [~] # ipkg install mpd Installing mpd (0.15.15-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/mpd_0.15.15-2_arm.ipk Installing audiofile (0.2.6-6) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/audiofile_0.2.6-6_arm.ipk Installing faad2 (2.6-3) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/faad2_2.6-3_arm.ipk Installing ffmpeg (0.svn20080409-3) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ffmpeg_0.svn20080409-3_arm.ip k Installing flac (1.2.1-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/flac_1.2.1-1_arm.ipk Installing glib (2.20.4-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/glib_2.20.4-1_arm.ipk Installing lame (3.98.4-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/lame_3.98.4-1_arm.ipk Installing libao (0.8.8-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libao_0.8.8-1_arm.ipk Installing libcurl (7.21.7-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libcurl_7.21.7-1_arm.ipk Installing libid3tag (0.15.1b-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libid3tag_0.15.1b-1_arm.ipk Installing libmad (0.15.1b-4) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libmad_0.15.1b-4_arm.ipk Installing libmms (0.5-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libmms_0.5-1_arm.ipk Installing libmpcdec (1.2.6-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libmpcdec_1.2.6-1_arm.ipk Installing libshout (2.2.2-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libshout_2.2.2-2_arm.ipk Installing speex (1.2rc1-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/speex_1.2rc1-2_arm.ipk Installing wavpack (4.50.1-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/wavpack_4.50.1-1_arm.ipk Installing libvorbisidec (cvs-20050221-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libvorbisidec_cvs-20050221-2_ arm.ipk Installing avahi (0.6.30-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/avahi_0.6.30-1_arm.ipk Installing libdaemon (0.14-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libdaemon_0.14-1_arm.ipk Installing dbus (1.2.16-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/dbus_1.2.16-1_arm.ipk Installing adduser (1.10.3-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/adduser_1.10.3-1_arm.ipk Configuring adduser update-alternatives: Linking //opt/bin/su to /opt/bin/adduser-su Configuring audiofile Configuring avahi Configuring dbus No messagebus user found, creating it... done Configuring faad2 Configuring ffmpeg Configuring flac Configuring glib Configuring lame Configuring libao Configuring libcurl Configuring libdaemon Configuring libid3tag Configuring libmad Configuring libmms Configuring libmpcdec Configuring libshout Configuring libvorbisidec Configuring mpd Configuring speex Configuring wavpack Successfully terminated. [~] # [~] # ipkg files mpd Package mpd (0.15.15-2) is installed on root and has the following files: /opt/share/man/man5/mpd.conf.5 /opt/share/doc/mpd/AUTHORS /opt/bin/mpd /opt/share/doc/mpd/mpdconf.example /opt/share/man/man1/mpd.1 /opt/share/doc/mpd/README /opt/share/doc/mpd/COPYING /opt/share/doc/mpd/UPGRADING /opt/share/doc/mpd/NEWS 動作確認のために、コマンドライン版クライアント 'mpc' もインストールする: [~] # ipkg install mpc Installing mpc (0.19-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/mpc_0.19-1_arm.ipk Installing libmpdclient (2.1-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libmpdclient_2.1-1_arm.ipk Configuring libmpdclient Configuring mpc Successfully terminated. [~] # [~] # ipkg files mpc Package mpc (0.19-1) is installed on root and has the following files: /opt/share/doc/mpc/NEWS /opt/share/doc/mpc/AUTHORS /opt/share/doc/mpc/README /opt/share/doc/mpc/mpd-m3u-handler.sh /opt/share/doc/mpc/mpc-completion.bash /opt/bin/mpc /opt/share/doc/mpc/COPYING /opt/share/doc/mpc/mppledit /opt/share/man/man1/mpc.1 /opt/share/doc/mpc/mpd-pls-handler.sh Successfully terminated. [~] # (2011-09-19) /opt/etc/mpd.conf を作成する。(/etc/ 直下におくと QNAP の再起動時に消えるので) 最低限必要な部分 + curl と ID3 v1.x 用の文字コード (手元のファイルは ID3 v1.1=UTF-16, v2.3=UTF-16 なので) を設定した: # cp /opt/share/doc/mpd/mpdconf.example /opt/etc/mpd.conf # (/opt/etc/mpd.conf を編集) # grep -v ^# /opt/etc/mpd.conf | uniq music_directory "/share/Multimedia/music" playlist_directory "/share/Multimedia/music/mpd_playlists" db_file "/share/Multimedia/music/mpd_playlists/database.db" input { plugin "curl" } id3v1_encoding "UTF-16" 動作確認のために mpd を起動する。ついでに データベースも作る: # /opt/bin/mpd --create-db --no-daemon --verbose --stdout /opt/etc/mpd.conf config: loading file /opt/etc/mpd.conf listen: binding to any address listen: binding to socket address [::]:6600 listen: binding to socket address 0.0.0.0:6600 path: path_set_fs_charset: fs charset is: UTF-8 output: No "audio_output" defined in config file output: Attempt to detect audio output device output: Attempting to detect a oss audio device output: Successfully detected a oss audio device avahi: Initializing interface avahi: Failed to create client: Daemon not running avahi: Shutting down interface update: spawned thread for update job id 1 ... database: removing empty directories from DB database: sorting DB database: writing DB ^C avahi: Shutting down interface listen: listen_global_finish called db_finish took 0.020000 seconds # mpd の起動用スクリプトを作成する。 パスは /opt/etc/init.d/S99mpd とする。 内容は NTP (ipkg の ntp パッケージ) に入っていた起動スクリプトを参考にして作成する。 # cp /opt/etc/init.d/S77ntp /opt/etc/init.d/S99mpd # /opt/etc/init.d/S99mpd を修正) /opt/etc/init.d/S99mpd の内容: #!/bin/sh if [ -n "`/opt/bin/pidof mpd`" ]; then /opt/bin/killall mpd 2>/dev/null fi /opt/bin/mpd /opt/etc/mpd.conf スクリプトの動作確認: # /opt/etc/init.d/S99mpd output: No "audio_output" defined in config file output: Attempt to detect audio output device output: Attempting to detect a oss audio device output: Successfully detected a oss audio device # ps aux | grep mpd 5686 admin 7744 S /opt/bin/mpd /opt/etc/mpd.conf 5697 admin 564 R grep mpd # /opt/etc/init.d/S99mpd output: No "audio_output" defined in config file ★mpdが再度起動している output: Attempt to detect audio output device output: Attempting to detect a oss audio device output: Successfully detected a oss audio device # ps aux | grep mpd 5732 admin 8168 S /opt/bin/mpd /opt/etc/mpd.conf ★PIDが変わってるので、mpdが再起動された 5737 admin 568 S grep mpd mpc で動作確認: ★現在の設定値 # mpc volume:100% repeat: off random: off single: off consume: off ★現在の状態 # mpc stats Artists: 222 Albums: 338 Songs: 7752 Play Time: 0 days, 0:00:00 Uptime: 0 days, 0:00:44 DB Updated: Mon Sep 19 21:32:50 2011 DB Play Time: 55 days, 8:13:42 ★playlist 作成〜再生 # mpc ls cd demo etc radio # mpc ls etc etc/8 Bit Weapon & ComputeHer - Chiptopia.mp3 # mpc ls etc | mpc add # mpc play 8 Bit Weapon & ComputeHer - Chiptopia! [playing] #1/1 0:00/3:31 (0%) volume:100% repeat: off random: off single: off consume: off # ★playlistの自動作成。music_directory (mpd.conf) の直下の 'cd' ディレクトリのサブディレクトリ毎にplaylistを作成する。 /opt/local/bin/update_playlist #!/bin/sh for d in `mpc ls cd` do mpc clear mpc add $d mpc save ${d//\//_} done
★作成したplaylistの一覧を表示 # mpc lsplaylists cd_Accordion cd_Trumpet cd_Clarinet cd_Guitar cd_Cello cd_Flute cd_Harmonica cd_Violin cd_Piano cd_Trombone cd_Erhu cd_Sax cd_Organ cd_Vib ★playlistを再生 # mpc clear volume:100% repeat: off random: off single: off consume: off # mpc load cd_Sax loading: cd_Sax # mpc play Brian Bromberg - Dear John [playing] #1/795 0:00/5:00 (0%) volume:100% repeat: off random: off single: off consume: off # (2011-09-20) mpd の自動起動の設定を完了した (#initd_config)。 mpd のWebアプリを探すのが面倒になったので、とりあえず コマンドライン版クライアント mpc の Windows版と、Firefox 用の Music Player Minion を使ってみた。特に問題なさそう。
TS-112: DNS (2011-09-09, 作業中) ## ipkg list | grep ^bind bind - 9.6.1.3-4 - Bind provides a full name server package, including zone masters, slaves, zone transfers, security multiple views. This is THE[編集] TS-112: DHCP (2011-09-09, 作業中) #[~] # ipkg list | grep dhcp dhcp - 4.1-ESV-R2-1 - A DHCP Server DHCPサーバ機能はもともと用意されている。設定は システム管理 -> ネットワーク -> IPアドレス の「編集」→「DHCPサーバー」にある。 よって、ipkg の dhcp パッケージは使わないかも。 [編集]TS-112: mail (2011-09-09, 作業中) ## ipkg list | grep postfix postfix - 2.3.19-1 - The Postfix mail system is an alternative to sendmail. postfix-doc - 2.3.19-1 - The Postfix mail system is an alternative to sendmail. # ipkg list | grep -i pop | grep -vi popular mpop - 1.0.24-1 - mpop is an SMTP client. nail - 11.25-1 - command-line email-client supporting POP3, IMAP, SMTP, ... nginx - 1.0.5-1 - A high perfomance http and reverse proxy server, and IMAP/POP3 proxy server. pop3proxy - 2.0.0-beta8-1 - A pop3 proxy server popt - 1.16-1 - A C library for parsing command line parameters. poptop - 1.2.1-1 - Poptop is the PPTP server solution for Linux. qpopper - 4.0.19-1 - qpopper is a pop3 server sslwrap - 206-1 - sslwrap is a simple Unix service that sits over any simple TCP service such as POP3, IMAP, S MTP, and encrypts all of the data o stgit - 0.15-1 - StGit is a Python application providing similar functionality to Quilt (i.e. pushing/popping patches to/from a stack) on top of xmail - 1.25-4 - A combined easy to configure SMTP, POP3 and Finger server. # ipkg list | grep -i imap | grep -vi popular cyrus-imapd - 2.2.12-15 - The Carnegie Mellon University Cyrus IMAP Server cyrus-imapd-devel - 2.2.12-15 - The Carnegie Mellon University Cyrus IMAP Server cyrus-imapd-doc - 2.2.12-15 - The Carnegie Mellon University Cyrus IMAP Server dovecot - 1.2.0.beta1-2 - Dovecot secure IMAP server imap - 2007a1-1 - University of Washington IMAP package imap-libs - 2007a1-1 - University of Washington IMAP package nail - 11.25-1 - command-line email-client supporting POP3, IMAP, SMTP, ... nginx - 1.0.5-1 - A high perfomance http and reverse proxy server, and IMAP/POP3 proxy server. php-imap - 5.2.17-1 - imap extension for php sslwrap - 206-1 - sslwrap is a simple Unix service that sits over any simple TCP service such as POP3, IMAP, S MTP, and encrypts all of the data o up-imapproxy - 1.2.5-1 - proxies IMAP transactions between an IMAP client and an IMAP server # ipkg list | grep -i procmail procmail - 3.22-4 - Versatile email processor. # ipkg list | grep -i mail abook - 0.5.6-2 - Abook is a text-based addressbook program designed to use with mutt mail client. amavisd-new - 2.4.5-3 - amavisd-new is a high-performance interface between mailer (MTA) and content checkers esmtp - 1.2-1 - esmtp is a user configurable relay-only Mail Transfer Agent (MTA) with a sendmail compatible s yntax. fetchmail - 6.3.20-1 - A remote mail retrieval and forwarding utility libesmtp - 1.0.6-1 - libESMTP is a library to manage posting electronic mail using SMTP to a preconfigured Mai l Transport Agent (MTA). logrotate - 3.7.5-2 - Rotates, compresses, removes and mails system log files. mailman - 2.1.11-1 - the GNU Mailing List Manager. mini-sendmail - 1.3.6-1 - small sendmail-compatible mail forwarder mutt - 1.5.17-1 - text mode mail client nail - 11.25-1 - command-line email-client supporting POP3, IMAP, SMTP, ... perl-email-address - 1.889-1 - RFC 2822 Address Parsing and Creation. perl-email-messageid - 1.401-1 - Generate world unique message-ids. perl-email-mime - 1.863-3 - Easy MIME message parsing. perl-email-mime-contenttype - 1.015-1 - Parse a MIME Content-Type Header. perl-email-mime-encodings - 1.312-1 - A unified interface to MIME encodings and decoding. perl-email-mime-modifier - 1.443-2 - Modify Email::MIME Objects Easily perl-email-send - 2.194-2 - Simply Sending Email. perl-email-simple - 2.005-1 - simple parsing of RFC2822 message format and headers. perl-mail-spf-query - 1.999.1-1 - Mail-SPF-Query - query Sender Policy Framework for an IP,email,helo perl-mailtools - 1.77-1 - MailTools - Base class for manipulation of mail header fields postfix - 2.3.19-1 - The Postfix mail system is an alternative to sendmail. postfix-doc - 2.3.19-1 - The Postfix mail system is an alternative to sendmail. procmail - 3.22-4 - Versatile email processor. putmail - 1.4-1 - Putmail is a very lightweight MTA or SMTP client that may replace the sendmail command when used by MUAs that lack SMTP support py-getmail-common - 4.20.4-1 - getmail is a mail retriever designed to allow you to get your mail from one or more mail accounts on various mail servers to yo py-roundup-common - 1.4.16-1 - An issue-tracking system with command-line, web and e-mail interfaces. py25-getmail - 4.20.4-1 - getmail is a mail retriever designed to allow you to get your mail from one or more mail accounts on various mail servers to yo py25-roundup - 1.4.16-1 - An issue-tracking system with command-line, web and e-mail interfaces. py26-getmail - 4.20.4-1 - getmail is a mail retriever designed to allow you to get your mail from one or more mail accounts on various mail servers to yo py26-roundup - 1.4.16-1 - An issue-tracking system with command-line, web and e-mail interfaces. sendmail - 8.14.2-1 - The most classic SMTP server. spamassassin - 3.1.8-1 - a spam filter for email which can be invoked from mail delivery agents xmail - 1.25-4 - A combined easy to configure SMTP, POP3 and Finger server.[編集] TS-112: NTP (2011-09-11) #パッケージ [~] # ipkg list | grep ntp nget - 0.27.1-4 - nget is a command line nntp file grabber. ntp - 4.2.6.2-2 - A time synchronization daemon ntpclient - 2007_365-1 - Using RFC1305 (NTP), retrieves a remote date and time [~] # [~] # ipkg install ntp Installing ntp (4.2.6.2-2) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ntp_4.2.6.2-2_arm.ipk Configuring ntp Successfully terminated. [~] # [~] # ipkg files ntp Package ntp (4.2.6.2-2) is installed on root and has the following files: /opt/bin/tickadj /opt/bin/ntptime /opt/bin/ntpdc /opt/etc/ntp/ntp.conf ★ /opt/bin/ntpdate /opt/bin/ntpd /opt/bin/ntpq /opt/etc/init.d/S77ntp ★ [~] # cat /opt/etc/init.d/S77ntp #!/bin/sh if [ -n "`/opt/bin/pidof ntpd`" ]; then /opt/bin/killall ntpd 2>/dev/null fi if [ ! -d /var/spool/ntp ] ; then mkdir -p /var/spool/ntp fi /opt/bin/ntpd -c /opt/etc/ntp/ntp.conf -f /var/spool/ntp/ntp.drift -s /var/spool/ntp -k /opt/etc/ntp -l /var/spool/ntp/ntp.log [~] # ログファイル [~] # ls -l /var/spool/ntp/ntp.log -rw-r--r-- 1 admin administ 463 Sep 11 20:37 /var/spool/ntp/ntp.log [~] # 設定ファイルを Mercurial で管理 (/opt/etc を Mercurial で管理する) # cd /opt/etc # hg init # hg add init.d/S77ntp ntp/ntp.conf # hg ci -m "ntp" 時計をおおざっぱに合わせる、ntp.conf にNTPサーバを記載して、ntpdを再起動する、ntpq で動作を確認: # ntpdate -u NTPサーバ # エディタで /opt/etc/ntp/ntp.conf を修正 # /opt/init.d/S77ntp # ntpq -p[編集] TS-112: Wakeup on LAN の magic packet を送信するCGIを設置した (Python を使う場合) #
Python を用いる場合 準備
apache.conf への追加 (/share/webapp 用の設定): <Directory "/share/webapp"> Order allow,deny Allow from all </Directory> ScriptAlias /cgi-bin "/share/webapp/cgi-bin" wol.cgi の内容:
#!/opt/bin/python2.6 # -*- coding: utf-8 -*- ## send magic packet import socket import struct def wake_on_lan(macaddress): """ Switches on remote computers using WOL. """ # Check macaddress format and try to compensate. if len(macaddress) == 12: pass elif len(macaddress) == 12 + 5: sep = macaddress[2] macaddress = macaddress.replace(sep, '') else: raise ValueError('Incorrect MAC address format') # Pad the synchronization stream. data = ''.join(['FFFFFFFFFFFF', macaddress * 20]) send_data = '' # Split up the hex values and pack. for i in range(0, len(data), 2): send_data = ''.join([send_data, struct.pack('B', int(data[i: i + 2], 16))]) # Broadcast it to the LAN. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.sendto(send_data, ('<broadcast>', 7)) # sample: # wake_on_lan('0F:0F:DF:0F:BF:EF') # wake_on_lan('0F-0F-DF-0F-BF-EF') # wake_on_lan('0F0FDF0FBFEF') ## CGI import cgi import cgitb cgitb.enable() def cgi_main(): # send HTTP response headers print "Content-Type: text/html; charset=utf-8\n\n" # get parameters form = cgi.FieldStorage() if "mac" not in form: print '<html>' print '<head>' print '<title>send wol magic packet</title>' print '</head>' print '<body>' print '<form action="/cgi-bin/wol.cgi">' print '<input type="text" name="mac" />' print '<input type="submit" value="send" />' print '<input type="reset" value="reset" />' print '</form>' print '</body>' print '</html>' return mac = form["mac"].value # send wol packet try: wake_on_lan(mac) except ValueError, e: print "<html><body>" print "<h1>ERROR</h1>" print "<p>%s: mac=%s</p>" % (e[0], mac) print "</body></html>" pass else: print "<html><body>" print "<h1>SUCCESS</h1>" print "<p>send wakeup on LAN magic packet: mac=%s</p>" % (mac) print "</body></html>" ## main if __name__ == '__main__': cgi_main()[編集] TS-112: Wakeup on LAN の magic packet を送信するCGIを設置した (/bin/sh と wakelan を使う場合) #(2011-09-03)
IPKG の wakelan パッケージを使う場合の設定。なお、現在はこの設定は使っていない(Python で書いた wol.cgi を使っている) 準備
wol-hoge.cgi の内容: #!/bin/sh MAC=AABBCCDDEEFF /bin/echo -n -e "Content-type: text/plain; charset=iso-8859-1\n\n" /bin/echo "send wakeaup packet: MAC=$MAC" /opt/bin/wakelan $MAC[編集] TS-112: 2.0TB HDD に交換、バックアップ用に外部に 2.0TB HDD を接続 (2011-08-29) #内蔵用のHDD を Seagate ST2000DL003 (SATA3 2TB 5900rpm 64MB) に交換した。 外部HDD も同じく Seagate ST2000DL003 を用意した。接続は eSATAで。こちらは当面は「Q-RAID1」用に使ってみる。 # fdisk -lu /dev/sda Disk /dev/sda: 2000.3 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/sda1 40 1060289 530125 83 Linux /dev/sda2 1060296 2120579 530142 83 Linux /dev/sda3 2120584 3906011969 1951945693 83 Linux /dev/sda4 3906011976 3907007999 498012 83 Linux # fdisk -lu /dev/sdz Disk /dev/sdz: 2000.3 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/sdz1 40 1060289 530125 83 Linux /dev/sdz2 1060296 2120579 530142 83 Linux /dev/sdz3 2120584 3906011969 1951945693 83 Linux /dev/sdz4 3906011976 3907007999 498012 83 Linux PC (NIC は Intel® Gigabit CT Desktop Adapter) -> GbE SW Hub -> TS-112 (HDD = Seagate ST2000DL003 (SATA3 2TB 5900rpm 64MB)): ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 41.971 MB/s Sequential Write : 37.832 MB/s Random Read 512KB : 11.740 MB/s Random Write 512KB : 26.597 MB/s Random Read 4KB (QD=1) : 0.343 MB/s [ 83.8 IOPS] Random Write 4KB (QD=1) : 1.748 MB/s [ 426.7 IOPS] Random Read 4KB (QD=32) : 0.141 MB/s [ 34.5 IOPS] Random Write 4KB (QD=32) : 1.502 MB/s [ 366.8 IOPS] Test : 100 MB [S: 0.7% (12.9/1832.3 GB)] (x5) Date : 2011/09/03 00:32:16 OS : Windows 7 SP1 [6.1 Build 7601] (x64) ----------------------------------------------------------------------- CrystalDiskMark 3.0.1 x64 (C) 2007-2010 hiyohiyo Crystal Dew World : http://crystalmark.info/ ----------------------------------------------------------------------- * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s] Sequential Read : 47.931 MB/s Sequential Write : 39.544 MB/s Random Read 512KB : 12.973 MB/s Random Write 512KB : 27.896 MB/s Random Read 4KB (QD=1) : 0.479 MB/s [ 117.0 IOPS] Random Write 4KB (QD=1) : 1.339 MB/s [ 326.8 IOPS] Random Read 4KB (QD=32) : 0.183 MB/s [ 44.8 IOPS] Random Write 4KB (QD=32) : 1.220 MB/s [ 297.8 IOPS] Test : 100 MB [S: 0.7% (12.9/1832.3 GB)] (x5) Date : 2011/09/04 00:43:45 OS : Windows 7 SP1 [6.1 Build 7601] (x64)[編集] TS-112: UPS (Cyberpower Backup BR 350) を入手して接続 (2011-08-28) #
TS-112: 入手、ファームウェアアップデート 3.5.0 (2011-8-20)、cpuinfo、QPKG、IPKG、Python、Wakeup on LAN #
ssh でつないで、CPUの情報を表示: # cat /proc/cpuinfo Processor : Feroceon 88F6281 rev 1 (v5l) BogoMIPS : 1199.30 Features : swp half thumb fastmult edsp CPU implementer : 0x56 CPU architecture: 5TE CPU variant : 0x2 CPU part : 0x131 CPU revision : 1 Hardware : Feroceon-KW ARM Revision : 0000 Serial : 0000000000000000
Install Optware IPKG - QNAPedia Wakeup on LAN パケットの送信
★ Ubuntu 10.04.3 Server にて $ file `which powerwake` /usr/bin/powerwake: python script text executable
|