<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=5109&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / runit + tor service (+apparmor) bug]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=5109</link>
		<description><![CDATA[The most recent posts in runit + tor service (+apparmor) bug.]]></description>
		<lastBuildDate>Tue, 12 Jul 2022 10:01:24 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36607#p36607</link>
			<description><![CDATA[<div class="quotebox"><cite>Lorenzo wrote:</cite><blockquote><div><p>It might be that apparmor needs some initialization task or filesystem setup that are not done properly at boot.. just a random idea</p></div></blockquote></div><p>i think this is the case.. might have something to do with changes since runit 2.1.2-46 or could be due to wrong sysv apparmor script cause no apparmor profiles are loaded on boot. (you can see output above). something&#039;s buggy on stage 1... aa-enabled is true, but no profiles loading.<br />tor runscript is the only runscript implementing apparmor, so that&#039;s what initially bugged me...<br />apparmor profile loading can only occur manually after boot, not sure why. ( got tired and purged apparmor alltogether - no time currently to debug further...)</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Tue, 12 Jul 2022 10:01:24 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36607#p36607</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36571#p36571</link>
			<description><![CDATA[<p>thanks for this, hadn&#039;t checked apparmor status. it helped figure out why tor reinstall workedaround the issue..: reinstalling tor, puts system_tor apparmor profile in complain mode... </p><div class="codebox"><pre class="vscroll"><code># aa-status                             
apparmor module is loaded.

# dmesg
[  584.993215] audit: type=1400 audit(1657283243.307:533): apparmor=&quot;DENIED&quot; operation=&quot;change_onexec&quot; info=&quot;label not found&quot; error=-2 profile=&quot;unconfined&quot; name=&quot;system_tor&quot; pid=27149 comm=&quot;aa-exec&quot;

# apt install --reinstall tor        
...
Preparing to unpack .../tor_0.4.7.8-1_amd64.deb ...
Unpacking tor (0.4.7.8-1) over (0.4.7.8-1) ...
Installing tor (0.4.7.8-1) ...
ok: run: tor: (pid 27210) 0s
....
Stopping tor daemon...done.
Starting tor daemon...done (already running).
Processing triggers for man-db (2.10.2-1) ...

# aa-status                  
apparmor module is loaded.
1 profiles are loaded.
0 profiles are in enforce mode.
1 profiles are in complain mode.
   system_tor
0 profiles are in kill mode.
0 profiles are in unconfined mode.
1 processes have profiles defined.
0 processes are in enforce mode.
1 processes are in complain mode.
   /usr/bin/tor (27261) system_tor
0 processes are unconfined but have a profile defined.
0 processes are in mixed mode.
0 processes are in kill mode.

# dmesg
[  585.705564] audit: type=1400 audit(1657283244.019:534): apparmor=&quot;STATUS&quot; operation=&quot;profile_load&quot; profile=&quot;unconfined&quot; name=&quot;system_tor&quot; pid=27198 comm=&quot;apparmor_parser&quot;</code></pre></div><p>so i guess tor apparmor profile isn&#039;t working properly.. there are a few debian bugs concerning it, strange it didn&#039;t appear till runit upgrade.. (?) <br />also tried to test with another kernel, but another debian bug (#1014319) proves too time wasting, will try that + submit a tor bug, when i have more time to test...</p><p>thx,</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Fri, 08 Jul 2022 12:42:32 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36571#p36571</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36568#p36568</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>this behavior started since latest runit upgrade in ceres, so i thought i asked you first if it&#039;s connected to the latest upgrade somehow.. (?)</p></div></blockquote></div><p>Humm .. if with the last upgrade you have 2.1.2-47 there are few changes that might impact boot scripts like</p><div class="codebox"><pre><code>runit (2.1.2-46) experimental; urgency=medium

  * ...
  * ...
  * Stage[1,3]: hook to experiment with alternative
     sets of boot scripts. Only initscript are packaged
     in Debian right now, but native sets of scripts
     can be found downstream or on github.
  * ...</code></pre></div><p>but it&#039;s hard to trigger, you have to use an alternative set of boot scripts in the right directory and there must be a flag file..<br />I&#039;m using initscript (from sysvinit package) to boot and shutdown the system: are you using a different set of scripts from somewhere else?<br />It might be that apparmor needs some initialization task or filesystem setup that are not done properly at boot.. just a random idea</p><p>Did you check the output of</p><div class="codebox"><pre><code>/etc/init.d/apparmor status</code></pre></div><p>?<br />and</p><div class="codebox"><pre><code>/etc/init.d/apparmor start</code></pre></div><p>or</p><div class="codebox"><pre><code>/etc/init.d/apparmor restart</code></pre></div><p>?</p>]]></description>
			<author><![CDATA[dummy@example.com (Lorenzo)]]></author>
			<pubDate>Fri, 08 Jul 2022 10:44:32 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36568#p36568</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36567#p36567</link>
			<description><![CDATA[<p>(no obfs4proxy)<br />so, purged both tor + apparmor and reinstalled with defaults, but same error on boot. removed apparmor and tor starts again normally.. didn&#039;t try another boot without apparmor installed, but will probably file a bug with tor since that package provides apparmor profile and reinstalling tor is a &quot;workaround&quot; for some reason..</p><p>just wanted to know if its reproducible in other systems with runit+tor+apparmor.. this behavior started since latest runit upgrade in ceres, so i thought i asked you first if it&#039;s connected to the latest upgrade somehow.. (?)</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Fri, 08 Jul 2022 09:31:09 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36567#p36567</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36555#p36555</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>do you think i should file a bug in tor or apparmor in debian?</p></div></blockquote></div><p>do you have any custom configuration on tor and/or on apparmor?<br />Before filing a bug report, I would try to remove + purge tor, then reinstall it and see if the problem persist;<br />then do the same (remove + purge) with apparmor and check again</p><p>EDIT<br />in case you have obfs4proxy installed, see also<br /><a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004012" rel="nofollow">https://bugs.debian.org/cgi-bin/bugrepo … ug=1004012</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Lorenzo)]]></author>
			<pubDate>Thu, 07 Jul 2022 11:00:13 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36555#p36555</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36554#p36554</link>
			<description><![CDATA[<p>yes, same error.. </p><div class="codebox"><pre><code># sv status tor 
down: tor: 1s, normally up, want up; run: log: (pid 1674) 240s
# update-service --remove /etc/sv/tor
Service tor removed, the service daemon received the TERM and CONT signals.
# /etc/init.d/tor stop
Stopping tor daemon...done (not running - there is no /run/tor/tor.pid).
# /usr/bin/aa-exec --profile=system_tor -- /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --Log &#039;notice stdout&#039; --RunAsDaemon 0 --verify-config
[9778] aa-exec: ERROR: profile &#039;system_tor&#039; does not exist
# /usr/bin/aa-exec --profile=system_tor -- /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --Log &#039;notice stdout&#039; --RunAsDaemon 0
[9804] aa-exec: ERROR: profile &#039;system_tor&#039; does not exist</code></pre></div><p>(same with custom /etc/tor/torrc )</p><p>do you think i should file a bug in tor or apparmor in debian?</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Thu, 07 Jul 2022 07:59:23 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36554#p36554</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36550#p36550</link>
			<description><![CDATA[<p>Hi,</p><p>I have tor running and it works as expected, but I don&#039;t have apparmor.<br />I tried to install apparmor and restart tor, and it seems to work so I can&#039;t reproduce.<br />( I can&#039;t reboot right now, will try later )</p><p>Do the following:<br />stop any running tor instance</p><div class="codebox"><pre><code>update-service --remove /etc/sv/tor</code></pre></div><div class="codebox"><pre><code>/etc/init.d/tor stop</code></pre></div><p>then try to start manually from&#160; a root console</p><div class="codebox"><pre><code>/usr/bin/aa-exec --profile=system_tor -- /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --Log &#039;notice stdout&#039; --RunAsDaemon 0 --verify-config</code></pre></div><div class="codebox"><pre><code>/usr/bin/aa-exec --profile=system_tor -- /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --Log &#039;notice stdout&#039; --RunAsDaemon 0</code></pre></div><p>does it give any error?</p>]]></description>
			<author><![CDATA[dummy@example.com (Lorenzo)]]></author>
			<pubDate>Wed, 06 Jul 2022 23:09:05 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36550#p36550</guid>
		</item>
		<item>
			<title><![CDATA[Re: runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36539#p36539</link>
			<description><![CDATA[<p>after new boot :</p><div class="codebox"><pre><code>/etc/init.d/tor status
tor is not running ... failed!
➜  /etc/init.d/tor stop  
Stopping tor daemon...done (not running - there is no /run/tor/tor.pid).
➜  /etc/init.d/tor start
Starting tor daemon...[15690] aa-exec: ERROR: profile &#039;system_tor&#039; does not exist</code></pre></div><div class="codebox"><pre><code>➜  sv status tor
down: tor: 1s, normally up, want up; run: log: (pid 1656) 933s
➜  sv stop tor
ok: down: tor: 1s, normally up, want up
➜  sv start tor
timeout: down: tor: 0s, normally up, want up</code></pre></div><div class="codebox"><pre><code>/etc/sv/tor/run 
Jul 05 12:34:04.739 [notice] Tor 0.4.7.8 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.4, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.5.2 and Glibc 2.33 as libc.
Jul 05 12:34:04.739 [notice] Tor can&#039;t help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/
Jul 05 12:34:04.739 [notice] Read configuration file &quot;/usr/share/tor/tor-service-defaults-torrc&quot;.
Jul 05 12:34:04.739 [notice] Read configuration file &quot;/etc/tor/torrc&quot;.
Configuration was valid
[17313] aa-exec: ERROR: profile &#039;system_tor&#039; does not exist</code></pre></div><div class="codebox"><pre><code> apt install --reinstall tor
....
Preparing to unpack .../tor_0.4.7.8-1_amd64.deb ...
Unpacking tor (0.4.7.8-1) over (0.4.7.8-1) ...
Installing tor (0.4.7.8-1) ...
ok: run: tor: (pid 17844) 0s
.....
Stopping tor daemon...done.
Starting tor daemon...done (already running).
Processing triggers for man-db (2.10.2-1) ...</code></pre></div><div class="codebox"><pre><code>sv status tor
run: tor: (pid 17895) 15s; run: log: (pid 1656) 1032s</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Tue, 05 Jul 2022 09:36:07 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36539#p36539</guid>
		</item>
		<item>
			<title><![CDATA[runit + tor service (+apparmor) bug]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=36535#p36535</link>
			<description><![CDATA[<p>got a strange bug for the past couple of days (since runit upgrade perhaps? ) , tor doesn&#039;t start at boot. <br />as a temporary workaround have to manually reinstall tor and then it &quot;magically&quot; works again.. `apt install --reinstall tor` </p><p>when booting tor is down. `sv start tor` doesn&#039;t do anything, tor remains down. manually running ./etc/sv/tor/run also doesn&#039;t start the daemon and message seems to involve apparmor (aa-exec : system_tor profile not found) .<br />dmesg : </p><div class="codebox"><pre><code>[ 1444.543116] audit: type=1400 audit(1657004335.151:1337): apparmor=&quot;DENIED&quot; operation=&quot;change_onexec&quot; info=&quot;label not found&quot; error=-2 profile=&quot;unconfined&quot; name=&quot;system_tor&quot; pid=29674 comm=&quot;aa-exec&quot;</code></pre></div><p>profile is in /etc/apparmor.d/system_tor since 23/8/2021, and tor reinstall workaround still uses that one. after reinstalling tor :</p><div class="codebox"><pre><code>[ 1444.634675] audit: type=1400 audit(1657004335.243:1338): apparmor=&quot;STATUS&quot; operation=&quot;profile_load&quot; profile=&quot;unconfined&quot; name=&quot;system_tor&quot; pid=29702 comm=&quot;apparmor_parser&quot;</code></pre></div><p>do others (with runit/tor/apparmor) have such an issue too? <br />not sure why reinstalling tor fixes it temporarily (till next boot), maybe @Lorenzo can direct me on this. (?)<br />is it a bug? is it tor related (since both runscript and apparmor profile come with tor package) or some change in recent runit made it fail? </p><p>thx,</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Tue, 05 Jul 2022 07:22:03 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=36535#p36535</guid>
		</item>
	</channel>
</rss>
