<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15892</bug_id>
          
          <creation_ts>2025-06-03 11:55:40 +0000</creation_ts>
          <short_desc>systemctl on root user only devices misses /usr/bin/systemd-tty-ask-password-agent</short_desc>
          <delta_ts>2025-06-05 15:42:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>5.0.8</version>
          <rep_platform>All</rep_platform>
          <op_sys>arm64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Steffen Kothe">Steffen.Kothe</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102127</commentid>
    <comment_count>0</comment_count>
    <who name="Steffen Kothe">Steffen.Kothe</who>
    <bug_when>2025-06-03 11:55:40 +0000</bug_when>
    <thetext>We recognized following behaviour on a systemd based custom distribution with root user only (headless).

When systemctl is executed with start, stop or restart, a error message is printed on the console:

&quot;Failed to execute /usr/bin/systemd-tty-ask-password-agent: No such file or directory&quot;

A remarkable note on the configuration of our distribution: 

NO_RECOMMENDATIONS = &quot;1&quot; is set to prevent installation of unnecessary or not needed packages on an embedded linux platform. 

Analysis: 

This flaw was introduced in systemd [1] and backported to systemd-stable version v255 [2]. v255.10 &gt; was introduced with bump to yocto-5.0.6 [3] by
changing systemd version v255.4 to 255.13. 

systemd-extra-utils is declared as RRECOMMENDS, but installs systemd-tty-ask-password-agent and companions.

This error message was always existent but hidden, because the log was never displayed.

Additionally, systemctl gets executed by default with tty_ask_password=true when access to the system bus is requested, which in fact tries to fork off the password-agent.

Since I am insecure on how to fix this reliably, I just have a workaround for now. For me, it looks obvious that the password-agent is not required when only a root user is on the system, but it may make sense to install it due to the way systemctl is implemented. 

[4] indicates that arg_ask_password is set to false when systemctl is using the user context of the bus/services.

It must be considered, that systemd-extra-utils installs tools and helpers, which are not necessarily needed on a specific embedded platform at all.

Suggestions:

- Move password-agent to mandatory packages rather then keeping it in extra-utils, preventing issues with NO_RECOMMENDS. 

Workaround:

systemctl --no-ask-password &lt;start, stop, restart&gt;

The workaround assumes a foundational understanding of systemd, which can not be assumed necessarily.

I would appreciate to contribute a patch after confirmation and clarification of a possible and sustainable solution. 

Links:

[1] https://github.com/systemd/systemd.git 
    - since: v256-919-ga408d44531
    - commit: a408d4453145 (&quot;shared: log error when execve fail&quot;)

[2] https://github.com/systemd/systemd-stable.git
    - contained since: v255.10~9
    - commit: 76fe6ebee84c (&quot;shared: log error when execve fail&quot;)

[3] git://git.openembedded.org/openembedded-core
    - contained since: yocto-5.0.6~66
    - commit: 39eb4070503a (&quot;systemd: stable update 255.4 -&gt; 255.13&quot;)

[4] https://github.com/systemd/systemd-stable/blob/v255-stable/src/systemctl/systemctl.c#L1038</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102152</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2025-06-05 14:51:25 +0000</bug_when>
    <thetext>I believe we actually just merged a fix for this in oe-core a87d523ab24e4ea87d1b19ea3a0c515cc47db1b6:

https://git.openembedded.org/openembedded-core/commit/?id=a87d523ab24e4ea87d1b19ea3a0c515cc47db1b6

If you need this in a stable branch then please test and send a backport of that commit.

If this isn&apos;t the resolution then feel free to reopen this ticket.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102166</commentid>
    <comment_count>2</comment_count>
    <who name="Steffen Kothe">Steffen.Kothe</who>
    <bug_when>2025-06-05 15:42:32 +0000</bug_when>
    <thetext>Confirm fix for scarthgap in:

https://git.openembedded.org/openembedded-core/commit/?h=scarthgap&amp;id=180455ee76a3819933f45ddd6ce9a5610b3ba947

Not yet officially released.

Sorry for bothering you with this!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>