Momonga Linux のビルド用の環境として、NFS に chroot 環境 を用意したんだけど、NFS が setcap
に対応してない (setcap
が linux だけの機能と考えれば、当たり前か・・・。) ということで、インストールに失敗します。NFS にインストール、というのは、(パフォーマンス的に) 阿呆な考えなので、あまりしないだろうけど、AUFS や nilfs (後述) でも発生します。
NFS を使っている理由は SSD へのダメージが読めないのと、(Momonga を動かしている) VirtualBox の USB 接続が不安定であることと、机の上に置くことになる外付けHDDが邪魔。
[momonga@lunastra httpd]$ mount
192.168.1.8:/mnt/root on / type nfs4 (rw,relatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.0.2.15,local_lock=none,addr=192.168.1.8)
devtmpfs on /dev type devtmpfs (rw,relatime,size=4080496k,nr_inodes=1020124,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
proc on /proc type proc (rw,relatime)
[momonga@lunastra httpd]$ sudo yum install httpd
Loaded plugins: aliases, auto-update-debuginfo, changelog, dellsysid, download-
: order, etckeeper, fastestmirror, filter-data, fs-snapshot, keys,
: langpacks, list-data, local, merge-conf, post-transaction-
: actions, presto, priorities, protectbase, ps, puppetverify,
: refresh-packagekit, remove-with-leaves, rpm-warm-cache, show-
: leaves, tmprepo, tsflags, upgrade-helper, verify, versionlock
Unable to connect to dbus
local-development | 2.9 kB 00:00
local-development-nonfree | 2.9 kB 00:00
trunk | 3.6 kB 00:00
Loading mirror speeds from cached hostfile
* trunk: ftp.kddilabs.jp
Skipping filters plugin, no data
0 packages excluded due to repository protections
Resolving Dependencies
Skipping filters plugin, no data
--> Running transaction check
---> Package httpd.x86_64 0:2.4.16-1m.mo8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
httpd x86_64 2.4.16-1m.mo8 local-development 1.0 M
Transaction Summary
================================================================================
Install 1 Package
Total download size: 1.0 M
Installed size: 3.6 M
Is this ok [y/d/N]: y
Downloading packages:
Loaded plugins: auto-update-debuginfo, dellsysid, etckeeper, fastestmirror, fs-
: snapshot, langpacks, local, post-transaction-actions, presto,
: priorities, protectbase, puppetverify, refresh-packagekit,
: remove-with-leaves, rpm-warm-cache, upgrade-helper, versionlock
Unable to connect to dbus
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
etckeeper: pre transaction commit
Installing : httpd-2.4.16-1m.mo8.x86_64 1/1
Error unpacking rpm package httpd-2.4.16-1m.mo8.x86_64
error: unpacking of archive failed on file /usr/sbin/suexec: cpio: cap_set_file
etckeeper: post transaction commit
Unable to connect to dbus
Verifying : httpd-2.4.16-1m.mo8.x86_64 1/1
Failed:
httpd.x86_64 0:2.4.16-1m.mo8
Complete!
[momonga@lunastra pkgs]$ svn diff httpd/httpd.spec
Index: httpd/httpd.spec
===================================================================
--- httpd/httpd.spec (revision 68789)
+++ httpd/httpd.spec (working copy)
@@ -548,7 +548,7 @@
%{_sbindir}/fcgistarter
%{_sbindir}/apachectl
%{_sbindir}/rotatelogs
-%caps(cap_setuid,cap_setgid+pe) %attr(510,root,%{suexec_caller_user}) %{_sbindir}/suexec
+%attr(6510,root,%{suexec_caller_user}) %{_sbindir}/suexec
%dir %{_libdir}/httpd
%dir %{_libdir}/httpd/modules
[momonga@lunastra pkgs]$ ../tools/OmoiKondara -f httpd
[momonga@lunastra pkgs]$ sudo rpm -ivh ../PKGS/RPMS/httpd-2.4.16-1m.mo8.x86_64.rpm
Preparing... ########################################### [100%]
1:httpd ########################################### [100%]
[momonga@lunastra pkgs]$ ls -l /usr/sbin/suexec
-r-s--s--- 1 root apache 14280 Oct 16 23:53 /usr/sbin/suexec
[momonga@lunastra pkgs]$ getcap /usr/sbin/suexec
Failed to get capabilities of file `/usr/sbin/suexec' (Operation not supported)
一応、こんな感じでインストールは出来るけど、setcap
による設定よりやや緩い権限設定になっちゃっているので、本当は、setcap
できなかったら、fallback 出来るのが理想だとどっかの記事に書いてあった。
ちなみに、実際のファイルシステムは、下に示すように、btrfs です。(もともとは、nilfs でやってたのだが、nilfs も setcap
をサポートしてないことがわかったので、急遽 btrfs に変更したわけだが、結局、NFS の方が問題だったので意味なし。)
linaro@linaro-nano:~/parallella-linux$ mount
(省略)
/dev/sda1 on /mnt type nilfs2 (rw)
/dev/sda2 on /mnt/root type btrfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
httpd のビルドができているのは、tmpfs でビルドしたから。
おまけ。
(特に意味はない)
linaro@linaro-nano:~/parallella-linux$ sudo chmod ug-s /mnt/root/usr/sbin/suexec
linaro@linaro-nano:~/parallella-linux$ sudo ls -l /mnt/root/usr/sbin/suexec
-r-x--x--- 1 root rtkit 14280 Oct 16 14:53 /mnt/root/usr/sbin/suexec
linaro@linaro-nano:~/parallella-linux$ sudo setcap cap_setuid,cap_setgid+pe /mnt/root/usr/sbin/suexec
linaro@linaro-nano:~/parallella-linux$ sudo ls -l /mnt/root/usr/sbin/suexec
-r-x--x--- 1 root rtkit 14280 Oct 16 14:53 /mnt/root/usr/sbin/suexec
linaro@linaro-nano:~/parallella-linux$
[momonga@lunastra pkgs]$ ls -l /usr/sbin/suexec
-r-x--x--- 1 root apache 14280 Oct 16 23:53 /usr/sbin/suexec
[momonga@lunastra pkgs]$ /usr/sbin/suexec
-bash: /usr/sbin/suexec: Permission denied