[[Guard]]
#contents


*Apache Error.log [#g6f88e43]
http://sns.kuji-clinic.net/RS_Base/diary/854
 Fatal error: Call to undefined function () in /usr/local/www/apache22/data/OpenPNE3/web/index.php on line 11
*smartdでエラーメッセージを受け取ったときの応急対応・コマンドまとめ [#y75b9039]

Apache Error.log 

 [Sat Sep 01 17:31:52 2012] [info] mod_unique_id: using ip addr 210.255.122.222
 [Sat Sep 01 17:31:53 2012] [info] Init: Seeding PRNG with 144 bytes of entropy
 [Sat Sep 01 17:31:53 2012] [info] Loading certificate & private key of SSL-aware server
 [Sat Sep 01 17:31:53 2012] [debug] ssl_engine_pphrase.c(470): unencrypted RSA private key - pass phrase not required
 [Sat Sep 01 17:31:53 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits)
 [Sat Sep 01 17:31:53 2012] [info] Init: Generating temporary DH parameters (512/1024 bits)
 [Sat Sep 01 17:31:53 2012] [info] Init: Initializing (virtual) servers for SSL
 [Sat Sep 01 17:31:53 2012] [info] Configuring server for SSL protocol
 [Sat Sep 01 17:31:53 2012] [debug] ssl_engine_init.c(465): Creating new SSL context (protocols: SSLv2, SSLv3, TLSv1)
 [Sat Sep 01 17:31:53 2012] [debug] ssl_engine_init.c(664): Configuring permitted SSL ciphers [ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL]
 [Sat Sep 01 17:31:53 2012] [debug] ssl_engine_init.c(420): Configuring TLS extension handling
 [Sat Sep 01 17:31:53 2012] [debug] ssl_engine_init.c(795): Configuring RSA server certificate
 [Sat Sep 01 17:31:53 2012] [info] RSA server certificate enables Server Gated Cryptography (SGC)
 [Sat Sep 01 17:31:53 2012] [debug] ssl_engine_init.c(834): Configuring RSA server private key
 [Sat Sep 01 17:31:53 2012] [info] mod_ssl/2.2.22 compiled against Server: Apache/2.2.22, Library: OpenSSL/1.0.1c
 [Sat Sep 01 17:31:53 2012] [notice] mod_python: Creating 8 session mutexes based on 256 max processes and 0 max threads.
 [Sat Sep 01 17:31:53 2012] [notice] mod_python: using mutex_directory /tmp
 PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20100525/sqlite.so' - Cannot open "/usr/local/lib/php/20100525/sqlite.so" in Unknown on line 0
 PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20100525/fribidi.so' - Cannot open "/usr/local/lib/php/20100525/fribidi.so" in Unknown on line 0
 PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20100525/yaz.so' - Cannot open "/usr/local/lib/php/20100525/yaz.so" in Unknown on line 0
 [Sat Sep 01 17:31:57 2012] [notice] Digest: generating secret for digest authentication ...
 [Sat Sep 01 17:31:57 2012] [notice] Digest: done
 [Sat Sep 01 17:31:57 2012] [info] mod_unique_id: using ip addr 210.255.122.222
 [Sat Sep 01 17:31:58 2012] [info] Init: Seeding PRNG with 144 bytes of entropy
 [Sat Sep 01 17:31:58 2012] [info] Loading certificate & private key of SSL-aware server
 [Sat Sep 01 17:31:58 2012] [debug] ssl_engine_pphrase.c(470): unencrypted RSA private key - pass phrase not required
 [Sat Sep 01 17:31:58 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits)
 [Sat Sep 01 17:31:58 2012] [info] Init: Generating temporary DH parameters (512/1024 bits)
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(253): shmcb_init allocated 512000 bytes of shared memory
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(272): for 511920 bytes (512000 including header), recommending 32 subcaches, 133 indexes each
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(306): shmcb_init_memory choices follow
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(308): subcache_num = 32
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(310): subcache_size = 15992
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(312): subcache_data_offset = 3208
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(314): subcache_data_size = 12784
 [Sat Sep 01 17:31:58 2012] [debug] ssl_scache_shmcb.c(316): index_num = 133
 [Sat Sep 01 17:31:58 2012] [info] Shared memory session cache initialised
 [Sat Sep 01 17:31:58 2012] [info] Init: Initializing (virtual) servers for SSL
 [Sat Sep 01 17:31:58 2012] [info] Configuring server for SSL protocol
 [Sat Sep 01 17:31:58 2012] [debug] ssl_engine_init.c(465): Creating new SSL context (protocols: SSLv2, SSLv3, TLSv1)
 [Sat Sep 01 17:31:58 2012] [debug] ssl_engine_init.c(664): Configuring permitted SSL ciphers [ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL]
 [Sat Sep 01 17:31:58 2012] [debug] ssl_engine_init.c(420): Configuring TLS extension handling
 [Sat Sep 01 17:31:58 2012] [debug] ssl_engine_init.c(795): Configuring RSA server certificate
 [Sat Sep 01 17:31:58 2012] [info] RSA server certificate enables Server Gated Cryptography (SGC)
 [Sat Sep 01 17:31:58 2012] [debug] ssl_engine_init.c(834): Configuring RSA server private key
 [Sat Sep 01 17:31:58 2012] [info] mod_ssl/2.2.22 compiled against Server: Apache/2.2.22, Library: OpenSSL/1.0.1c
 [Sat Sep 01 17:31:58 2012] [notice] Apache/2.2.22 (FreeBSD) mod_python/3.3.1 Python/2.7.3 PHP/5.4.6 SVN/1.7.5 mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 configured -- resuming normal operations
 [Sat Sep 01 17:31:58 2012] [info] Server built: Sep  1 2012 15:54:34
 [Sat Sep 01 17:31:58 2012] [debug] prefork.c(1023): AcceptMutex: flock (default: flock)
 [Sat Sep 01 17:32:41 2012] [info] [client 127.0.0.1] Connection to child 6 established (server k222.kuji-clinic.net:443)
 [Sat Sep 01 17:32:41 2012] [info] Seeding PRNG with 144 bytes of entropy
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_kernel.c(1866): OpenSSL: Handshake: start
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_kernel.c(1874): OpenSSL: Loop: before/accept initialization
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_io.c(1897): OpenSSL: read 11/11 bytes from BIO#8112960b0 [mem: 8112bf000] (BIO dump follows)
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_io.c(1830): +-------------------------------------------------------------------------+
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_io.c(1869): | 0000: 4f 50 54 49 4f 4e 53 20-2a 20 48                 OPTIONS * H      |
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_io.c(1875): +-------------------------------------------------------------------------+
 [Sat Sep 01 17:32:41 2012] [debug] ssl_engine_kernel.c(1903): OpenSSL: Exit: error in SSLv2/v3 read client hello A
 [Sat Sep 01 17:32:41 2012] [info] [client 127.0.0.1] SSL library error 1 in handshake (server k222.kuji-clinic.net:443)
 [Sat Sep 01 17:32:41 2012] [info] SSL Library Error: 336027900 error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol speaking not SSL to HTTPS port!?
 [Sat Sep 01 17:32:41 2012] [info] [client 127.0.0.1] Connection closed to child 6 with abortive shutdown (server k222.kuji-clinic.net:443)
 [Sat Sep 01 17:33:29 2012] [notice] child pid 1432 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:30 2012] [notice] child pid 1435 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:30 2012] [notice] child pid 1434 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:30 2012] [notice] child pid 1433 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:30 2012] [notice] child pid 1430 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:30 2012] [notice] child pid 1419 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:30 2012] [notice] child pid 1418 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:34 2012] [notice] child pid 1421 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:34 2012] [notice] child pid 1420 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:37 2012] [notice] child pid 1459 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:37 2012] [notice] child pid 1417 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:46 2012] [notice] child pid 1461 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:46 2012] [notice] child pid 1458 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:51 2012] [notice] child pid 1463 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:51 2012] [notice] child pid 1460 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:53 2012] [notice] child pid 1465 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:53 2012] [notice] child pid 1464 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:53 2012] [notice] child pid 1462 exit signal Segmentation fault (11)
 [Sat Sep 01 17:33:54 2012] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 4 idle, and 8 total children
 [Sat Sep 01 17:33:54 2012] [notice] child pid 1469 exit signal Segmentation fault (11)
*** # grep -i "smartd" /var/log/messages | tail [#q00a8915]
 Jan 12 11:09:01 guard smartd[596]: Device: /dev/ada0, 96 Currently unreadable (pending) sectors (changed -8)
 Jan 12 11:39:01 guard smartd[596]: Device: /dev/ada0, 96 Currently unreadable (pending) sectors
 Jan 12 12:09:01 guard smartd[596]: Device: /dev/ada0, 96 Currently unreadable (pending) sectors
 Jan 12 12:09:01 guard smartd[596]: Device: /dev/ada0, previous self-test completed with error (read test element)
 Jan 12 12:09:01 guard smartd[596]: Device: /dev/ada0, Self-Test Log error count increased from 1 to 2
 Jan 12 12:39:01 guard smartd[596]: Device: /dev/ada0, 88 Currently unreadable (pending) sectors (changed -8)
 Jan 12 13:09:01 guard smartd[596]: Device: /dev/ada0, 88 Currently unreadable (pending) sectors
 Jan 12 13:39:00 guard smartd[596]: Device: /dev/ada0, 80 Currently unreadable (pending) sectors (changed -8)
 Jan 12 13:39:01 guard smartd[596]: Device: /dev/ada0, Self-Test Log error count increased from 2 to 3
 Jan 12 14:09:00 guard smartd[596]: Device: /dev/ada0, 80 Currently unreadable (pending) sectors

*** # smartctl /dev/ada0 --log=selftest [#pb39d335]
 smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-RELEASE-p4 amd64] (local build)
 Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
 
 === START OF READ SMART DATA SECTION ===
 SMART Self-test log structure revision number 1
 Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
 # 1  Extended offline    Completed: read failure       10%       363         975890088
 # 2  Extended offline    Completed: read failure       10%       362         975884072
 # 3  Extended offline    Completed: read failure       10%       361         975876336
 # 4  Short offline       Completed without error       00%       360         -
 # 5  Extended offline    Completed: read failure       40%       359         577493400
 # 6  Short offline       Completed without error       00%       352         -
 # 7  Short offline       Completed without error       00%       328         -
 # 8  Short offline       Completed without error       00%       311         -
 #

ブロックサイズが 32768 の場合

 b = (int)(975890088 * 512 / 32768) = (int) 15248282 (小数点以下切捨) 


 config.status: WARNING:  'Makefile.in' seems to ignore the --datarootdir setting
 config.status: creating config.h
             .       .
             \`-"'"-'/
              } 6 6 {
             ==. Y ,==
               /^^^\  .
              /     \  )  Ncat: A modern interpretation of classic Netcat
             (  )-(  )/
             -""---""---   /
            /   Ncat    \_/
           (     ____
            \_.=|____E
 Configuration complete.
    (  )   /\   _                 (
     \ |  (  \ ( \.(               )                      _____
   \  \ \  `  `   ) \             (  ___                 / _   \
  (_`    \+   . x  ( .\            \/   \____-----------/ (o)   \_
 - .-               \+  ;          (  O                           \____
 (__                +- .( -'.- <.   \_____________  `              \  /
 (_____            ._._: <_ - <- _- _  VVVVVVV VV V\                \/
   .    /./.+-  . .- /  +--  - .    (--_AAAAAAA__A_/                |
   (__ ' /x  / x _/ (                \______________//_              \_______
  , x / ( '  . / .  /                                  \___'          \     /
     /  /  _/ /    +                                       |           \   /
    '  (__/                                               /              \/
                                                        /                  \
              NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY
 Configuration complete.  Type make (or gmake on some *BSD machines) to compile.

*** # sysctl kern.geom.debugflags=0x10 [#v8eb0d4f]
 kern.geom.debugflags: 0 -> 16

*** # dd if=/dev/zero of=/dev/ada0 bs=32768 count=1 seek=15248282 [#paff7c7c]
 1+0 records in
 1+0 records out
 32768 bytes transferred in 0.000234 secs (140105438 bytes/sec)

*** # sysctl kern.geom.debugflags=0 [#rc7012c8]
 kern.geom.debugflags: 16 -> 0

* portupgrade -rf pcre [#nd96b0e6]
k222 2012/09/01 やっと出来た ( ´▽`)ノ
 portupgrade -rf pcre  
*** # smartctl --test=long /dev/ada0 [#v22d083d]
 smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-RELEASE-p4 amd64] (local build)
 Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
 
 === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
 Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
 Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
 Testing has begun.
 Please wait 62 minutes for test to complete.
 Test will complete after Fri Jan 12 15:35:51 2018
 
 Use smartctl -X to abort test.

 ===>  Cleaning for pulseaudio-0.9.23_2
 --->  Cleaning out obsolete shared libraries
 [Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 668 packages found (-0 +1) . done]
 ** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - net/pecl-yaz (pecl-yaz-1.0.14_1)
        - converters/pecl-fribidi (pecl-fribidi-1.0_1)
        - sysutils/pecl-fileinfo (pecl-fileinfo-1.0.4)
k222#
----

 k222# sh
 # ldd /usr/local/bin/* 2> /dev/null  | fgrep "pcre.so.0" | wc -l
       0
 # find /usr/local/lib -name "*so" -exec ldd '{}' 2> /dev/null ';' | fgrep "pcre.so.0" | wc -l
       0




*2012年2月17日 正規表現ライブラリPCRE(devel/pcre)アップデート - 依存ソフトウェアの更新方法 [#o13fab85]
http://gihyo.jp/admin/clip/01/fdt/201202/17




http://hiro-system.blog.ocn.ne.jp/blog/2010/11/smartd_995c.html

http://www.wizard-limit.net/mt/pc/archives/2011_08.html

2012年2月17日
**smartdでエラーメッセージを受け取ったときの応急対応 [#q2b4c761]
 grep -i "smartd" /var/log/messages | tail

後藤大地
 guard# grep -i "smartd" /var/log/messages | tail
 Jan 11 12:39:00 guard smartd[596]: Device: /dev/ada0, 104 Currently unreadable (pending) sectors
 Jan 11 13:09:00 guard smartd[596]: Device: /dev/ada0, 104 Currently unreadable (pending) sectors
 Jan 11 13:39:00 guard smartd[596]: Device: /dev/ada0, 104 Currently unreadable (pending) sectors

 FreeBSD, PCRE, 正規表現, ライブラリ

**sector errorを修復を試みる。 [#nb685c9b]

 # smartctl /dev/ada0 --log=selftest
 smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-RELEASE-p4 amd64] (local build)
 Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
 
この記事を読むのに必要な時間:およそ 1 分
 === START OF READ SMART DATA SECTION ===
 SMART Self-test log structure revision number 1
 Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
 # 1  Extended offline    Completed: read failure       40%       359         577493400
 # 2  Short offline       Completed without error       00%       352         -
 # 3  Short offline       Completed without error       00%       328         -
 # 4  Short offline       Completed without error       00%       311         -
 # 5  Short offline       Completed without error       00%       304         -
 # 6  Short offline       Completed without error       00%       280         -
 # 7  Short offline       Completed without error       00%       256         -
 # 8  Short offline       Completed without error       00%       232         -
 # 9  Extended offline    Completed without error       00%       213         -
 #10  Short offline       Completed without error       00%       208         -
 #11  Short offline       Completed without error       00%       184         -
 #12  Short offline       Completed without error       00%       160         -
 #13  Short offline       Completed without error       00%       136         -
 #14  Short offline       Completed without error       00%       112         -
 #15  Short offline       Completed without error       00%        88         -
 #16  Short offline       Completed without error       00%        64         -
 #17  Extended offline    Completed without error       00%        45         -
 #18  Short offline       Completed without error       00%        40         -
 guard#


 # fdisk
 ******* Working on device /dev/ada0 *******
 parameters extracted from in-core disklabel are:
 cylinders=969021 heads=16 sectors/track=63 (1008 blks/cyl)
 
 Figures below won't work with BIOS for partitions not in cyl 1
 parameters to be used for BIOS calculations are:
 cylinders=969021 heads=16 sectors/track=63 (1008 blks/cyl)
 
 Media sector size is 512
 Warning: BIOS sector numbering starts with sector 1
 Information from DOS bootblock is:
 The data for partition 1 is:
 sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
     start 64, size 976773103 (476939 Meg), flag 80 (active)
         beg: cyl 0/ head 1/ sector 2;
         end: cyl 1023/ head 255/ sector 63
 The data for partition 2 is:
 <UNUSED>
 The data for partition 3 is:
 <UNUSED>
 The data for partition 4 is:
 <UNUSED>
 

**ports [#web1924d]
* How to upgrade apps/libs depend on libpcre.so.0 [#qd09c960]
portupgrade(8)やportmaster(8)を使って「libpcre.so.0」を「/usr/local/lib/compat/pkg/」に退避させた場合,すでにインストールされているライブラリやアプリケーションはこの古いライブラリを参照し続けることになります。こうしたソフトウェアのライブラリ参照先を新しい「/usr/local/lib/libpcre.so.1」に向けるには,依存しているソフトウェアをすべて再構築する必要があります。
 # disklabel -A /dev/ada0s1
 # /dev/ada0s1:
 type: unknown
 disk:
 label:
 flags:
 bytes/sector: 512
 sectors/track: 63
 tracks/cylinder: 16
 sectors/cylinder: 1008
 cylinders: 969020
 sectors/unit: 976773103
 rpm: 3600
 interleave: 0
 trackskew: 0
 cylinderskew: 0
 headswitch: 0           # milliseconds
 track-to-track seek: 0  # milliseconds
 drivedata: 0
 
 8 partitions:
 #          size     offset    fstype   [fsize bsize bps/cpg]
   a:  968884224          0    4.2BSD        0     0     0
   b:    7888878  968884224      swap
   c:  976773103          0    unused        0     0     # "raw" part, don't edit

portupgrade(8)を使っている場合,次の操作で実施できます。

ということで、bsize が0となってしまう・・・?

**ファイルシステムのブロックサイズを調べるには、次のコマンドを使います。 [#m5fe276c]

 # dumpfs /some/filesystem | grep '^bsize'
ということなので、
 guard# dumpfs /dev/ad4s1 | grep '^bsize'
 bsize   16384   shift   14      mask    0xffffc000

piano2ndだと、gpart list すると、ada0p2がファイル領域のようなので

 root@piano2nd:~ # dumpfs /dev/ada0p2  | grep '^bsize'
 bsize   32768   shift   15      mask    0xffff8000

小さなファイルのstatを見てみて確認

 # stat .screenrc
 114 5056131 -rw-r--r-- 1 root wheel 10102700 54 "Jan 12 10:43:37 2018" "Dec 29 06:40:50 2017" "Dec 29 06:40:58 2017" "Dec 29 06:40:50 2017" 32768 8 0 .screenrc

http://d.hatena.ne.jp/parasporospa/touch/searchdiary?word=*%5Bunix%5D&of=20

によれば、st_blksize ファイルシステム I/O 操作での最適なブロックサイズ は、16384 ここでは、32768と。

**以下の公式からseek箇所を算出。 [#t7d208fe]
http://hiro-system.blog.ocn.ne.jp/blog/2010/11/smartd_995c.html

http://see-take.blogspot.jp/2010/01/hddsmart.html

では、以下の様な公式が掲載されていますが、これはFreeBSDだとそのままでは当てはまりません。

        b = (int)((L-S)*512/B)
        where:
        b = File System block number
        B = File system block size in bytes
        L = LBA of bad sector
        S = Starting sector of partition as shown by fdisk -lu
        and (int) denotes the integer part.
 
 portupgrade -rf pcre
 S = 0、B = 4096、L = 577493400を公式に代入。
 
portmaster(8)を使っている場合には次の操作で同様の効果が得られます。
 b = (int)(1043624 * 512 / 4096) = (int) 130453 (小数点以下切捨)

で、こちらとなります。
        b = (int)((L-S)*512/B)
        where:
        b = File System block number
        B = File system block size in bytes (dumpfs 32768)
        L = LBA of bad sector
        S = Starting sector of partition as shown by fdisk
        and (int) denotes the integer part.
 
 env LOCALBASE=/usr/local portmaster -w -D -G --no-confirm -r pcre
 S = 0、B = 32768、L = 577493400を公式に代入。
 
確認しながら確実に作業したいということであれば,次のように一旦手動で「libpcre.so.0」ファイルを「/usr/local/lib/compat/pkg/」へコピーしてからportmaster(8)を実行すれば良いでしょう。
 b = (int)(577493400 * 512 / 32768) = (int) 9023334.375 (小数点以下切捨) 

となった。該当箇所をddでゼロで埋める。
 
 mkdir -p /usr/local/lib/compat/pkg
 cp /usr/local/lib/libpcre.so.0 /usr/local/lib/compat/pkg/

 guard# dd if=/dev/zero of=/dev/ada0 bs=32768 count=1 seek=9023334
 dd: /dev/ada0: Operation not permitted
と言われるので、ググって
 guard# sysctl kern.geom.debugflags=0x10
 kern.geom.debugflags: 0 -> 16
としてから、
 guard# dd if=/dev/zero of=/dev/ada0 bs=32768 count=1 seek=9023334
 guard# dd if=/dev/zero of=/dev/ada0 bs=32768 count=1 seek=9023334
 1+0 records in
 1+0 records out
 16384 bytes transferred in 0.000281 secs (58286240 bytes/sec)
と、書き換えて、
 guard# sysctl kern.geom.debugflags=0
 kern.geom.debugflags: 16 -> 0
お目に留まればもとへとかえす。
 
 portmaster -D -G --no-confirm -r pcre

システムにインストールされているサードパーティ製アプリケーションやライブラリが「libpcre.so.0」へ依存しているかどうかは,例えば次のようなワンライナーで確認できます。報告される数が0以外であれば,その数だけまだ依存するアプリケーションやライブラリが残っていることになります。その場合,fgrep以降のコマンドをlessなどに置き換えて,依存しているアプリケーションやライブラリを特定して,個別にアップデートを実施します(以下のワンライナーはsh,bash,zshなどsh系の文法を採用しているシェルを想定しています。cshやtcshを使っている場合には一旦shを起動するなどして作業してみてください)。

 # sh
そして、正常にもどったかどうかチェック!
 
 ldd /usr/local/bin/* 2> /dev/null  | fgrep "pcre.so.0" | wc -l
  
 find /usr/local/lib -name "*so" -exec ldd '{}' 2> /dev/null ';' | fgrep "pcre.so.0" | wc -l
 guard# smartctl --test=long /dev/ad4
 smartctl 5.43 2012-06-30 r3573 [FreeBSD 8.1-RELEASE-p13 i386] (local build)
 Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
 
ただし一点上記ワンライナーには注意が必要です。Flashプラグインをインストールしてある場合,この方法ではldd(1)経由でFlashの設定ダイアログが起動してきます。これはldd(1)のバグではなくこのような動作をすることになっているためです。その場合,一旦バイナリを別の場所に移動させるなどして回避してみてください。
 === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
 Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
 Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
 Testing has begun.
 Please wait 40 minutes for test to complete.
 Test will complete after Sat Feb 16 13:59:56 2013
 
「libpcre.so.0」へ依存するアプリケーションやライブラリがひとつもなくなったら,「/usr/local/lib/compat/pkg/libpcre.so.0」を削除しても問題ありません。portupgrade(8)やportmaster(8)を使っている場合「/usr/local/lib/compat/pkg/」に互換性確保のためのライブラリがたまっていきますので,それが嫌な場合には,ここで紹介したような方法で既存のアプリケーションやライブラリが新しいバージョンを使用するようにしてみてください。
 Use smartctl -X to abort test.
 guard#

・・・14時になったので
 guard# smartctl /dev/ad4 --log=selftest
 smartctl 5.43 2012-06-30 r3573 [FreeBSD 8.1-RELEASE-p13 i386] (local build)
 Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
 
 === START OF READ SMART DATA SECTION ===
 SMART Self-test log structure revision number 1
 Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
 # 1  Extended offline    Completed without error       00%     19437         -
 # 2  Extended offline    Completed: read failure       90%     19431         310658987
 # 3  Short offline       Completed: read failure       90%     19427         310658987
 # 4  Short offline       Completed: read failure       90%     19403         310658987
 # 5  Short offline       Completed: read failure       90%     19379         310658987
 # 6  Short offline       Completed: read failure       90%     19355         310658987
 # 7  Short offline       Completed: read failure       90%     19331         310658987
 # 8  Short offline       Completed: read failure       90%     19307         310658987
 # 9  Short offline       Completed: read failure       90%     19283         310658987
 #10  Extended offline    Completed: read failure       90%     19263         310658987
 #11  Short offline       Completed: read failure       90%     19259         310658987
 #12  Short offline       Completed: read failure       90%     19235         310658987
 #13  Short offline       Completed: read failure       90%     19211         310658987
 #14  Short offline       Completed: read failure       90%     19187         310658987
 #15  Short offline       Completed: read failure       90%     19163         310658987
 #16  Short offline       Completed: read failure       90%     19139         310658987
 #17  Short offline       Completed: read failure       90%     19115         310658987
 #18  Extended offline    Completed: read failure       90%     19095         310658987
 #19  Short offline       Completed: read failure       90%     19091         310658987
 #20  Short offline       Completed: read failure       90%     19067         310658987
 #21  Short offline       Completed: read failure       90%     19043         310658987
 20 of 20 failed self-tests are outdated by newer successful extended offline self-test # 1
 
 guard#
うまく、いったっぽい!( ´▽`)ノ


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS