<?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>15142</bug_id>
          
          <creation_ts>2023-06-09 13:46:57 +0000</creation_ts>
          <short_desc>useradd: missing /bin/false with ipk packages</short_desc>
          <delta_ts>2023-07-26 21:19:08 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Louis Rannou">louis.rannou</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>tgamblin</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>95696</commentid>
    <comment_count>0</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-06-09 13:46:57 +0000</bug_when>
    <thetext>When building an image with PACKAGE_CLASSES = &quot;package_ipk&quot;, the useradd command can output a warning because &quot;/bin/false&quot; does not exist.

This happens when the init is systemd

```
NOTE: dbus: Performing useradd with [--root /home/louis/projets/blota/builds/build-memfault/tmp/work/beaglebone_yocto-poky-lin
ux-gnueabi/memfault-image/1.0-r0/rootfs --system --home /var/lib/dbus                              --no-create-home --shell /b
in/false                              --user-group messagebus]
[...]
useradd: Warning: missing or non-executable shell &apos;/bin/false&apos;
```

It seems that for ipks, this useradd command is executed before update-alternatives which creates the symlink &apos;/bin/false&apos;

For rpms, update-alternatives is called before.

Is it possible to force the update-alternatives to be executed first ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95727</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-06-15 14:40:00 +0000</bug_when>
    <thetext>Thanks Louis. Are you willing and able to submit a patch?

https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95741</commentid>
    <comment_count>2</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-06-15 20:56:22 +0000</bug_when>
    <thetext>Hello, unfortunately, I couldn&apos;t find how to maanage the order of those tasks or how to make one depends on the other.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95756</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-06-20 15:14:30 +0000</bug_when>
    <thetext>I&apos;m unconvinced that this is a Medium+ as this is just useradd pointing out that the shell for the new user doesn&apos;t exist _yet_.

I&apos;m curious how this doesn&apos;t happen with rpm, potentially rpm/dnf is hiding the warning, because the useradd is a preinst and the update-alternatives are postinsts, so it&apos;s entirely correct for the useradd fragment (dbus&apos;s preinst) to execute before update-alternatives (buybox postinst).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95759</commentid>
    <comment_count>4</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-06-20 19:58:02 +0000</bug_when>
    <thetext>Maybe I misunderstood something

In the log.do_rootfs in case of packages rpm, it&apos;s installing busybox and running update-alternative commands (as postinstall) around line 880. I think this is were /bin/false should be created.
useradd commands are done far later at line 4575.

In the case of ipks, I see some log about busybox installation first, then the failing useradd occurs, and then the update-alternatives are done.
Note that some useradd are done after.

I am not sure, but it looks like busybox postinstall is done right after its installation in rpms while it&apos;s delayed in ipks.

I hope that helps,
Louis</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95761</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-06-20 21:14:20 +0000</bug_when>
    <thetext>Sure, but they&apos;re both behaving &quot;correctly&quot;: there&apos;s no explicit dependency on busybox from dbus.  rpm and opkg are just installing and configuring in a different order.

Is this causing any actual problems, or is it just a warning that you noticed in the log?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95766</commentid>
    <comment_count>6</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-06-21 06:35:55 +0000</bug_when>
    <thetext>It&apos;s just something I noticed. I thought it revealed a missing dependency but it&apos;s probably fine as it is</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96042</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-26 21:19:08 +0000</bug_when>
    <thetext>Ross and Louis seem to agree that this isn&apos;t a bug.
Re-open if that&apos;s not accurate.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>