Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: Always run ld_config before running any update scripts #1335

Merged
merged 1 commit into from
Feb 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/scripts.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ static void exec_post_update_script(bool reexec, bool block)
free(params[0]);
}

static void run_ldconfig(void)
{
int err;

if (strcmp("/", globals.path_prefix) == 0) {
err = run_command_quiet("/usr/bin/ldconfig", NULL);
} else {
err = run_command_quiet("/bin/chroot", globals.path_prefix, "/usr/bin/ldconfig", NULL);
}

if (err) {
debug("Running ldconfig failed with error code = %d\n", err);
}
}

static void update_triggers(bool block)
{
if (strlen(POST_UPDATE) == 0) {
Expand Down Expand Up @@ -152,6 +167,7 @@ void scripts_run_post_update(bool block)
}
}

run_ldconfig();
update_triggers(block);
}

Expand Down