Skip to contentSkip to conversation

New: systemctl preset-all failed for ctrl-alt-del.target

Buildroot bugzilla at busybox.net 1 participant 4 messages Mar 31, 2020 – Apr 11, 2020

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=12726

Bug ID: 12726
Summary: systemctl preset-all failed for ctrl-alt-del.target
Product: buildroot
Version: 2020.02
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: melanie at trash-mail.com
CC: buildroot at uclibc.org
Target Milestone: ---

Created attachment 8421
--> https://bugs.busybox.net/attachment.cgi?id=8421&action=edit
Console log output

When finalizing target directory, buildroot executes the 'systemctl preset-all' command to preset (enable/disable) all systemd unit files.
This command runs successful during a full rebuild (after 'make clean'), however on subsequent partial rebuild attempts it fails with exit code 1 (log output attached).

A very similar issue was reported to the systemd-developers (ref [1]) but closed as 'not-a-bug'.

A possible solution that works for me is to add the '--force' option to the command.

[1] https://github.com/systemd/systemd/issues/12304#issuecomment-483168112

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 12726] systemctl preset-all failed for ctrl-alt-del.target

https://bugs.busybox.net/show_bug.cgi?id=12726

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |yann.morin.1998 at free.fr

--- Comment #1 from Yann E. MORIN <[email protected]> --- M?lanie, All,

Sorry, I could not reproduce the failure with this defconfig, enither on 2020.02, nor on master:

    BR2_arm=y
    BR2_cortex_a7=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_INIT_SYSTEMD=y

This is during a make from scratch:

    $ make
    [...]
    /home/ymorin/dev/buildroot/O/host/bin/systemctl
--root=/home/ymorin/dev/buildroot/O/target preset-all
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/ctrl-alt-del.target ?
/usr/lib/systemd/system/reboot.target.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/getty.target.wants/console-getty.service
? /usr/lib/systemd/system/console-getty.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/boot-complete.target.requires/systemd-boot-check-no-failures.service
? /usr/lib/systemd/system/systemd-boot-check-no-failures.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/dbus-org.freedesktop.resolve1.service
? /usr/lib/systemd/system/systemd-resolved.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/multi-user.target.wants/systemd-resolved.service
? /usr/lib/systemd/system/systemd-resolved.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/multi-user.target.wants/remote-fs.target
? /usr/lib/systemd/system/remote-fs.target.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/sockets.target.wants/systemd-networkd.socket
? /usr/lib/systemd/system/systemd-networkd.socket.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service
? /usr/lib/systemd/system/systemd-time-wait-sync.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/network-pre.target.wants/systemd-network-generator.service
? /usr/lib/systemd/system/systemd-network-generator.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
? /usr/lib/systemd/system/systemd-networkd-wait-online.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/systemd-remount-fs.service.wants/systemd-pstore.service
? /usr/lib/systemd/system/systemd-pstore.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/dbus-org.freedesktop.network1.service
? /usr/lib/systemd/system/systemd-networkd.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/multi-user.target.wants/systemd-networkd.service
? /usr/lib/systemd/system/systemd-networkd.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/dbus-org.freedesktop.timesync1.service
? /usr/lib/systemd/system/systemd-timesyncd.service.
    Created symlink
/home/ymorin/dev/buildroot/O/target/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
? /usr/lib/systemd/system/systemd-timesyncd.service.
    rm -f /home/ymorin/dev/buildroot/O/build/locales.nopurge
    [...]

Then a subsequent make would yield:

    $ make
    [...]
    /home/ymorin/dev/buildroot/O/host/bin/systemctl
--root=/home/ymorin/dev/buildroot/O/target preset-all
    rm -f /home/ymorin/dev/buildroot/O/build/locales.nopurge
    [...]

As you can see, neither the first nor the the second invocation cause any issue.

Care to share a bit more info about your config and your host, please?

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 12726] systemctl preset-all failed for ctrl-alt-del.target

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=12726

Melanie <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Melanie <[email protected]> ---
Okay, during further troubleshooting I realized that the problem was caused by my custom configuration, which modifies the target directory (deletes all preset-configuration-files) after the 'finalizing target directory' phase where the 'systemctl preset-all' command runs (this explains why a full rebuild had succeeded but subsequent partial rebuild attempts have failed).

The fact that the 'systemctl preset-all' command fails when there are no preset-configuration-files at all on the target file system, is a systemd issue, so I'm closing this bug report here as invalid.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 12726] systemctl preset-all failed for ctrl-alt-del.target

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=12726

--- Comment #3 from Yann E. MORIN <[email protected]> ---

Quoted 1 line

the problem was caused by my custom configuration [...] closing this bug report here as invalid.

Thanks for the feedback.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.