I compiled coreutils with --sysconfdir=/test/etc instead of default /etc, moved /etc/group to /test/etc/group, and chgrp failed with chgrp: invalid group: $groupname. How can I fix that and make chgrp work with new sysconfdir?
custom sysconfdir for coreutils
compiling;configure;coreutils;chgrp
Recompiling coreutils to look for /etc/group and other files in a different place won't change the fact that most of the system still expects to find those files in the standard places. In your case, you are noticing that the part of libc responsible for looking up groups and other objects in system database, which is nss_files, continues to look for groups in the standard place.If you want to change the location where /etc/group and a lot of other very basic configuration files live, you'll have to recompile libc6 and probably a lot of other things. Almost certainly, many parts of the system (init scripts come to mind) are hardcoded to use /etc, and none of this has been tested so you are likely to find bugs even if you succeed in this ambitious task.