diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 4f78e3d065..648d192200 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -15,6 +15,7 @@ #include "hashmap.h" #include "main-func.h" #include "mount-util.h" +#include "nscd-flush.h" #include "pager.h" #include "path-util.h" #include "pretty-print.h" @@ -798,6 +799,9 @@ static int write_files(void) { return r; group_tmp = mfree(group_tmp); + + if (!arg_root && !arg_image) + (void) nscd_flush_cache(STRV_MAKE("group")); } if (gshadow) { r = rename_and_apply_smack_floor_label(gshadow_tmp, gshadow_path); @@ -813,6 +817,9 @@ static int write_files(void) { return r; passwd_tmp = mfree(passwd_tmp); + + if (!arg_root && !arg_image) + (void) nscd_flush_cache(STRV_MAKE("passwd")); } if (shadow) { r = rename_and_apply_smack_floor_label(shadow_tmp, shadow_path);