<?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>14186</bug_id>
          
          <creation_ts>2021-01-12 08:44:00 +0000</creation_ts>
          <short_desc>/run/lock is missing</short_desc>
          <delta_ts>2021-11-26 16:23:12 +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>3.2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>yoctoproject</reporter>
          <assigned_to>yoctoproject</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yoctoproject</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>88912</commentid>
    <comment_count>0</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-01-12 08:44:00 +0000</bug_when>
    <thetext>[barebox-state](https://git.pengutronix.de/cgit/tools/dt-utils/tree/src/barebox-state.c#n510) likes to create a file in `/var/lock`. `/var/lock` is a symlink to `../run/lock`, but that directory is non-existent.

```
root@some-host:~# ls -lha /var/lock
lrwxrwxrwx    1 root     root          11 Mar  9  2018 /var/lock -&gt; ../run/lock
root@some-host:~# ls -lha /run/lock
ls: /run/lock: No such file or directory
```

I&apos;m pretty sure the base-files recipe should be responsible for creating /run/lock.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88928</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-01-14 15:55:57 +0000</bug_when>
    <thetext>base-files doesn&apos;t create that directory, no.

With sysvinit, populate-volatiles creates that directory on boot.  With systemd, systemd itself does it.

I suspect that by switching to barebox you&apos;ve removed a dependency on populate-volatiles?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88944</commentid>
    <comment_count>2</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-01-14 21:18:07 +0000</bug_when>
    <thetext>thanks for your reply.
AFAIK I don&apos;t use any sysvinit files.
So, there&apos;s something in systemd missing? I can&apos;t find the &quot;populate-volatiles&quot; recipe anywhere. Neither in the poky, nor in the meta-oe repo. Can you give me a hint?

Also, what should I look at to determine if systemd is missing something here?
As a workaround I created a custom tmpfiles configuration, which creates the /run/lock directory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88947</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-01-15 11:59:58 +0000</bug_when>
    <thetext>/run/lock is created by /usr/lib/tmpfiles.d/legacy.conf which is in the main systemd package, so if you&apos;re using systemd then you can&apos;t avoid that.

Are you using systemd?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88948</commentid>
    <comment_count>4</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-01-15 12:08:58 +0000</bug_when>
    <thetext>I&apos;m using systemd for sure. 

My tmpfiles.d does *not* contain a legacy.conf.
However, I think this is because of:

meta-distro/recipes-core/systemd/systemd_%.bbappend
19:RRECOMMENDS_${PN}_remove = &quot;systemd-compat-units&quot;

Could this be the problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88976</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-01-21 15:33:22 +0000</bug_when>
    <thetext>Yes the meta-distro is likely the problem. If you remove it does it fix the problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88983</commentid>
    <comment_count>6</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-01-21 16:05:28 +0000</bug_when>
    <thetext>Interesting enough, it does *not*.

Even with that option disabled, there is no legacy.conf.

I&apos;m using systemd 246.1.

What can I do to examine this further? Could this be a regression somewhere?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89004</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-01-23 01:52:25 +0000</bug_when>
    <thetext>Well, no one else has reported such a problem so it&apos;s most likely something unique to your environment. Can you tell us:
1. what commit is at the top of your poky tree
2. attach the files in your conf directory and explain what you manually added and why,
3. what your build distro is (shouldn&apos;t matter but who knows!) 
4. are you able to start with a new build without sstate and still see the problem?

Sorry to ask so many questions but this seems like an odd bug and as I said, we can&apos;t reproduce it.
../Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89055</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-01-28 15:33:00 +0000</bug_when>
    <thetext>Any update on how to reproduce the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89077</commentid>
    <comment_count>9</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-01-29 07:24:37 +0000</bug_when>
    <thetext>Thanks for your ping.

I have digged into the systemd source code and found this line (https://github.com/systemd/systemd/blob/78dff3f3d72c62357543fe1716da3886cff54a10/tmpfiles.d/meson.build#L14):

    [&apos;legacy.conf&apos;,          &apos;HAVE_SYSV_COMPAT&apos;],

Let&apos;s look, where `HAVE_SYSV_COMPAT` is defined (https://github.com/systemd/systemd/blob/78dff3f3d72c62357543fe1716da3886cff54a10/meson.build#L93-L96)

    sysvinit_path = get_option(&apos;sysvinit-path&apos;)
    sysvrcnd_path = get_option(&apos;sysvrcnd-path&apos;)
    conf.set10(&apos;HAVE_SYSV_COMPAT&apos;, sysvinit_path != &apos;&apos; and sysvrcnd_path != &apos;&apos;,
               description : &apos;SysV init scripts and rcN.d links are supported&apos;)

Now let&apos;s look where `sysvinit-path` and `sysvrcnd-path` is defined in poky:

    rg &apos;(sysvinit|sysvrcnd)-path&apos;
    meta/recipes-core/systemd/systemd_246.6.bb
    172:PACKAGECONFIG[sysvinit] = &quot;-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d&quot;

Now let&apos;s take a look at https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#using-systemd-exclusively

&gt; You can also prevent the SysVinit distribution feature from being automatically enabled as follows:
&gt;
&gt;     DISTRO_FEATURES_BACKFILL_CONSIDERED = &quot;sysvinit&quot;

So this line (which I have in my config) makes that the legacy.conf isn&apos;t enabled.

There&apos;s your way to reproduce it ;)

---

Should I file an upstream issue at dt-utils and let them fix their lock path? Or should I remove that offending line in my config and see what else might be back again?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89142</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-02-04 16:22:35 +0000</bug_when>
    <thetext>Yes, please report upstream and if you can send a patch to oe-core so we have a local fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91967</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-11-11 16:01:27 +0000</bug_when>
    <thetext>Hi, Is there any update on this bug? Are you stuck? Do you expect to have time to work on the bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91986</commentid>
    <comment_count>12</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-11-12 06:18:26 +0000</bug_when>
    <thetext>I&apos;m sorry, I totally forgot this one.

There was a patch submitted to dt-utils (not by me) at https://www.mail-archive.com/oss-tools@pengutronix.de/msg00063.html

Here&apos;s the upstream fix:
https://git.pengutronix.de/cgit/tools/dt-utils/commit/?id=fd48fe4efb40f35b119958495d56b399bec73654</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92074</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-11-25 21:33:27 +0000</bug_when>
    <thetext>Mr CookieSoft! ;-)

Thanks for the update.

If you update dt-utils, you&apos;ll pick up that commit:
$ git tag --contains fd48fe4efb40f35b119958495d56b399bec73654
v2021.03.0

I&apos;ve only skimmed the comments here, with that package updated is there still a problem on master?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92078</commentid>
    <comment_count>14</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-11-26 06:11:48 +0000</bug_when>
    <thetext>On dt-utils master this is fixed.

If I see that correctly, dt-utils aren&apos;t directly supported by poky or oe-embedded. I&apos;ll file an upstream issue in the meta-rauc package so that they update their dependencies ;)

Thank you very much for your time and help!
I concider this as closed, won&apos;t fix or something like that ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92079</commentid>
    <comment_count>15</comment_count>
    <who name="">yoctoproject</who>
    <bug_when>2021-11-26 06:18:27 +0000</bug_when>
    <thetext>For reference, I created https://github.com/rauc/meta-rauc/pull/209</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92080</commentid>
    <comment_count>16</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-11-26 16:23:12 +0000</bug_when>
    <thetext>The fix is to dt-utils rather than oe-core/bitbake.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>