<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=1758&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] <Ascii> Devuan Version]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=1758</link>
		<description><![CDATA[The most recent posts in [SOLVED] <Ascii> Devuan Version.]]></description>
		<lastBuildDate>Fri, 24 Aug 2018 01:02:17 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] <Ascii> Devuan Version]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=11479#p11479</link>
			<description><![CDATA[<p>Hi!</p><p>I had the same problem of <em>no-root</em> buggy outputs of lsb_release on my devuan2 real and virtual machines upgraded from devuan1 and debian7.<br />As I noticed that problem does not concern freshly installed devuan2 machines, I made investigations and... I have just found how to fix it :</p><div class="codebox"><pre><code>chmod 755 /var/lib/apt/lists</code></pre></div><p>---<br />For information, I share the details of my investigations here:</p><p>That bug does not concern fresh installed devuan2 from DVD:</p><div class="codebox"><pre><code>demo@fresh_installed_devuan2:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 2.0 (ascii)
Release:	2.0
Codename:	ascii</code></pre></div><p>But it concerns upgraded devuan2 machines when lsb_release is executed with no root permission:</p><div class="codebox"><pre><code>demo@upgraded_devuan2:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Devuan
Description:    Devuan GNU/Linux ascii
Release:        ascii
Codename:       n/a</code></pre></div><p><strong>Comparison between upgraded and fresh_installed devuan2:</strong><br />I have compared the base-files package files + the script /usr/bin/lsb_release between my machines, but I found no difference.</p><p><strong>Comparison between root and no root execution of lsb_release on an upgraded devuan2:</strong><br />As /usr/bin/lsb_release imports /usr/lib/python2.7/dist-packages/lsb_release.py, I decided to compare the execution of its function guess_devuan_release() between root and no root execution on an upgraded devuan2:</p><div class="codebox"><pre><code>root@upgraded_devuan2:~# python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import lsb_release
&gt;&gt;&gt; lsb_release.guess_devuan_release()
{&#039;DESCRIPTION&#039;: u&#039;Devuan GNU/Linux 2.0 (ascii)&#039;, &#039;RELEASE&#039;: u&#039;2.0&#039;, &#039;CODENAME&#039;: &#039;ascii&#039;, &#039;OS&#039;: &#039;GNU/Linux&#039;, &#039;ID&#039;: &#039;Devuan&#039;}</code></pre></div><div class="codebox"><pre><code>demo@upgraded_devuan2:~$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import lsb_release
&gt;&gt;&gt; lsb_release.guess_devuan_release()
{&#039;RELEASE&#039;: &#039;ascii&#039;, &#039;OS&#039;: &#039;GNU/Linux&#039;, &#039;ID&#039;: &#039;Devuan&#039;, &#039;DESCRIPTION&#039;: &#039;Devuan GNU/Linux ascii&#039;}</code></pre></div><p><strong>Going on deeper within that script, I found out that:</strong></p><ul><li><p><em>/etc/devuan_version remains buggy in devuan2</em> (ascii instead of 2)</p></li></ul><ul><li><p><em>Unnoticed indent error</em>: from line #321 to #334 of lsb_release.py (lsb-release 4.1+devuan2), the function guess_devuan_release() uses mixed 2 and 4 spaces indent instead of the 4 ones used in the rest of the script</p></li></ul><div class="codebox"><pre><code>      rinfo = guess_release_from_apt()
      if rinfo:
        release = rinfo.get(&#039;version&#039;)

        if release:
            codename = lookup_codename(release, &#039;n/a&#039;)
        else:
            release = rinfo.get(&#039;suite&#039;, &#039;unstable&#039;)
            if release == &#039;testing&#039;:
                # Would be nice if I didn&#039;t have to hardcode this.
                codename = TESTING_CODENAME
            else:
                codename = &#039;ceres&#039;
        distinfo.update({ &#039;RELEASE&#039; : release, &#039;CODENAME&#039; : codename })</code></pre></div><ul><li><p>Called by guess_devuan_release(), the function parse_apt_policy() of lsb_release.py executes in a sub-shell the command &#039;<span class="bbc">env LC_ALL=C apt-cache policy</span>&#039;</p></li></ul><p><strong>Then, I suspected /usr/bin/apt-cache. Indeed, it fails with no root permission:</strong></p><div class="codebox"><pre><code>demo@upgraded_devuan2:~$ 
Package files:
 100 /var/lib/dpkg/status
     release a=now
Pinned packages:
demo@upgraded_devuan2:~$</code></pre></div><p><strong>What&#039;s broken with apt?</strong><br />I reinstalled the package apt. But this makes no change.<br />Debugging this re-installation with <span class="bbc">apt-get -o Debug::RunScript -o Debug::pkgAcquire::Worker -o Debug::pkgAcquire::Auth -y --reinstall install apt</span>, I saw nothing interesting.</p><p>The perms and ownerships of /etc/apt/sources.list and /etc/apt/sources.list.d/* looked normal.</p><p><strong>So as a last resort, I decided to check the execution of /usr/bin/apt-cache with strace :</strong></p><div class="codebox"><pre><code>demo@upgraded_devuan2:~$ strace -x -e trace=open,close,read,write -o apt-cache_strace_demo.log env LC_ALL=C apt-cache policy
root@upgraded_devuan2:~# strace -x -e trace=open,close,read,write -o apt-cache_strace_root.log env LC_ALL=C apt-cache policy

root@upgraded_devuan2:~# grep &quot;Permission denied&quot; apt-cache_strace_root.log
demo@upgraded_devuan2:~$ grep &quot;Permission denied&quot; apt-cache_strace_demo.log 
open(&quot;/var/lib/apt/lists/&quot;, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
...</code></pre></div><p><strong>Never was so close to the truth:</strong></p><div class="codebox"><pre><code>demo@upgraded_devuan2:~$ stat /var/lib/apt/lists
  Fichier : /var/lib/apt/lists
   Taille : 4096        Blocs : 8          Blocs d&#039;E/S : 4096   répertoire
Périphérique : fe00h/65024d     Inœud : 1047578     Liens : 3
Accès : (0770/drwxrwx---)  UID : (    0/    root)   GID : (    0/    root)

demo@fresh_installed_devuan2:~$ stat /var/lib/apt/lists
  Fichier : /var/lib/apt/lists
   Taille : 4096      	Blocs : 8          Blocs d&#039;E/S : 4096   répertoire
Périphérique : 801h/2049d	Inœud : 260613      Liens : 3
Accès : (0755/drwxr-xr-x)  UID : (    0/    root)   GID : (    0/    root)</code></pre></div><p>Obviously, the only problem that prevented apt-cache to run correctly as a no-root user, with side effects on lsb_release is a directory permission.<br />Then I fixed it:</p><div class="codebox"><pre><code>chmod 755 /var/lib/apt/lists</code></pre></div><p>Hope this can help.</p>]]></description>
			<author><![CDATA[dummy@example.com (voomto)]]></author>
			<pubDate>Fri, 24 Aug 2018 01:02:17 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=11479#p11479</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] <Ascii> Devuan Version]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=6574#p6574</link>
			<description><![CDATA[<p>Running lsb_release gives this (I&#039;m running ascii):</p><div class="codebox"><pre><code>sgage@ascii:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Devuan
Description:	Devuan GNU/Linux ascii
Release:	ascii
Codename:	n/a
sgage@ascii:~$ </code></pre></div><p>I think it should be Release: 2.0 and Codename: ascii.</p>]]></description>
			<author><![CDATA[dummy@example.com (sgage)]]></author>
			<pubDate>Wed, 06 Dec 2017 12:22:03 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=6574#p6574</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] <Ascii> Devuan Version]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=6573#p6573</link>
			<description><![CDATA[<p>For what its worth...<br />In Ceres,</p><div class="codebox"><pre><code># cat /etc/devuan_version &amp;&amp; cat /etc/debian_version
ascii/ceres
cat: /etc/debian_version: No such file or directory</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (nixer)]]></author>
			<pubDate>Wed, 06 Dec 2017 11:52:51 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=6573#p6573</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] <Ascii> Devuan Version]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=6533#p6533</link>
			<description><![CDATA[<p>Hi</p><p>I run to get:</p><div class="codebox"><pre><code># cat /etc/devuan_version &amp;&amp; cat /etc/debian_version
jessie
9.2</code></pre></div><p>It doesnt return ascii.</p><p>Thankyou</p>]]></description>
			<author><![CDATA[dummy@example.com (makh)]]></author>
			<pubDate>Sun, 03 Dec 2017 16:22:27 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=6533#p6533</guid>
		</item>
	</channel>
</rss>
