■ 7/1
先月から引き続き、src.rpm から make した httpd バイナリのサイズが大きく
なってしまう状態。rpm に入っている httpd を実行してみて比較しようかと。
httpd の rpm をインストールした。
[root@mygeeto tmp]# rpm -i httpd-2.4.6-31.el7.centos.x86_64.rpm
warning: httpd-2.4.6-31.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature,
key ID f4a80eb5: NOKEY
error: Failed dependencies:
/etc/mime.types is needed by httpd-2.4.6-31.el7.centos.x86_64
httpd-tools = 2.4.6-31.el7.centos is needed by httpd-2.4.6-31.el7.cento
s.x86_64
依存性があって、httpd-tools は rpm で見つかったけど、mime.types はどこから
引っ張ってくるのかわからない。調べてみると、mailcap の rpm に入っている
ことなので、合わせてインストール。rpm コマンドで直接 URL を指定した。
[root@mygeeto tmp]# rpm -i http://ftp.jaist.ac.jp/pub/Linux/CentOS/7/os/x86_64/
Packages/httpd-tools-2.4.6-31.el7.centos.x86_64.rpm
warning: /var/tmp/rpm-tmp.XMnTcd: Header V3 RSA/SHA256 Signature, key ID f4a80e
b5: NOKEY
[root@mygeeto tmp]# rpm -i http://ftp.jaist.ac.jp/pub/Linux/CentOS/7/os/x86_64/
Packages/mailcap-2.1.41-2.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.aulXPN: Header V3 RSA/SHA256 Signature, key ID f4a80e
b5: NOKEY
[root@mygeeto tmp]# rpm -i httpd-2.4.6-31.el7.centos.x86_64.rpm
warning: httpd-2.4.6-31.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature,
key ID f4a80eb5: NOKEY
インストールができた。httpd -V の実行して、ビルド時のオプションなんかを
確認してみた。。
[root@mygeeto tmp]# /usr/sbin/httpd -V
AH00557: httpd: apr_sockaddr_info_get() failed for mygeeto.tatsuyoshi.net
AH00558: httpd: Could not reliably determine the server's fully qualified domai
n name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th
is message
Server version: Apache/2.4.6 (CentOS)
Server built: Mar 12 2015 15:07:19
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf
気になる感じはしない。先月作った httpd バイナリと比較したいので、自前の
httpd を実行した。
[toyota@mygeeto httpd-2.4.6]$ ./httpd -V
Server version: Apache/2.4.6 (CentOS)
Server built: Jul 1 2015 00:23:48
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr/local/apache2"
-D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf
大きな違いは MPM の設定だけのようにみえる。この MPM に関する configure
オプションがどうなっているのか、確認した。
[toyota@mygeeto httpd-2.4.6]$ ./configure --help | grep MPM
--enable-mpms-shared=MPM-LIST
Space-separated list of MPM modules to enable for
dynamic loading. MPM-LIST=list | "all"
--enable-cgid CGI scripts. Enabled by default with threaded MPMs
MPMs
--with-mpm=MPM Choose the process model for Apache to use by
default. MPM={event|worker|prefork|winnt} This will
be statically linked as the only available MPM
切れてしまったので、--with-mpm の部分を configure --help で確認すると、
event, worker, prefork, winnt の4つが選べるみたい。
--with-mpm=MPM Choose the process model for Apache to use by
default. MPM={event|worker|prefork|winnt} This will
be statically linked as the only available MPM
unless --enable-mpms-shared is also specified.
そもそも、MPM とは、Multi-Processing Modules の略で、簡単に言うと、接続が
来たときにプロセスを増やすかスレッドを増やすかそんな感じのものみたい。
rpm と同じ prefork にして、make してみた。
[toyota@mygeeto httpd-2.4.6]$ ./configure --with-mpm=prefork
[toyota@mygeeto httpd-2.4.6]$ make clean
[toyota@mygeeto httpd-2.4.6]$ make
[toyota@mygeeto httpd-2.4.6]$ strip httpd
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 564048 Jul 1 22:47 httpd
実際には configure のオプションはたくさん付けたが、長いので省略した。この
結果の httpd バイナリサイズを見ると、少し小さくなったけど、それでも rpm の
httpd バイナリよりもサイズが大きい。この違いは何なんだろう。
■ 7/2
昨日は configure の --with-mpm オプションを変更してみたが、サイズに大きな
変化がなかった。作った2つのバイナリに -l オプションを付けて modules の
確認をしてみた。
[toyota@mygeeto httpd-2.4.6]$ /usr/sbin/httpd -l
Compiled in modules:
core.c
mod_so.c
http_core.c
[toyota@mygeeto httpd-2.4.6]$ ./httpd -l
Compiled in modules:
core.c
mod_so.c
http_core.c
prefork.c
手元で make したバイナリは prefork.c が入っている。どうしたらこの差が出る
のか configure のオプションを確認すると、オプションで --enable-mpms-shared
というものがあった。
--enable-mpms-shared=MPM-LIST
Space-separated list of MPM modules to enable for
dynamic loading. MPM-LIST=list | "all"
rpm の httpd バイナリは、このモジュールが shared になっているのかを確認
した。-M オプションを付けて実行。
[toyota@mygeeto httpd-2.4.6]$ /usr/sbin/httpd -M | grep mpm
mpm_prefork_module (shared)
どこかに rpm の httpd バイナリを作ったときの configure オプションがあるの
じゃないかと探してみたら、httpd.spec ファイルにあった。オプションの確認を
してみる。
[toyota@mygeeto httpd-2.4.6]$ less httpd.spec
~snip~
%configure \
--enable-layout=RPM \
--libdir=%{_libdir} \
--sysconfdir=%{_sysconfdir}/httpd/conf \
--includedir=%{_includedir}/httpd \
--libexecdir=%{_libdir}/httpd/modules \
--datadir=%{contentdir} \
--with-installbuilddir=%{_libdir}/httpd/build \
--enable-mpms-shared=all \
--with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--enable-suexec --with-suexec \
--with-suexec-caller=%{suexec_caller} \
--with-suexec-docroot=%{contentdir} \
--with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \
--with-suexec-bin=%{_sbindir}/suexec \
--with-suexec-uidmin=500 --with-suexec-gidmin=100 \
--enable-pie \
--with-pcre \
--enable-mods-shared=all \
--enable-ssl --with-ssl --enable-socache-dc --enable-bucketeer \
--enable-case-filter --enable-case-filter-in \
--disable-imagemap
~snip~
オプションの --enable-mods-shared=all が付いているため、httpd -l を実行
すると prefork.c が入っていなかったよう。このオプションの有無でのサイズを
比較したいので、2つ作ってみた。
[toyota@mygeeto httpd-2.4.6]$ ./configure --disable-ssl
[toyota@mygeeto httpd-2.4.6]$ make clean
[toyota@mygeeto httpd-2.4.6]$ make
[toyota@mygeeto httpd-2.4.6]$ ./httpd -l
Compiled in modules:
core.c
mod_so.c
http_core.c
event.c
[toyota@mygeeto httpd-2.4.6]$ strip httpd
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 592944 Jul 2 23:31 httpd
[toyota@mygeeto httpd-2.4.6]$ ./configure --enable-mpms-shared=all --disable-ss
l
[toyota@mygeeto httpd-2.4.6]$ make clean
[toyota@mygeeto httpd-2.4.6]$ make
[toyota@mygeeto httpd-2.4.6]$ ./httpd -l
Compiled in modules:
core.c
mod_so.c
http_core.c
[toyota@mygeeto httpd-2.4.6]$ strip httpd
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 543264 Jul 2 23:39 httpd
50KB ぐらい小さくなったが、サイズがまだまだ大きいので、spec ファイルに
なるべく近づけて、やってみた。
[toyota@mygeeto httpd-2.4.6]$ ./configure \
--enable-layout=RPM \
--enable-mpms-shared=all \
--enable-suexec --with-suexec \
--enable-pie \
--with-pcre \
--enable-mods-shared=all \
--enable-socache-dc --enable-bucketeer \
--enable-case-filter --enable-case-filter-in \
--disable-imagemap \
--disable-ssl
~snip~
checking whether to enable mod_socache_dc... checking dependencies
checking for user-provided distcache base... none
checking distcache/dc_client.h usability... no
checking distcache/dc_client.h presence... no
checking for distcache/dc_client.h... no
configure: WARNING: ...No distcache detected
checking whether to enable mod_socache_dc... configure: error: mod_socache_dc h
as been requested but can not be built due to prerequisite failures
distcache をインストールしていないので、エラーが起きる。ここは妥協して
--enable-socache-dc を外して再実行した。
[toyota@mygeeto httpd-2.4.6]$ ./configure \
--enable-layout=RPM \
--enable-mpms-shared=all \
--enable-suexec --with-suexec \
--enable-pie \
--with-pcre \
--enable-mods-shared=all \
--enable-bucketeer \
--enable-case-filter --enable-case-filter-in \
--disable-imagemap \
--disable-ssl
~snip~
[toyota@mygeeto httpd-2.4.6]$ make clean
[toyota@mygeeto httpd-2.4.6]$ make
[toyota@mygeeto httpd-2.4.6]$ ./httpd -l
Compiled in modules:
core.c
mod_so.c
http_core.c
[toyota@mygeeto httpd-2.4.6]$ strip httpd
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 580208 Jul 1 23:41 httpd
先月作った httpd バイナリよりもかえって大きくなった。ldd を実行して比較
してみたりしたが、原因がはっきりしない。objdump なんかで比較しないと駄目
なのかな。今日は時間切れ。
■ 7/3
昨日のうやむやを考えながらお昼ご飯を食べていたら、gcc の -O オプションを
思い出した。さっそく夜やってみることにした。まずは、何もつけないで make
した場合のサイズ。
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 543264 Jul 3 23:01 httpd
gcc を確認すると何もつけていない場合は -O0 と同じ動作らしいので、-O0 は
省略して -O1 を付けて make してみた。サイズは strip 後のもの。
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 440432 Jul 3 22:59 httpd
だいぶ小さくなった。これならもっといけそうな気がする。続けて -O2 を付けて
make してみた。
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 456816 Jul 3 22:55 httpd
-O2 だと -O1 よりもサイズが大きくなってしまった。続けて -O3 を付けて make
してみた。
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 514264 Jul 3 22:50 httpd
かなり大きくなってしまう。gcc のオプションを見てみると、サイズ優先の -Os が
あるので、やってみた。
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 395296 Jul 3 22:45 httpd
かなり小さくなった。rpm の httpd のサイズが小さいのは gcc のオプションで
-O2 あたりが付いているのかな。折角なので、strip 後のサイズを表にしてみた。
オプション | 容量
|
---|
なし | 543264
| -O1 | 440432
| -O2 | 456816
| -O3 | 514264
| -Os | 395296
| |
strip 後のバイナリがどの -O オプションでコンパイルされているのか確認する
方法ってないものなのかな。ここ3日ほど考えていた httpd のサイズについては
合っているかどうかわからないが、解決したので明日バイナリを差し替えてみる。
■ 7/4
rpm でインストールした httpd が起動してから、差し替えたいので実行する。
新しい RedHat というか CentOS では systemctl を使う。
[root@mygeeto tmp]# systemctl start httpd
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journal
ctl -xn' for details.
起動に失敗した。何が悪いのか確認するので、messages を見る。そう言えば、
/var/log の場所も変更しないとな。
[root@mygeeto tmp]# cat /var/log/messages
Jul 4 23:15:55 mygeeto systemd: Starting The Apache HTTP Server...
Jul 4 23:15:55 mygeeto httpd: AH00557: httpd: apr_sockaddr_info_get() failed f
or mygeeto.tatsuyoshi.net
Jul 4 23:15:55 mygeeto httpd: AH00558: httpd: Could not reliably determine the
server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' di
rective globally to suppress this message
Jul 4 23:15:55 mygeeto httpd: httpd (pid 31878) already running
Jul 4 23:15:55 mygeeto kill: kill: cannot find process ""
Jul 4 23:15:55 mygeeto systemd: httpd.service: control process exited, code=ex
ited status=1
Jul 4 23:15:55 mygeeto systemd: Failed to start The Apache HTTP Server.
Jul 4 23:15:55 mygeeto systemd: Unit httpd.service entered failed state.
既に起動していると。インストールしたときに自動起動されたかな。念のため
プロセスを確認してみた。
[root@mygeeto tmp]# pgrep httpd
31878
31879
31880
31881
31882
31883
やっぱり起動している。httpd の spec ファイルを見ると、posttrans で起動を
しているので、やはりインストール後に自動起動されたということか。
[root@mygeeto tmp]# cat /tmp/rpmbuild/SPECS/httpd.spec
~snip~
%posttrans
test -f /etc/sysconfig/httpd-disable-posttrans || \
/bin/systemctl try-restart httpd.service htcacheclean.service >/dev/null 2>&1
|| :
~snip~
手元の PC からブラウザでアクセスしてみたが、応答がなかった。telnet で80番
ポートを突っついてみても応答なし。
ポート番号が変えられている可能性を考えて、httpd の設定ファイルのポート番号を
確認してみた。
[toyota@mygeeto ~]$ grep -i listen /etc/httpd/conf/httpd.conf
# Listen: Allows you to bind Apache to specific IP addresses and/or
# Change this to Listen on specific IP addresses as shown below to
#Listen 12.34.56.78:80
Listen 80
80番で合っている。ssh でオペレーションしているので、接続は問題ない。中から
80番ポートにアクセスして、iptables が悪さをしているのか確認する。
[toyota@mygeeto ~]$ telnet localhost 80
-bash: telnet: command not found
そこから。telnet は net-tools かなんかに入っているかと思ったが、確認して
みると、telnet 単体で rpm があるようなので、root になってインストール。
[root@mygeeto tmp]# rpm -i http://ftp.jaist.ac.jp/pub/Linux/CentOS/7/os/x86_64/
Packages/telnet-0.17-59.el7.x86_64.rpm
warning: /var/tmp/rpm-tmp.8HKkfx: Header V3 RSA/SHA256 Signature, key ID f4a80e
b5: NOKEY
インストールが完了したので telnet を実行してみたら、応答が返ってきた。
httpd としては問題なさそう。
[toyota@mygeeto ~]$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0
Host: localhost
HTTP/1.1 403 Forbidden
Date: Fri, 3 Jul 2015 15:13:44 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Thu, 16 Oct 2014 13:20:58 GMT
ETag: "1321-5058a1e728280"
Accept-Ranges: bytes
Content-Length: 4897
Connection: close
Content-Type: text/html; charset=UTF-8
Connection closed by foreign host.
やっぱり iptables が邪魔しているのかと思い、systemctl コマンドで停止して
みる。
[root@mygeeto tmp]# systemctl stop iptables
Failed to issue method call: Unit iptables.service not loaded.
動いていないと。iptables って何かに変わったことを思い出して調べてみると、
firewalld というものに変わったらしく。設定の確認をしてみた。
[root@mygeeto tmp]# firewall-cmd --list-all
public (default, active)
interfaces: enp3s0
sources:
services: dhcpv6-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[root@mygeeto tmp]# firewall-cmd --get-services
RH-Satellite-6 amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns
ftp high-availability http https imaps ipp ipp-client ipsec kerberos kpasswd l
dap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmp
roxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind samba samba
-client smtp ssh telnet tftp tftp-client transmission-client vnc-server wbem-ht
tps
firewalld を停止しても良いが、http サービスが既にあるのでサービスの追加を
してみた。
[root@mygeeto tmp]# firewall-cmd --add-service=http --zone=public
success
[root@mygeeto tmp]# firewall-cmd --list-all
public (default, active)
interfaces: enp3s0
sources:
services: dhcpv6-client http ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
これでブラウザからアクセスしてみた。無事に表示される。最近はこんな画面が
出てくるもんなんだ。
この firewalld がパフォーマンスに影響が出るなら、停止する予定。目的だった
httpd バイナリの差し替えは時間がなくなったので明日以降に。
■ 7/5
httpd のバイナリ作成。spec ファイルを参考に configure オプションを付けて
行くのだが、これまで BUILD ディレクトリ以下の spec ファイルを見てしまって、
日付が古いのに気が付いた。
[toyota@mygeeto rpmbuild]$ find ./ -name httpd.spec -exec ls -l {} \;
-rw-rw-r-- 1 toyota toyota 38093 Mar 12 23:59 ./SPECS/httpd.spec
-rw-r--r-- 1 toyota toyota 17615 Jul 16 2013 ./BUILD/httpd-2.4.6/httpd.spec
SPECS ディレクトリ下の spec ファイルを参照し、不要な機能もごっそり落として
configure を実行して make を行った。
[toyota@mygeeto httpd-2.4.6]$ ./configure \
> --disable-authn-dbd \
> --disable-authn-dbm \
> --disable-authz-dbd \
> --disable-authz-dbm \
> --disable-authz-ldap \
> --disable-auth-basic \
> --disable-echo \
> --disable-sed \
> --disable-proxy-html \
> --disable-ldap \
> --disable-lua \
> --disable-proxy \
> --disable-proxy-connect \
> --disable-proxy-ftp \
> --disable-proxy-http \
> --disable-proxy-fcgi \
> --disable-proxy-scgi \
> --disable-proxy-fdpass \
> --disable-proxy-wstunnel \
> --disable-proxy-ajp \
> --disable-proxy-balancer \
> --disable-proxy-express \
> --disable-ssl \
> --without-ssl \
> --disable-dav \
> --disable-v4-mapped \
> --disable-imagemap \
> --enable-mpms-shared=all \
> --enable-mods-shared=all \
> --disable-filter \
> --disable-reflector \
> --disable-substitute \
> --disable-sed \
> --disable-charset-lite \
> --disable-suexec \
> --without-suexec \
> --enable-layout=Fedora \
> --enable-cache \
> --enable-disk-cache \
> --enable-pie \
> --prefix=/etc/httpd \
> --exec-prefix=/usr \
> --bindir=/usr/bin \
> --sbindir=/usr/sbin \
> --mandir=/usr/share/man \
> --libdir=/usr/lib64 \
> --sysconfdir=/etc/httpd/conf \
> --includedir=/usr/include/httpd \
> --libexecdir=/usr/lib64/httpd/modules \
> --datadir=/var/www \
> --with-installbuilddir=/usr/lib64/httpd/build \
> --with-apr=/usr \
> --with-apr-util=/usr \
> CFLAGS=-Os
checking for chosen layout... Fedora
checking for working mkdir -p... yes
~snip~
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 529866 Jul 5 21:30 httpd
[toyota@mygeeto httpd-2.4.6]$ strip httpd
[toyota@mygeeto httpd-2.4.6]$ ls -l httpd
-rwxrwxr-x 1 toyota toyota 432240 Jul 5 21:33 httpd
[toyota@mygeeto httpd-2.4.6]$ ./httpd -V
AH00557: httpd: apr_sockaddr_info_get() failed for mygeeto.tatsuyoshi.net
AH00558: httpd: Could not reliably determine the server's fully qualified domai
n name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th
is message
Server version: Apache/2.4.6 (CentOS)
Server built: Jul 5 2015 21:30:30
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/etc/httpd/bin/suexec"
-D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf
SUEXEC_BIN の位置がおかしいが、そもそも suexec は無効にしているので問題
ないかな。root になって、httpd の差し替えをして実行する。
[root@mygeeto /]# systemctl stop httpd
[root@mygeeto /]# mv /usr/sbin/httpd /usr/sbin/httpd_org
[root@mygeeto /]# cp /tmp/rpmbuild/BUILD/httpd-2.4.6/httpd /usr/sbin/
[root@mygeeto /]# ls -l /usr/sbin/httpd*
-rwxr-xr-x 1 root root 432240 Jul 5 21:43 /usr/sbin/httpd
-rwxr-xr-x 1 root root 507008 Mar 13 00:08 /usr/sbin/httpd_org
[root@mygeeto /]# systemctl start httpd
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journal
ctl -xn' for details.
エラーが起きたので、messages の確認をしてみる。というか、本来メッセージに
あるように journalctl コマンドを使うみたいだけど、気にせず。
[root@mygeeto /]# tail -5 /var/log/messages
Jul 5 21:43:56 mygeeto httpd: httpd (pid 31878) already running
Jul 5 21:43:56 mygeeto kill: kill: cannot find process ""
Jul 5 21:43:56 mygeeto systemd: httpd.service: control process exited, code=ex
ited status=1
Jul 5 21:43:56 mygeeto systemd: Failed to start The Apache HTTP Server.
Jul 5 21:43:56 mygeeto systemd: Unit httpd.service entered failed state.
動いているプロセスがあって、起動できなかったみたい。systemctl stop がうまく
動作してないのかな。systemctl stop と apachectl もやってみた。
[root@mygeeto /]# systemctl stop httpd
[root@mygeeto /]# pgrep httpd
31878
31879
31880
31881
31882
31883
32173
32372
32373
32374
[root@mygeeto /]# apachectl stop
[root@mygeeto /]# pgrep httpd
31878
31879
31880
31881
31882
31883
32173
32372
32373
32374
どちらも止まってくれない。最後の手段の kill を使って綺麗に落とすことに。
最近は pkill コマンドがあるから楽だな。
[root@mygeeto /]# pkill httpd
[root@mygeeto /]# pgrep httpd
[root@mygeeto /]# systemctl start httpd
[root@mygeeto /]# pgrep httpd
12995
12996
12997
12998
12999
13000
無事に起動して、手元の PC からブラウザでアクセスすることができた。やっと
形が見えて来たな。次は /var/log を ramfs 配下にしたい。
■ 7/6
/vat/log 以下の書き込みが多いので、ramfs に退避させる。まずは、容量の確認を
してみる。
[root@mygeeto /]# du -s -k var
184640 var
[root@mygeeto /]# du -s -k var/log
38196 var/log
[root@mygeeto var]# head -10 /proc/meminfo
MemTotal: 1939456 kB
MemFree: 188380 kB
MemAvailable: 1540208 kB
Buffers: 57720 kB
Cached: 1458924 kB
SwapCached: 0 kB
Active: 1535960 kB
Inactive: 63568 kB
Active(anon): 165488 kB
Inactive(anon): 17908 kB
/var 以下を全部 ramfs にするには容量が大きすぎる。/var 以下で他に書き込みが
多いのは
/var/tmp
/var/spool/mail
mail は使わないという方針で、/var/log だけ持って行くとしても /var/tmp と
/tmp も ramfs にしたいので悩ましいところ。/tmp を /var/tmp のシンボリック
リンクにして、/var 全体を ramfs にしてあまり動かぬディレクトリは eMMC への
シンボリックリンクにてしまおうかなと。
|--tmp -> /var/tmp
|--var_stable
| |--account
| |--adm
| |--cache
| |--crash
| |--db
| |--empty
| |--games
| |--gopher
| |--kerberos
| |--lib
| |--local
| |--log
| |--nis
| |--opt
| |--preserve
| |--spool
| |--tmp
| |--var
| |--www
| `--yp
`--var (ramfs にする)
|--account -> /var_stable/account
|--adm -> /var_stable/adm
|--cache -> /var_stable/cache
|--crash -> /var_stable/crash
|--db -> /var_stable/db
|--empty -> /var_stable/empty
|--games -> /var_stable/games
|--gopher -> /var_stable/gopher
|--kerberos -> /var_stable/kerberos
|--lib -> /var_stable/lib
|--local -> /var_stable/loval
|--lock -> ../run/lock
|--log
|--mail -> /var_stable/spool/mail
|--nis -> /var_stable/nis
|--opt -> /var_stable/opt
|--preserve -> /var_stable/preserve
|--run -> ../run
|--spool -> /var_stable/spool
|--tmp
|--var -> /var_stable/var
|--www -> /var_stable/www
`--yp -> /var_stable/yp
/run なんてディレクトリもあって、ここはまた別の tmpfs になっているので
そこは移動しないで大丈夫。あとは、暑さへの耐久を調べて、問題なかったら
single mode で /var を ramfs に移行させよう。
■ 7/7
Liva をサーバで使うための UPS を用意しようか少し考えた。Amazon で UPS で
検索してみると、最近は小型で1万円を切った製品まである。リチウムイオンの
バッテリーを搭載しているおかげで小型化しているのかと思ったが、重量が結構
あるので、鉛なのかな。ちょっと調べてみた。
CyberPower CP375 のスペックを見ると、電池の電圧は 12V なので、リチウム
イオンではなさそう。
APC の BE325 は鉛電池のようで、やはりバッテリの電圧は 12V だった。交換用の
バッテリ RBC47 には Pb の文字が見える。
よく考えてみると、市販の UPS を使って Liva を駆動すると、
AC100V → DC12V → AC100V → DC5V
と非常に効率が悪い。特に DC12V から AC100V を作り出す必要が全くないのに。
それを言い出すと、デスクトップ PC でも結局 12V と 5V しか使わないとかにも
なるということだけど。
じゃ、携帯電話なんかに使うモバイルバッテリーを使ったらどうなるか。いくつか
製品を見てみると、リチウムイオンなので、バッテリーとしては 3.7V のものが
多い。5V の USB 端子から充電するものが多いので、こうなる。
AC100V → DC5V → DC3.7V → DC5V
昇圧の際の効率がいかほどのものか、というのとモバイルバッテリー充電中に
給電できるかというところ。ちょっとやってみようかな。
■ 7/8
昨日の続き。もらったモバイルバッテリーがあったので、やってみることに。
使ったのはエレコム製(個人的にエレコム製品は買わない)の DE-M02L-4710 と
いう製品で、これに 5V を流し込むのはミヨシという会社の IPA-20U というもの。
モバイルバッテリーに何を繋ごうか悩んだ。本来なら電池を積んでいない機器を
接続したいところだが、今日は実験なので、いつも使っているスマートフォンを
充電するような形で。
AC100V - IP-20U - DE-M02L-4710 - ZTE T-815
もちろん、それぞれの製品はスペック的に Liva に対応していないので、あくまで
実験という感じで。やってみた結果は駄目で、バッテリーに充電中も、充電が完了
した状態でも、給電してくれない。
2A 以上出力があって充電中も給電してくれる製品、そんなの探すの大変だな。
そもそもあるのかどうかわからないし。
■ 7/9
昨日の続きで、それっぽいモバイルバッテリーを調べてみた。一番面白そうだった
ものが、パナソニックの QE-AL シリーズ。コンセントに直接刺せるし、充電中に
給電もできるし、理想と言えば理想なんだけど1つだけ大きな欠点が。一番容量の
多い QE-AL201 でも出力が 1.8A なので、Liva に使うのは厳しい。内部を開けて、
無線 LAN のユニットを物理的に切り離してなんとかなりそうな気もするが、蓋を
開けるのが既に困難な状態。
他にマクセルの MPC-RAC5000 は 2A 対応だけど、同時充電はできなさそうな記述が
あるのでちょっと微妙。
どちらもモバイルバッテリーから給電するにはボタンを押さないといけないのが
ネックで、UPS として使用するにはできない。チャージポンプだなんだと昇圧を
するための回路があるからそうなってしまうのだろうけど。
コンセント一体型ではない製品で、充電中に給電できるものもいくつかあって、
BUFFALO ではこの機能を「追っかけ充電」と呼ぶみたい。この機能がある製品は
BSMPB0180 と BSMPB0140 の二種類。どちらも 3A 出力対応なので申し分はなく、
給電するためのボタンじゃなくてスライドスイッチなのも良いところ。スイッチを
on にしたとき、モバイルバッテリーからのみという動作になるか確認する必要が
あるけど。Amazon のレビューを見たら、給電中追っかけ充電すると3秒間通電が
停止してしまうと。3秒も止まったら使えないな。
他に同様な機能を持ったエレコムの DE-M01L-5230 と言う製品があるが、どうも
Amazon のレビューを見ると Liva で使えないとかメリットの同時充電ができない
とかなんだかという感じ。どちらにしても、エレコムだから買わないけど。
ソニーでも付属の AC アダプタを使用すれば、という良くわからない縛りだが、
CP-F2LA / CP-F10LA で可能みたい。こちらは 2.1/3.6A 出力だけどボタン付き。
どの製品も、目的の動きをしてくれるかわからないな。ソニーの製品が良さそう
だけど、実験で買うには値段が高すぎる。
■ 7/10
LIVA + BSMPB0140 で UPS にして使うとき、3秒間通電が遮断されるとか情報が
あった。これをコンデンサでカバーできないか考えてみた。最近では大容量の
電気二重層コンデンサが安く売っているので、これを利用できないかと。
5V 2A を最低3秒間、できれば5秒持たせたいので計算をするべく特性を調べて
みると、電気二重層コンデンサは徐々に電圧が下がって行く。さらに、電源を
入れたときに突入電流が流れるため、ダイオードと抵抗が必要になる。
これだと良いダイオードを使ったとしても電圧降下は 0.3V はあるだろうし、
さらに電気二重層コンデンサの特性から徐々に電圧が落ちるので、LIVA の動作に
必要な電圧以下にすぐになってしまいそう。
LIVA が 4.5V ぐらいでも動作してくれるなら、BSMPB0140 を使わなくても電源
スライドスイッチのような電源を on にしっぱなしにできるモバイルバッテリーを
使って、ダイオードを2本の単純な回路ができる。
どっちから給電されているのかわからなくて気持ち悪いし、モバイルバッテリーの
方から給電されていた場合、何度も充電を繰り返したりとおかしな動作になりそう。
単純にリレーを使うと少しすっきりする。
コンデンサはリレー切り替えの時間のために入れたが、よく考えるとコンデンサの
前にダイオードを入れないとコンデンサの意味が無くなってしまうな。すっきりと
しない。自動二輪車の電気レベルしか持ち合わせてないので、頭の中ですぐに回路を
組み立てられない。今は物理的なスイッチではなく、FET を使って組むのがもっと
良い方法だろうけど、半導体になるとお手上げになってしまう。もっと勉強を
しないといけないな。
■ 7/11
Liva をサーバにするべく、定期的な時刻合わせをしようと。ntpd を入れようと
調べていたら CentOS 7 では ntpd じゃなくて chrony というソフトを使うようで
既に入っている。設定は /etc/chrony.conf ということで、中を見てみた。
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# Ignore stratum in source selection.
stratumweight 0
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Enable kernel RTC synchronization.
rtcsync
# In first three updates step the system clock instead of slew
# if the adjustment is larger than 10 seconds.
makestep 10 3
# Allow NTP client access from local network.
#allow 192.168/16
# Listen for commands only on localhost.
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
# Serve time even if not synchronized to any NTP server.
#local stratum 10
keyfile /etc/chrony.keys
# Specify the key used as password for chronyc.
commandkey 1
# Generate command key if missing.
generatecommandkey
# Disable logging of client accesses.
noclientlog
# Send a message to syslog if a clock adjustment is larger than 0.5 seconds.
logchange 0.5
logdir /var/log/chrony
#log measurements statistics tracking
ここで使われる ntp サーバは、引いてみるといくつか出てきて、ラウンドロビン
している。しばらく時間を置いて問い合わせすると、また別の IP アドレスが
出てきて、ここで分散をしているみたい。
[toyota@mygeeto ~]$ nslookup 0.centos.pool.ntp.org
Server: 192.168.3.1
Address: 192.168.3.1#53
Non-authoritative answer:
Name: 0.centos.pool.ntp.org
Address: 122.215.240.52
Name: 0.centos.pool.ntp.org
Address: 157.7.235.92
Name: 0.centos.pool.ntp.org
Address: 157.7.152.213
Name: 0.centos.pool.ntp.org
Address: 129.250.35.251
この chrony が動いているのか確認してみた。動いているみたい。インストール
したときに入れられたのでしょう。
[toyota@mygeeto ~]$ systemctl status chronyd
chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
Active: active (running) since Wed 2015-07-01 18:52:11 JST; 1 weeks 2 days a
go
Process: 24674 ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers
(code=exited, status=0/SUCCESS)
Process: 24671 ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS (code=exited, s
tatus=0/SUCCESS)
Main PID: 24673 (chronyd)
CGroup: /system.slice/chronyd.service
`-24673 /usr/sbin/chronyd -u chrony
ログを確認してみると、IPv6 の接続をしようとしてエラーが出ている。kernel
から動かないようにしたので、想定内と言えば想定内。
Could not open IPv6 NTP socket : Address family not supported by protocol
Could not open IPv6 command socket : Address family not supported by protocol
このエラーを抑制するため、man chronyd を確認して、IPv4 のみの動作にする
-4 オプションを付けて起動するように変更したい。実際に chronyd を起動して
いる chronyd.service というファイルを変更しようとしたら。
[toyota@mygeeto ~]$ cat /usr/lib/systemd/system/chronyd.service
[Unit]
Description=NTP client/server
After=ntpdate.service sntp.service ntpd.service
Conflicts=ntpd.service
[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/chronyd
ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS
ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers
[Install]
WantedBy=multi-user.target
変数 $OPTIONS があるので、このファイルを変更しなくても、どこかでこの変数を
変更してあげれば良い。見た感じ、/etc/sysconfig/chronyd のファイルに書く
感じだけど、ファイルが存在しない。EnvironmentFile の後に - が付いている
ので、無効になっているのかな。ファイルを作って - を削除することに。
[root@mygeeto /]# cd /etc/sysconfig
[root@mygeeto sysconfig]# vi chronyd
[root@mygeeto sysconfig]# cat chronyd
OPTIONS="-4"
[root@mygeeto sysconfig]# vi /usr/lib/systemd/system/chronyd.service
[root@mygeeto sysconfig]# cat /usr/lib/systemd/system/chronyd.service
[Unit]
Description=NTP client/server
After=ntpdate.service sntp.service ntpd.service
Conflicts=ntpd.service
[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/chronyd
ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS
ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers
[Install]
WantedBy=multi-user.target
これで IPv6 が無効になるはずなのでリスタートしたが、daemon-reload を実行
しろということなので、その通りに。
[root@mygeeto /]# systemctl restart chronyd
Warning: Unit file of chronyd.service changed on disk, 'systemctl daemon-reload
' recommended.
[root@mygeeto /]# systemctl daemon-reload
[root@mygeeto /]# systemctl restart chronyd
chronyd の起動状態を確認してみると、ちゃんと -4 オプションが付いていた。
ps コマンドでも確認して問題なさそう。
[toyota@mygeeto ~]$ systemctl status chronyd
chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
Active: active (running) since Sat 2015-07-11 21:41:00 JST; 3min ago
Process: 24792 ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers
(code=exited, status=0/SUCCESS)
Process: 24789 ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS (code=exited, s
tatus=0/SUCCESS)
Main PID: 24791 (chronyd)
CGroup: /system.slice/chronyd.service
`-24791 /usr/sbin/chronyd -u chrony -4
ntp サーバの変更も考えたが、サーバ設置は実家になるので Yahoo BB の ntp
サーバは使えないし、このままでいく。
■ 7/12
「情報産業新聞」という業界新聞のちょっと昔の記事が読みたくて、近所の図書館に
置いていないか、横浜市の図書館のページで検索すると出てこない。雑誌のタブにも
出てこないしこれは横浜市の図書館に無いと言うことなのか、近くの図書館に聞いて
みた。結果は、無いと言うことみたい。そこで色々聞いたので、忘れないように
書いておく。
検索ワードの差異もあるので、神奈川県内公共図書館購入継続雑誌・新聞総合目録と
いうページでも検索してみると良いらしい。やっぱり、結果が出なかった。さらに、
日本の図書館で所蔵しているのか、国立国会図書館サーチでも検索できるとのこと。
検索してみたら、国立国会図書館と産業能率大学図書館でしかないみたい。どっちも
遠いな。
■ 7/13
部屋にテレビ、エアコン、Blu-ray プレイヤ、先月買った電灯と、リモコンが
4つもある。じゃまなので1つにまとめられないかと考えていたけど、操作方法が
それぞれ違うのでまとめるのは無理かと思っていた。ふと、スマートフォンで
操作できないかと思い、まず手元の ZTE T815 に IrDA デバイスがあるか調べて
みた。残念ながらなかった。使えれば布団に入ったままスマートフォンで電灯を
消したりできるのになと思っていたのに。
もう少し調べてみたら、直接操作せずに Bluetooth を使って別の機器を経由して
操作する REX-BTIREX1 というものを見つけた。T815 に Bluetooth 機能は付いて
いるので使えるのはありがたいが、この機器の値段が 7000円とかする。3000円
ぐらいなら考えたけど、ちょっと手が出ないな。
■ 7/14
/var/log を移動するにあたり、logrotate 動作の確認。/etc/logrotate.conf を
確認する。一行目にいきなり man 参照なんてあるな。
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
気になる httpd のログ設定は、/etc/logrotate.d/httod にあって、いくつか
見慣れないオプションが点いていた。
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}
rotate するタイミングって書かれていないので、logrotate.conf の weekly が
そのまま有効になるのかな。それぞれのオプションを。
missingok
ログファイルがなかったとき、エラーメッセージを出さない。
notifempty
ログファイルが空だったときは、rotate させない。
sharedscripts
(ここでは)postrotate スクリプトは、ログ毎ではなく1回だけ実行する。
delaycompress
2回目の rotate で圧縮する。
postrotate~endscript
rotate 後に実行されるスクリプト。
という感じ。man で他のオプションも見てみると、copy / copytruncate という
オプションがあった。
copy
ログファイルをコピーする。元のログファイルは何もしない。
copytruncate
ログファイルをコピーして、元のログファイル truncate(サイズ0に) する。
copytruncate の動作は、
cp -p a.log b.log
cat /dev/null > a.log
という感じなのかな。このオプションの説明で、気になることが書いてあった。
ログの一部が失われてしまうかもしれないと。
Note that there is a very small time slice between copying the file and
truncating it, so some logging data might be lost.
man には copy / copytruncate の使い方が出ていないので、調べてみる。特に
コピー先の場所が変えられるかが知りたい。見てみたら、copy / copytruncate に
オプションは付かず、単純な rotate と同じようにファイル名に日時がついた
ような名前でコピーだけみたい。これじゃ、使わなくて良いかな。roate 後に
実行される postrotate の部分でコピーすれば良いだけだし。
■ 7/15
/var 配下を ramfs にする作業。まずは、通常起動で logrotate 周りの設定を
見直す。chrony, ppp, wpa_supplicant, yum は使っていないので、ログの rotate
する必要はないので、削除。
[root@mygeeto /]# cd /etc/logrotate.d/
[root@mygeeto logrotate.d]# ls
chrony httpd ppp psacct syslog wpa_supplicant yum
[root@mygeeto logrotate.d]# cd /etc
[root@mygeeto etc]# mkdir logrotate.d_bak
[root@mygeeto etc]# mv logrotate.d/ppp logrotate.d_bak/
[root@mygeeto etc]# mv logrotate.d/wpa_supplicant logrotate.d_bak/
[root@mygeeto etc]# mv logrotate.d/yum logrotate.d_bak/
次に、/tmp の tmpfs を解除し、/var を tmpfs にする。/tmp の tmpfs 指定は
systemctl status tmp.mount
と、もともとあった仕組みを使った。systemctl で扱うものは unit と呼ばれる
みたいで、12の種類に分かれている。man systemd をすると、その種類の一覧が
でてきて、その中の Mount units に当たるみたい。設定ファイルについては、
/usr/lib/systemd/system/tmp.mount というファイルに記述されていた。
[toyota@mygeeto ~]$ cat /usr/lib/systemd/system/tmp.mount
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Temporary Directory
Documentation=man:hier(7)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime
# Make 'systemctl enable tmp.mount' work:
[Install]
WantedBy=local-fs.target
この Where をいじれば良いのか、別のファイルで var.mount のようなファイルを
作れば良いのか悩むな。試しに同じディレクトリに var.mount ファイルを作って
みた。
[root@mygeeto /]# cd /usr/lib/systemd/system
[root@mygeeto system]# cp tmp.mount var.mount
[root@mygeeto system]# vi var.mount
[root@mygeeto system]# diff tmp.mount var.mount
18c18
< Where=/tmp
---
> Where=/var2
こんなコピーしただけのもので動くものか。何か他に設定が必要な気もするが、
systemctl で動かしてみる。
[root@mygeeto system]# systemctl status var.mount
var.mount - Temporary Directory
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
Where: /var2
What: tmpfs
Docs: man:hier(7)
http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
Jul 15 21:12:50 mygeeto.tatsuyoshi.net systemd[1]: var.mount's Where setting do
esn't match unit name. Refusing.
ファイル名とマウントポイントが一致してないだとかで、メッセージが出たが、
なんとなく動きそうな感じ。ファイル名を変更して、実行してみた。
[root@mygeeto system]# mv var.mount var2.mount
[root@mygeeto system]# systemctl status var2.mount
var2.mount - Temporary Directory
Loaded: loaded (/usr/lib/systemd/system/var2.mount; disabled)
Active: inactive (dead)
Where: /var2
What: tmpfs
Docs: man:hier(7)
http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
[root@mygeeto system]# systemctl start var2.mount
[root@mygeeto system]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mmcblk0p4 55526788 1590168 51115964 4% /
devtmpfs 962104 0 962104 0% /dev
tmpfs 969728 0 969728 0% /dev/shm
tmpfs 969728 41360 928368 5% /run
tmpfs 969728 0 969728 0% /sys/fs/cgroup
tmpfs 969728 75420 894308 8% /tmp
/dev/mmcblk0p2 495844 93319 376925 20% /boot
/dev/mmcblk0p1 204580 9992 194588 5% /boot/efi
tmpfs 969728 0 969728 0% /var2
うまくできた。mount 後にディレクトリとかシンボリックリンクを作りたいけど
できるかな。続きは明日に。
■ 7/16
昨日の続き。man systemd.mount を実行して、マウント後にコマンドが実行でき
ないか調べてみた。指定できるのは。
What
Where
Type
Options
DirectoryMode
TimeoutSec
という感じで、mount に関するものだけ。mkdir とか ln ぐらい実行ができない
ものかと調べてみるも、できなさそう。これは、after だ before だのを使って
別の unit を作らないといけないのかな。新しい unit を作るにしても、ただただ
実行して daemon にしないような unit はどんな種類にすれば良いのか、あえて
選ぶとすれば path っぽいけどどうだろう。やってみるしかない。今ある path の
unit を確認してみると、service とセットになっている感じ。
[toyota@mygeeto ~]$ cd /usr/lib/systemd/system
[toyota@mygeeto system]$ ls -l *.path
-rw-r--r--. 1 root root 160 Jan 15 2015 brandbot.path
-rw-r--r--. 1 root root 646 Mar 6 14:48 systemd-ask-password-console.path
-rw-r--r--. 1 root root 419 Mar 10 04:44 systemd-ask-password-plymouth.path
-rw-r--r--. 1 root root 574 Mar 6 14:48 systemd-ask-password-wall.path
[toyota@mygeeto system]$ ls -l brandbot.* systemd-ask*
-rw-r--r--. 1 root root 160 Jan 15 2015 brandbot.path
-rw-r--r--. 1 root root 101 Jan 15 2015 brandbot.service
-rw-r--r--. 1 root root 646 Mar 6 14:48 systemd-ask-password-console.path
-rw-r--r--. 1 root root 657 Mar 6 14:48 systemd-ask-password-console.service
-rw-r--r--. 1 root root 419 Mar 10 04:44 systemd-ask-password-plymouth.path
-rw-r--r--. 1 root root 400 Mar 10 04:44 systemd-ask-password-plymouth.service
-rw-r--r--. 1 root root 574 Mar 6 14:48 systemd-ask-password-wall.path
-rw-r--r--. 1 root root 689 Mar 6 14:48 systemd-ask-password-wall.service
.path の中を見ると何か実行をしている様子はない。逆に .service を色々と
見てみると、ntpdate.service とか sshd-keygen.service があるので、daemon
である必要はなさそう。var2.service を作ってみた。
[root@mygeeto /]# cd /usr/lib/systemd/system
[root@mygeeto system]# vi var2.service
[root@mygeeto system]# cat var2.service
[Unit]
Description=Make directory and symboic link for /var
Documentation=man:systemd-tmpfiles(8)
DefaultDependencies=no
ConditionPathIsDirectory=/var2
After=var2.path
#Before=systemd-tmpfiles-setup.service
[Service]
ExecStart=mkdir /var2/log
ExecStart=mkdir /var2/tmp
#ExecStart=ln -s /var2/tmp /tmp
ExecStart=ln -s /run /var2/run
ExecStart=ln -s /run/lock /var2/lock
ExecStart=ln -s /var/account /var2/account
ExecStart=ln -s /var/adm /var2/adm
ExecStart=ln -s /var/cache /var2/cache
ExecStart=ln -s /var/crash /var2/crash
ExecStart=ln -s /var/db /var2/db
ExecStart=ln -s /var/empty /var2/empty
ExecStart=ln -s /var/games /var2/games
ExecStart=ln -s /var/gopher /var2/gopher
ExecStart=ln -s /var/kerberos /var2/kerberos
ExecStart=ln -s /var/lib /var2/lib
ExecStart=ln -s /var/local /var2/local
ExecStart=ln -s /var/nis /var2/nis
ExecStart=ln -s /var/opt /var2/opt
ExecStart=ln -s /var/preserve /var2/preserve
ExecStart=ln -s /var/spool /var2/spool
ExecStart=ln -s /var/var /var2/var
ExecStart=ln -s /var/www /var2/www
ExecStart=ln -s /var/yp /var2/yp
ExecStart=ln -s /var/spool/mail /var2/mail
Type=oneshot
RemainAfterExit=yes
ExecStart は、oneshot の場合は複数指定できるようなので、複数並べてみた。
セミコロンで区切るやり方もあるみたい。man に書いてあった。
When Type is not oneshot, only one command may be given. When Type=oneshot is
used, more than one command may be specified. Multiple command lines may be
concatenated in a single directive, by separating them with semicolons (these
semicolons must be passed as separate words). Alternatively, this directive may
be specified more than once with the same effect. Lone semicolons may be
escaped as "\;". If the empty string is assigned to this option, the list of
commands to start is reset, prior assignments of this option will have no
effect.
実行してみたら、エラーが起きた。行が長かったので、ちょっと省略したが、
Executable path is not absolute のエラーが出ている。
[root@mygeeto system]# systemctl start var2.service
Failed to issue method call: Unit var2.service failed to load: Invalid argument
. See system logs and 'systemctl status var2.service' for details.
[root@mygeeto system]# systemctl status var2.service
var2.service - Make directory and symboic link for /var
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
Executable path is not absolute, ignoring: ln -s /var/account /var2/account
Executable path is not absolute, ignoring: ln -s /var/adm /var2/adm
Executable path is not absolute, ignoring: ln -s /var/cache /var2/cache
Executable path is not absolute, ignoring: ln -s /var/crash /var2/crash
Executable path is not absolute, ignoring: ln -s /var/db /var2/db
Executable path is not absolute, ignoring: ln -s /var/empty /var2/empty
Executable path is not absolute, ignoring: ln -s /var/games /var2/games
Executable path is not absolute, ignoring: ln -s /var/gopher /var2/gopher
Executable path is not absolute, ignoring: ln -s /var/kerberos /var2/kerberos
Executable path is not absolute, ignoring: ln -s /var/lib /var2/lib
Executable path is not absolute, ignoring: ln -s /var/local /var2/local
Executable path is not absolute, ignoring: ln -s /var/nis /var2/nis
実際はもっと長いようで、/var/log/messages を見ると ExecStart すべての行で
エラーが出ている。何が原因かと少し考え、エラーのメッセージをそのまま解釈
して、ln と mkdir に path を付けるようにした。
[root@mygeeto system]# vi var2.service
[root@mygeeto system]# cat var2.service
[Unit]
Description=Make directory and symboic link for /var
Documentation=man:systemd-tmpfiles(8)
DefaultDependencies=no
ConditionPathIsDirectory=/var2
After=var2.path
#Before=systemd-tmpfiles-setup.service
[Service]
ExecStart=/bin/mkdir /var2/log
ExecStart=/bin/mkdir /var2/tmp
#ExecStart=/bin/ln -s /var2/tmp /tmp
ExecStart=/bin/ln -s /run /var2/run
ExecStart=/bin/ln -s /run/lock /var2/lock
ExecStart=/bin/ln -s /var/account /var2/account
ExecStart=/bin/ln -s /var/adm /var2/adm
ExecStart=/bin/ln -s /var/cache /var2/cache
ExecStart=/bin/ln -s /var/crash /var2/crash
ExecStart=/bin/ln -s /var/db /var2/db
ExecStart=/bin/ln -s /var/empty /var2/empty
ExecStart=/bin/ln -s /var/games /var2/games
ExecStart=/bin/ln -s /var/gopher /var2/gopher
ExecStart=/bin/ln -s /var/kerberos /var2/kerberos
ExecStart=/bin/ln -s /var/lib /var2/lib
ExecStart=/bin/ln -s /var/local /var2/local
ExecStart=/bin/ln -s /var/nis /var2/nis
ExecStart=/bin/ln -s /var/opt /var2/opt
ExecStart=/bin/ln -s /var/preserve /var2/preserve
ExecStart=/bin/ln -s /var/spool /var2/spool
ExecStart=/bin/ln -s /var/var /var2/var
ExecStart=/bin/ln -s /var/www /var2/www
ExecStart=/bin/ln -s /var/yp /var2/yp
ExecStart=/bin/ln -s /var/spool/mail /var2/mail
Type=oneshot
RemainAfterExit=yes
[root@mygeeto system]# systemctl start var2.service
[root@mygeeto system]# ls /var2
account crash games lib log opt spool www
adm db gopher local mail preserve tmp yp
cache empty kerberos lock nis run var
ディレクトリとシンボリックができた。シャットダウンするときにログファイルの
コピーをしたいけど、この service でできるのかな。また調べないと。
■ 7/17
昨日の続き。シャットダウンや再起動のときの処理は後回しにして、emergency
モードで起動して、作業開始。と思ったら、今使っている kernel は USB さえ
使えないもので、キーボードが使えなくどうしようもなくなってしまったので、
泣く泣く電源ボタンを押して CentOS についてきた kernel で起動しなおし。
*** Warning -- SELinux targeted policy relabel is required.
*** Relabeling could take a very long time, depending on file
*** system size and speed of hard drives.
[ OK ] Started Security Auditing Service.
Starting Update UTMP about System Reboot/Shutdown...
[ OK ] Started Update UTMP about System Reboot/Shutdown.
なんだか昔の Windows95 のときのチェックディスクみたいに、チェックが走り、
もう一度再起動となって、やっと起動できた。
[root@mygeeto /]# cd /usr/lib/systemd/system
[root@mygeeto system]# systemctl stop tmp.mount
Job for tmp.mount failed. See 'systemctl status tmp.mount' and 'journalctl -xn'
for details.
止まらないな。確認すると busy の状態だったので、無効にするだけしておき、
仮で作った var2.mount と var2.service をリネームして編集、有効に。
[root@mygeeto system]# systemctl disable tmp.mount
[root@mygeeto system]# mv var2.mount var.mount
[root@mygeeto system]# mv var2.service var.service
[root@mygeeto system]# systemctl enable var.mount
ln -s '/usr/lib/systemd/system/var.mount' '/etc/systemd/system/local-fs.target.
wants/var.mount'
[root@mygeeto system]# systemctl enable var.service
The unit files have no [Install] section. They are not meant to be eabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked form another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
[Install] セクションがないと駄目なんだと。他の .service ファイルを参考に
して書き換えてみた。multi-user.target より basic.target の方が早い起動と
思われるし、emergency でも起動して欲しいので basic.target を指定した。
[root@mygeeto system]$ grep -A 3 "Install" httpd.service ntpdate.service firewa
lld.service
httpd.service:[Install]
httpd.service-WantedBy=multi-user.target
--
ntpdate.service:[Install]
ntpdate.service-WantedBy=multi-user.target
--
firewalld.service:[Install]
firewalld.service-WantedBy=basic.target
firewalld.service-Alias=dbus-org.fedoraproject.FirewallD1.service
[root@mygeeto system]# vi var.service
[root@mygeeto system]# cat var.service
[Unit]
Description=Make directory and symboic link for /var
Documentation=man:systemd-tmpfiles(8)
DefaultDependencies=no
ConditionPathIsDirectory=/var
After=var.path
Before=systemd-tmpfiles-setup.service rsyslog.service systemd-journald.service
[Service]
ExecStart=/bin/mkdir -p /var/log
ExecStart=/bin/mkdir -p -m 1777 /var/tmp
ExecStart=/bin/ln -s /var/tmp /tmp
ExecStart=/bin/ln -s /run /var/run
ExecStart=/bin/ln -s /run/lock /var/lock
ExecStart=/bin/ln -s /var_stable/account /var/account
ExecStart=/bin/ln -s /var_stable/adm /var/adm
ExecStart=/bin/ln -s /var_stable/cache /var/cache
ExecStart=/bin/ln -s /var_stable/crash /var/crash
ExecStart=/bin/ln -s /var_stable/db /var/db
ExecStart=/bin/ln -s /var_stable/empty /var/empty
ExecStart=/bin/ln -s /var_stable/games /var/games
ExecStart=/bin/ln -s /var_stable/gopher /var/gopher
ExecStart=/bin/ln -s /var_stable/kerberos /var/kerberos
ExecStart=/bin/ln -s /var_stable/lib /var/lib
ExecStart=/bin/ln -s /var_stable/local /var/local
ExecStart=/bin/ln -s /var_stable/nis /var/nis
ExecStart=/bin/ln -s /var_stable/opt /var/opt
ExecStart=/bin/ln -s /var_stable/preserve /var/preserve
ExecStart=/bin/ln -s /var_stable/spool /var/spool
ExecStart=/bin/ln -s /var_stable/var /var/var
ExecStart=/bin/ln -s /var_stable/www /var/www
ExecStart=/bin/ln -s /var_stable/yp /var/yp
ExecStart=/bin/ln -s /var_stable/spool/mail /var/mail
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=basic.target
実は、systemctl status で見ると、mkdir が既にディレクトリが存在するとかで
エラーを起こしていたので、-p オプションを付けたり、ちょこちょこ変更した。
これで、実行した後、有効にした。
[root@mygeeto system]# systemctl start var.service
[root@mygeeto system]# ls /var
ccount crash games lib log opt spool www
adm db gopher local mail preserve tmp yp
cache empty kerberos lock nis run var
[root@mygeeto system]# systemctl enable var.service
ln -s '/usr/lib/systemd/system/var.service' '/etc/systemd/system/local-fs.target
.wants/var.mount'
これで再起動したら、var.mount は問題ないが、var.service は実行されていない
感じで、ディレクトリとかシンボリックリンクができない。起動のタイミングかな。
もう少し調べてみる。
■ 7/18
Yahoo BB の ADSL 接続状況が良くない。ルータの外との接続ランプがかなりの
頻度で消えるし、繋がってもすぐに切れてしまう。ping で1時間ほど放置して
様子を見てみた。
[toyota@mygeeto ~]$ ping -q -c 3600 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
3600 packets transmitted, 1352 received, 62% packet loss, time 3601637ms
rtt min/avg/max/mdev = 15.383/35.948/5068.819/196.977 ms, pipe 6
62% もロスしている。繋がって、何か調べようとしたら、すぐに切れてしまう
感じのストレスが溜まる状態。1時間ほどして、ちょっとまともになったので、
再度 ping を実行してみた。
[toyota@mygeeto ~]$ ping -q -c 3600 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
3600 packets transmitted, 2924 received, 18% packet loss, time 3604425ms
rtt min/avg/max/mdev = 17.909/30.051/3388.012/92.696 ms, pipe 4
それでも 18% 落としている。ルータが悪いのかな。イライラする。
■ 7/19
昨日からネットワークの調子が悪い状況。昨日寝る前に、ping を8時間分仕掛けて
寝て、朝起きて結果を見てみた。
[toyota@mygeeto ~]$ ping -q -c 28800 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
28800 packets transmitted, 24757 received, 14% packet loss, time 28845689ms
rtt min/avg/max/mdev = 15.575/26.123/4061.187/50.083 ms, pipe 5
夜中は 14% のドロップ。良くはなってきているのか。そんな中、久しぶりに、
Tatsuyoshi 21st Projects というページの更新をした。実に4年ぶり。ページが
できてかもうすぐ15年も経つのも不思議。
その作業中にも裏で ping を8時間ぐらい続けた。今日の昼の ping の結果は。
[toyota@mygeeto ~]$ ping -q -c 28800 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
28800 packets transmitted, 28451 received, 1% packet loss, time 28850669ms
rtt min/avg/max/mdev = 18.398/49.708/4112.458/62.464 ms, pipe 5
1% とだいぶ改善している。ルータというかモデムの問題かとも思っていたが、
違うのかもな。
■ 7/20
昨日の夜から仕掛けた ping の状況を見てみると、ドロップは 1% 未満になって
いた。連休明けたら、Yahoo に連絡しようと思っていたのに。
[toyota@mygeeto ~]$ ping -q -c 28800 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
28800 packets transmitted, 28776 received, 0% packet loss, time 28851465ms
rtt min/avg/max/mdev = 26.979/41.414/1399.943/31.748 ms, pipe 2
障害情報を確認したら、なにやら対策なのかメンテナンスしたとはある。今日の
昼も8時間 ping してみて落とすようだったら明日 Yahoo に苦情だな。
2015年07月20日 02時00分~2015年07月20日 05時00分の間
当社では、より安定したネットワークをご提供させていただくため、設備メンテナンス
を実施させていただきます。
このため、上記時間帯中5分程度、発信(緊急通報〔110番(警察)、118番(海上保安)
、119番(消防)〕含む)および着信ができなくなります。
夕方になって、ping の結果が出た。半分ぐらいは繋がっていない状態なので、
快適に使えるとは程遠い感じ。
[toyota@mygeeto ~]$ ping -q -c 28800 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
28800 packets transmitted, 14833 received, 48% packet loss, time 28825829ms
rtt min/avg/max/mdev = 23.344/56.318/5060.373/154.424 ms, pipe 6
熱が影響している感じもする。これまでの、Yahoo のモデムの交換状況を確認
してみた。もう5年も経っているので、交換しても良い頃かもしれない。
2006年2月11日 使用開始
2006年8月10日 モデム不具合交換
2007年10月13日 モデム不具合交換
2010年8月21日 モデム不具合交換
2010年8月28日 モデム不具合再交換
祝日も Yahoo BB のサポートはやっているので、電話してみたら自動音声が流れて
途中でカスタマーID が必要とかなんとか。その ID がわからないので、先に進め
ない。昔の郵便物とか探したけど見つからず。連絡は明日に。
■ 7/21
まずは、昨夜の ping の結果から。夜はほとんど落ちていないので、温度的な
ものが影響しているのか。
[toyota@mygeeto ~]$ ping -q -c 28800 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
28800 packets transmitted, 28784 received, 0% packet loss, time 28852636ms
rtt min/avg/max/mdev = 17.174/27.043/283.879/16.683 ms
そして、朝7時半から8時間実行してみた結果は、21% 落としている。やっぱり、
温度が高いと駄目みたい。
[toyota@mygeeto ~]$ ping -q -c 28800 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
28800 packets transmitted, 22575 received, 21% packet loss, time 28841338ms
rtt min/avg/max/mdev = 16.097/33.618/5040.111/78.082 ms, pipe 6
ということで、Yahoo BB のカスタマーサポートに連絡。2,3日で新しいモデムが
到着するとのこと。それまでイライラが続くのか。
■ 7/22
今日は昼暑かったせいか、接続が全くつながらなかったみたい。100% loss して
いた。同じ温度の下、ファンレスの Liva は心配をよそに特に止まることなく
動いている。ちょっと手詰まりな状態なので、色々確認をしているのだが。
[root@mygeeto system]# cd /usr/lib/systemd/system
[root@mygeeto system]# grep -s Mount *
grep: invalid option -- '.'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
と出てしまう。怪しファイル名のファイルがあるのだろうと、確認をしてみると、
-.slice なんてファイルがあった。
[root@mygeeto system]# ls | heas -5
-.slice
NetworkManager-dispatcher.service
NetworkManager-wait-online.service
NetworkManager.service
abrt-ccpp.service
仕方なく、毎回 -- を付けて実行することに。いつも付け忘れて、エラーが出て
しまう。
[root@mygeeto system]# grep -s Mount -- *
dev-hugepages.mount:[Mount]
dev-mqueue.mount:[Mount]
proc-sys-fs-binfmt_misc.mount:[Mount]
sys-fs-fuse-connections.mount:[Mount]
sys-kernel-config.mount:[Mount]
sys-kernel-debug.mount:[Mount]
systemd-backlight@.service:RequiresMountsFor=/var/lib/systemd/backlight
systemd-journald.socket:# Mount and swap units need this. If this socket unit i
s removed by an
systemd-random-seed.service:RequiresMountsFor=/var/lib/systemd/random-seed
systemd-update-utmp-runlevel.service:RequiresMountsFor=/var/log/wtmp
systemd-update-utmp.service:RequiresMountsFor=/var/log/wtmp
tmp.mount:[Mount]
var.mount:[Mount]
この -.slice は Root Slice の関係らしいのだけど、このファイル名は何とか
ならんもんかな。
■ 7/23
今日は涼しいので、Yaho BB モデムのリンクのランプが点いていて、接続して
くれている模様。ping をやってみた。
[toyota@mygeeto ~]$ ping -q -c 20 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=50 time=6738 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=50 time=7168 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=50 time=8527 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=50 time=8395 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=50 time=7395 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=50 time=7336 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=50 time=7460 ms
64 bytes from 8.8.8.8: icmp_seq=11 ttl=50 time=7586 ms
64 bytes from 8.8.8.8: icmp_seq=12 ttl=50 time=6810 ms
64 bytes from 8.8.8.8: icmp_seq=13 ttl=50 time=6922 ms
64 bytes from 8.8.8.8: icmp_seq=14 ttl=50 time=6596 ms
64 bytes from 8.8.8.8: icmp_seq=15 ttl=50 time=6272 ms
64 bytes from 8.8.8.8: icmp_seq=16 ttl=50 time=6330 ms
64 bytes from 8.8.8.8: icmp_seq=17 ttl=50 time=5845 ms
64 bytes from 8.8.8.8: icmp_seq=18 ttl=50 time=6288 ms
64 bytes from 8.8.8.8: icmp_seq=19 ttl=50 time=5977 ms
64 bytes from 8.8.8.8: icmp_seq=20 ttl=50 time=5865 ms
--- 8.8.8.8 ping statistics ---
20 packets transmitted, 17 received, 15% packet loss, time 19012ms
rtt min/avg/max/mdev = 5845.466/6912.922/8527.412/783.226 ms, pipe 9
ダイヤルアップよりも遅いような感じ。www で繋がっても遅すぎてタイムアウト
してしまうし。早く新しいのは来ないものか。
■ 7/24
ファイルをチェックしていたら、パーミッション表示の後に . (ドット)が付いて
いるファイルがあるのを見つけた。
[root@mygeeto system]# ls -l tmp.mount var.mount
-rw-r--r--. 1 root root 669 Mar 6 14:48 tmp.mount
-rw-r--r-- 1 root root 669 Jul 17 21:59 var.mount
全てのls -l の結果を見てみると、自分で作ったファイルには . が付いてなく、
インストール時に入ったファイルには付いている感じ。怪しい接続の中、調べて
みた。
これは selinux の security context が設定されているものだとか。これが何か
影響している感じはしないので、また必要になったときに調べる。
■ 7/25
Yahoo BB から2,3日で届く筈のモデムは、4日経っても届かないが、同じときに
Yahoo BB のカスタマー ID がわからないから送ってくれと言っていた封書がやっと
届いた。大きく「インターネットご利用開始のご案内」と書かれていたので、
何かの詐欺かなんかかと思ってしまった。
工事予定日が2005年12月28日とか、10年も前だし。これでやっとカスタマー ID が
わかった。
■ 7/26
10日の続きで、なんとなく無停電電源。バッテリーは別の充電器を使えば少し
すっきりするかと考えてみた。
AC アダプタの 12V は仮で 9V でも 15V でも特に気にしない。電池は最初充電
しておき、3か月ぐらいおきに停電が起き無さそうな時間を選んで再充電する感じ。
これを実現するための回路と部品を考えてみる。FET での切り替えは後回しに
して、5V に変換するためのレギュレータを探す。リチウムイオン電池の2セル
だと、電圧が 7.4V とか 7.2V になる。5V にするには、電圧差が 2V ぐらいしか
ないので、低ドロップのものを探さないといけない。さらに 3A ぐらい流せる
ものとなると、選べるほどない。秋月電子のページを見てみたら、LT1764A と
いうレギュレータが使えそう。1つ800円もするけど。あとは、切り替え回路だな。
FET の使い方を勉強中。
■ 7/27
21日に Yahoo BB に電話して、2,3日で届く筈のモデムが届かない。仕方なく、
Yahoo BB に苦情の電話。何やら手配されていなかったらしく。今から手配し、
明日に手続きが完了になり、明日必ず発送します、とのこと。いやいやいや、
本来は先週手続きが済んでいる筈のことで、それが明日完了しますというのは
おかしいでしょ、まだ今日は時間があるのだから今日発送にすべきでしょう、
それをやらないのは何でなの?と。そう言うと、しばらくお待ちくださいとなり、
30秒後に今日発送となった。言えば今日、言わなければ明日というのも何だか
おかしな対応だし、その前に迷惑掛けているというのをきちんと理解して欲しい
ものなんだけど。
■ 7/28
一昨日の続き。秋月の LT1764A は800円とちょっと値段が高いので、何か別な
石がないか探していたら Amazon なんかに LM2596S を使ったモジュールが安く
売っている。
http://amazon.jp/dp/B00HK7UZGU/ 250円
http://amazon.jp/dp/B008RI4RV0/ 370円
http://amazon.jp/dp/B008RE82WY/ 470円
http://amazon.jp/dp/B009ZCEHA8/ 490円
この辺りは、AC アダプタに入っているものを部品として売っているものっぽい
気がする。LM2596S は 3A まで流せるし、単体でも150円で買える便利そうな石。
このモジュールを使えば少し安くできるな。18650 辺りのリチウムイオン電池
2本、電池ケース、18650 用の充電器、5V 変換で合わせて2000円ぐらいかな。
あとは、切り替え用の回路を考えないと。
■ 7/29
昨日の続き。LM2596S のスペックが気になったので、データシートを見てみた。
3A 流すには、Dropout Voltage が 1.4V 必要になるので、リチウムイオン電池の
2セル 7.2V でも 5V を出してくれそう。3A 流すとそこそこ発熱するっぽいから
放熱器なしでどこまで使えるかが気になるところ。Amazon の商品を見てみると
もう少し電流に余裕があるものはあるが、入出力の電圧差が 4V 必要だったりと
良い感じのものが無さそう。無停電のためのもので、止まってしまうのは元も子も
なくなってしまうから、もう少し探してみようかな。
■ 7/30
Yahoo BB の ADSL モデムを新しくしたが、やっぱり途切れることがある。前ほど
じゃないけど、1時間に1回ぐらい切れてしまう。少し気になるので、Yahoo BB の
カスタマーに電話してみた。何やら「調整」をするらしく、それに24時間掛かる
とのことで、明日の今ぐらいの時間にモデムを再起動してください、と。調整が
何なのか的を射た答えはもらえなかったが、明日まで様子を見ることに。
■ 7/31
昨日の続き。24時間経っても、やっぱり切れることがある。仕方なく Yahoo BB に
電話してみたら、NTT 営業所の方で調整してもらうとのことで。さらに5営業日
かかることになった。また1週間待たなければいけないのか。不調になってから
直るまで3週間とかかかりそうだな。
|