<?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>11331</bug_id>
          
          <creation_ts>2017-04-11 15:27:47 +0000</creation_ts>
          <short_desc>volatile-binds preventing systemd-resolved to work</short_desc>
          <delta_ts>2018-12-25 03:12:50 +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>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Please also backport to 2.3.1</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrea Galbusera">gizero</reporter>
          <assigned_to name="Maxin B. John">maxin.john</assigned_to>
          <cc>clopez</cc>
    
    <cc>ismo.puustinen</cc>
    
    <cc>kristian.amlie</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</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>72295</commentid>
    <comment_count>0</comment_count>
    <who name="Andrea Galbusera">gizero</who>
    <bug_when>2017-04-11 15:27:47 +0000</bug_when>
    <thetext>Seems like commit fcd48092d7bcab0cad2606e65332da62420935ad (From OE-Core rev: 4a44a7658cebafab336f061f270b6ff44150a6d6) shadowed tmpfiles.d/etc.conf provided by systemd recipe. 

If resolved is enabled in systemd, at least creating a symlink from /etc/resolv.conf to /run/systemd/resolve/resolv.conf is required for resolution to work as expected.


root@raspberrypi3:~# systemd-resolve google.com     
google.com: 216.58.205.78

-- Information acquired via protocol DNS in 226.7ms.
-- Data is authenticated: no

while...

root@raspberrypi3:~# ping google.com
ping: bad address &apos;google.com&apos;

Putting the aforementioned symlink in place bring back the expected behaviour.
Did not investigate if any other shadowed tmpfile.d affects normal operation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73741</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-06-06 11:36:36 +0000</bug_when>
    <thetext>Maxin, can you take this one please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73804</commentid>
    <comment_count>2</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-06-07 14:39:49 +0000</bug_when>
    <thetext>Similar failure in sysvinit as well (/etc/resolv.conf file exists, but it is empty)

rm: cannot remove &apos;/tmp&apos;: Read-only file system
rm: cannot remove &apos;/etc/resolv.conf&apos;: Read-only file system
ln: failed to create symbolic link &apos;/etc/resolv.conf&apos;: Read-only file system
INIT: Entering runlevel: 5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73876</commentid>
    <comment_count>3</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-06-08 12:40:41 +0000</bug_when>
    <thetext>We can provide a fix by creating a symlink from  /run/systemd/resolve/resolv.conf to /etc/resolv.conf with &quot;resolved&quot; enabled in systemd. 

However, that breaks the images (eg: core-image-sato) where resolution is handled by connman:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=6700
The workaround for this bug was to disable &quot;resolved&quot; and &quot;networkd&quot; in systemd.

+PACKAGECONFIG[resolved] = &quot;--enable-resolved,--disable-resolved&quot;
+PACKAGECONFIG[networkd] = &quot;--enable-networkd,--disable-networkd&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73879</commentid>
    <comment_count>4</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-06-08 12:56:29 +0000</bug_when>
    <thetext>For &quot;read-only&quot; filesystem, creating link from &quot;/var/run/connman/resolv.conf&quot;, to &quot;/etc/resolv.conf&quot; fails.


# systemctl status systemd-tmpfiles-setup.service

[[0;1;31m●[[0m systemd-tmpfiles-setup.service - Create Volatile Files and Directories
   Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service; static; vendor preset: enabled)
   Active: [[0;1;31mfailed[[0m (Result: exit-code) since Thu 2017-06-08 12:53:56 UTC; 36s ago
     Docs: man:tmpfiles.d(5)
           man:systemd-tmpfiles(8)
  Process: 366 ExecStart=/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev [[0;1;31m(code=exited, status=1/FAILURE)[[0m
 Main PID: 366 (code=exited, status=1/FAILURE)

Jun 08 12:53:56 qemux86-64 systemd[1]: Starting Create Volatile Files and Directories...
Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;31msymlink(/var/run/connman/resolv.conf, /etc/resolv.conf) failed: Read-only file system[[0m
Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m&quot;/var/log&quot; already exists and is not a directory.[[0m
Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m&quot;/var/tmp&quot; already exists and is not a directory.[[0m
Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;39msystemd-tmpfiles-setup.service: Main process exited, code=exited, status=1/FAILURE[[0m
Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;31mFailed to start Create Volatile Files and Directories.[[0m
Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;39msystemd-tmpfiles-setup.service: Unit entered failed state.[[0m
Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;39msystemd-tmpfiles-setup.service: Failed with result &apos;exit-code&apos;.[[0m</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73889</commentid>
    <comment_count>5</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-06-08 14:39:23 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; For &quot;read-only&quot; filesystem, creating link from
&gt; &quot;/var/run/connman/resolv.conf&quot;, to &quot;/etc/resolv.conf&quot; fails.
&gt; 
&gt; 
&gt; # systemctl status systemd-tmpfiles-setup.service
&gt; 
&gt; [[0;1;31m●[[0m systemd-tmpfiles-setup.service - Create Volatile Files and
&gt; Directories
&gt;    Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service;
&gt; static; vendor preset: enabled)
&gt;    Active: [[0;1;31mfailed[[0m (Result: exit-code) since Thu 2017-06-08
&gt; 12:53:56 UTC; 36s ago
&gt;      Docs: man:tmpfiles.d(5)
&gt;            man:systemd-tmpfiles(8)
&gt;   Process: 366 ExecStart=/bin/systemd-tmpfiles --create --remove --boot
&gt; --exclude-prefix=/dev [[0;1;31m(code=exited, status=1/FAILURE)[[0m
&gt;  Main PID: 366 (code=exited, status=1/FAILURE)
&gt; 
&gt; Jun 08 12:53:56 qemux86-64 systemd[1]: Starting Create Volatile Files and
&gt; Directories...
&gt; Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]:
&gt; [[0;1;31msymlink(/var/run/connman/resolv.conf, /etc/resolv.conf) failed:
&gt; Read-only file system[[0m
&gt; Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m&quot;/var/log&quot;
&gt; already exists and is not a directory.[[0m
&gt; Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]: [[0;1;39m&quot;/var/tmp&quot;
&gt; already exists and is not a directory.[[0m
&gt; Jun 08 12:53:56 qemux86-64 systemd[1]:
&gt; [[0;1;39msystemd-tmpfiles-setup.service: Main process exited, code=exited,
&gt; status=1/FAILURE[[0m
&gt; Jun 08 12:53:56 qemux86-64 systemd[1]: [[0;1;31mFailed to start Create
&gt; Volatile Files and Directories.[[0m
&gt; Jun 08 12:53:56 qemux86-64 systemd[1]:
&gt; [[0;1;39msystemd-tmpfiles-setup.service: Unit entered failed state.[[0m
&gt; Jun 08 12:53:56 qemux86-64 systemd[1]:
&gt; [[0;1;39msystemd-tmpfiles-setup.service: Failed with result &apos;exit-code&apos;.[[0m

placing a symlink to &quot;/dev/null&quot; in &quot;/etc/tmpfiles.d/connman_resolvconf.conf&quot; for read-only-rootfs fixes this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73998</commentid>
    <comment_count>6</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-06-12 16:29:42 +0000</bug_when>
    <thetext>Fix sent to oe-core:

http://lists.openembedded.org/pipermail/openembedded-core/2017-June/137960.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74145</commentid>
    <comment_count>7</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-06-14 14:55:18 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=00e4662e55f66570cae29240c22b4d74b79d3ca5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74288</commentid>
    <comment_count>8</comment_count>
    <who name="Andrea Galbusera">gizero</who>
    <bug_when>2017-06-16 15:00:09 +0000</bug_when>
    <thetext>I reproduced the original test case and can confirm the original issue is fixed by the above patch. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82600</commentid>
    <comment_count>9</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2018-12-25 03:12:50 +0000</bug_when>
    <thetext>*** Bug 11969 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>