CTID 4304 /etc/resolv.conf|hosts 文件權限被客戶誤改,導致無法啓動
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Starting Container ...
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Container is mounted
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Setup slm memory limit
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Setup slm subgroup (default)
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Setting devperms 20002 dev 0x7d00
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Setup ioprio: 4
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Adding port redirection to Container(1): 4643
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Adding IP address(es) to pool:
2010-05-21T10:20:16+0800 vzctl : Container 4304 : Adding IP address(es): 218.30.3.80
2010-05-21T10:20:17+0800 vzctl : Container 4304 : Hostname for Container set: GHL2-CS5-01-03
2010-05-21T10:20:17+0800 vzctl : Container 4304 : mv: cannot move `/etc/hosts.13523' to `/etc/hosts': Operation not permitted
2010-05-21T10:20:17+0800 vzctl : Container 4304 : mv: cannot move `/etc/resolv.conf.13535' to `/etc/resolv.conf': Operation not permitted
2010-05-21T10:20:17+0800 vzctl : Container 4304 : ERROR: Can't change file /etc/resolv.conf
2010-05-21T10:20:17+0800 vzctl : Container 4304 : File resolv.conf was modified
2010-05-21T10:20:18+0800 vzctl : Container 4304 : Container is unmounted
2010-05-21T10:20:18+0800 vzctl : Container 4304 : Container start failed
Files /etc/hosts and /etc/resolv.conf had immutable flag set:
=======================================
[root@XL-VPS-0042 ~]# vzctl mount 4304
Container is mounted
[root@XL-VPS-0042 ~]# lsattr /vz/root/4304/etc/{hosts,resolv.conf}
----i-------- /vz/root/4304/etc/hosts
----i-------- /vz/root/4304/etc/resolv.conf =======================================
Flag was set manually on behalf of system root account:
=======================================
[root@XL-VPS-0042 ~]# grep chattr /vz/root/4304/root/.bash_history chattr +i /etc/hosts chattr +i /etc/resolv.conf chattr -i /etc/hosts chattr +i /etc/hosts =======================================
I have removed this flag from files and it allowed me to start container:
=======================================
[root@XL-VPS-0042 ~]# chattr -i /vz/root/4304/etc/{hosts,resolv.conf}
[root@XL-VPS-0042 ~]# vzctl start 4304
Starting Container ...
Container is unmounted
Container is mounted
Setup slm memory limit
Setup slm subgroup (default)
Setting devperms 20002 dev 0x7d00
Setup ioprio: 4
Adding port redirection to Container(1): 4643 Adding IP address(es) to pool:
Adding IP address(es): 218.30.3.44
arpsend: 218.30.3.44 is detected on another computer : 00:26:b9:38:8f:ec vz-net_add WARNING: arpsend -c 1 -w 1 -D -e 218.30.3.44 eth0 FAILED Hostname for Container set: GHL2-CS5-01-03 File resolv.conf was modified Container start in progress...
[root@XL-VPS-0042 ~]# vzlist 4304
CTID NPROC STATUS IP_ADDR HOSTNAME
4304 11 running 218.30.3.44 GHL2-CS5-01-03
=======================================