From 5afdc1e8e66c565bbe2d5c8bb4669351043a3841 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 28 Feb 2014 17:23:38 +0000 Subject: baserock-system-config-sync: Force copy /etc/passwd and /etc/group This change is to ensure the existing users will exist after an upgrade. Otherwise, if there are merge conflicts when upgrading, the users will be lost and the root password will be deactivated. If that happens and the only way to access to the system is through ssh and the system was rebooted after the upgrade (manually or automatically) then the system won't be accessible anymore. This change also means that we can no longer make changes to the base /etc/passwd or /etc/group in the 'fhs-dirs' chunk without adding a manual hook to add the new users/groups when upgrading old systems. In the following link is the email thread where was discussed this issue: http://vlists.pepperfish.net/pipermail/baserock-dev-baserock.org/2014-March/004581.html --- baserock-system-config-sync/baserock-system-config-sync | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/baserock-system-config-sync/baserock-system-config-sync b/baserock-system-config-sync/baserock-system-config-sync index 47da83d..7b7c697 100755 --- a/baserock-system-config-sync/baserock-system-config-sync +++ b/baserock-system-config-sync/baserock-system-config-sync @@ -224,6 +224,14 @@ if [ "$1" = "merge" ]; then merge "$vu_dir" "$v1_dir" "$vu_dir" "$v2_dir" "$vt_dir" merge "$v2_dir" "$v1_dir" "$vu_dir" "$v2_dir" "$vt_dir" + if [ -f "$vu_dir/passwd" ]; then + cp "$vu_dir/passwd" "$vt_dir/passwd" + fi + if [ -f "$vu_dir/group" ]; then + cp "$vu_dir/group" "$vt_dir/group" + fi + + rm -rf "$v2_dir" mv "$vt_dir" "$v2_dir" elif [ "$1" = "sync" ]; then -- cgit v1.2.1