run-postinsts: Set dependency for ldconfig to avoid boot issues

If a package with a postsints script requires ldconfig, the package class adds
a ldconfig postinst fragment to initialize it before. Systemd has its own
ldconfig.service to initialize it and sometimes if both services are running
at the same time in the first boot, the first one will work, but the second
one will fail with the following error:

    ldconfig[141]: /sbin/ldconfig: Renaming of /etc/ld.so.cache~ to /etc/ld.so.cache failed: No such file or directory

This commit adds an ordering dependency between them to make sure that only one
service is running at the same time

https://onedigi.atlassian.net/browse/DEL-8133

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2022-10-20 15:18:09 +02:00
parent 4a97851d4e
commit 30022f556b
1 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,7 @@
# Copyright (C) 2022 Digi International
do_install:append() {
# Add ordering dependency between postinsts and ldconfig service
sed -i -e '/After=/ s/$/ ldconfig.service/' \
${D}${systemd_system_unitdir}/run-postinsts.service
}