出现问题:

1
2
$ groupadd docker
groupadd: failure while writing changes to /etc/group

查看属性:

1
2
3
4
5
6
7
8
9
$ lsattr /etc/shadow* /etc/gshadow* /etc/group* /etc/gshadow*
----i----------- /etc/shadow
----i----------- /etc/shadow-
---------------- /etc/gshadow
----i----------- /etc/gshadow-
---------------- /etc/group
----i----------- /etc/group-
---------------- /etc/gshadow
----i----------- /etc/gshadow-

解决方式:

1
2
3
4
5
6
7
8
9
chattr -i \
    /etc/group    \
    /etc/group-   \
    /etc/gshadow  \
    /etc/gshadow  \
    /etc/gshadow- \
    /etc/gshadow- \
    /etc/shadow   \
    /etc/shadow-

再次执行 groupadd docker 即可。~