カテゴリー別アーカイブ: linux

read only bind mount

bind mount を -o ro を使って read only で mount しようとして、read only にできない。read only にするには、-o remount, ro と、remount 時に ro に設定すればよい。

bind mount を使えば、directory を 別の場所にマウントできる。例えば、以下は /tmp を /mnt にマウントしている

# mount –bind /tmp /mnt
# mount

/tmp on /mnt type none (rw,bind)

read only で mount しよとすると -o ro をつけて以下の様に mount すればよいはずだが、実際は 、mount の見た目は ro にもかかわらず、rw になってしまう。

# mount –bind -o ro /tmp/ /mnt/
# mount

/tmp on /mnt type none (ro,bind)
# touch  /mnt/au

read only にするために、remount を使う。remount 時に ro にするとなぜか read only にすることができる。

# mount -o remount,ro /mnt/
# touch  /mnt/au
touch: cannot touch `/mnt/au’: 読み込み専用ファイルシステムです

参考:

debian で cert の update 方法

cert を追加するには 「dpkg-reconfigure ca-certificates」

curl を使って https://twitter.com/ を取得したら certificate が信用ならんとエラーがでた

$ curl https://twitter.com/
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

どうも、認証機関が追加されてないようだ。以下のようにして、再構成して追加すればよい。

sudo dpkg-reconfigure ca-certificates

参考文献

コンテナ内でapacheの起動

コンテナ内でapacheを起動して、”libgcc_s.so.1 must be installed for pthread_cancel to work” というエラーが error.log に出ていたら、”LoadFile /lib/libgcc_s.so.1"を設定ファイルに追記すれば回避出来る。

chroot 環境やコンテナ内で、apacheを起動すると error.log に 以下の様なメッセージが出て動作しない。

“libgcc_s.so.1 must be installed for pthread_cancel to work”

この場合、apache.conf に以下の行を追加することで回避出来る。

LoadFile /lib/libgcc_s.so.1

参考: http://www.modsecurity.org/documentation/modsecurity-apache/1.9.3/html-multipage/06-special_features.html