<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://linux-vserver.at/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://linux-vserver.at/index.php?action=history&amp;feed=atom&amp;title=Running_runit-supervised_services_inside_a_vserver</id>
		<title>Running runit-supervised services inside a vserver - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://linux-vserver.at/index.php?action=history&amp;feed=atom&amp;title=Running_runit-supervised_services_inside_a_vserver"/>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;action=history"/>
		<updated>2026-04-10T02:18:27Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=5019&amp;oldid=prev</id>
		<title>Glenn: catspec</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=5019&amp;oldid=prev"/>
				<updated>2011-10-21T21:15:03Z</updated>
		
		<summary type="html">&lt;p&gt;catspec&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 21:15, 21 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 216:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 216:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] 12:18, 28 September 2008 (CET)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] 12:18, 28 September 2008 (CET)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Documentation&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Software under linux-vserver&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Glenn</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4829&amp;oldid=prev</id>
		<title>Glenn: spelling</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4829&amp;oldid=prev"/>
				<updated>2011-10-21T18:59:48Z</updated>
		
		<summary type="html">&lt;p&gt;spelling&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:59, 21 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 216:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 216:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] 12:18, 28 September 2008 (CET)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] 12:18, 28 September 2008 (CET)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Documentaion&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Documentation&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Glenn</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4813&amp;oldid=prev</id>
		<title>Glenn: +cat</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4813&amp;oldid=prev"/>
				<updated>2011-10-21T18:52:27Z</updated>
		
		<summary type="html">&lt;p&gt;+cat&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:52, 21 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 215:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 215:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] 12:18, 28 September 2008 (CET)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] 12:18, 28 September 2008 (CET)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Documentaion]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Glenn</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4085&amp;oldid=prev</id>
		<title>KornAndras: Undo vandalism: revision 4084 by 200.166.248.132 (Talk)</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4085&amp;oldid=prev"/>
				<updated>2009-11-23T19:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;Undo vandalism: revision 4084 by &lt;a href=&quot;/Special:Contributions/200.166.248.132&quot; title=&quot;Special:Contributions/200.166.248.132&quot;&gt;200.166.248.132&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:200.166.248.132&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:200.166.248.132 (page does not exist)&quot;&gt;Talk&lt;/a&gt;)&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:57, 23 November 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly supervise services running in vserver guests.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly supervise services running in vserver guests.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;wTRnHL &lt;/del&gt;http://&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;j8Jw83mNs0doPpsqvjrcns5&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;info&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== Motivation and goals ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;This is what I wanted to achieve:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* Partition a physical server with many responsibilities into vservers that can easily be upgraded individually without breaking any unrelated stuff.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* Each service or small set of services should run in its own vserver.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* Services should be supervised (started, stopped and managed) by [&lt;/ins&gt;http://&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;smarden.org/runit runit].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* Service logs should accumulate on the host, not the guests.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;** &amp;lt;tt&amp;gt;svlogd&amp;lt;/tt&amp;gt; rotates them nicely and can invoke my &amp;lt;tt&amp;gt;multilogcheck&amp;lt;/tt&amp;gt; script to alert me of unusual events as a postprocessor, but&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;** I don't want to install &amp;lt;tt&amp;gt;multilogcheck&amp;lt;/tt&amp;gt; inside every vserver because it's messy.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;** I don't like syslog. There are many problems with it, but I won't go into that here.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*** Therefore, services mostly log to stdout and thus to svlogd.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*** For services that absolutely must use syslog, I provide [http://smarden.org/socklog socklog].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*** Again, I don't want a separate &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; instance in every vserver.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*** Alas, &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; is unable to listen on more than one Unix domain socket.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;**** Luckily, &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt; can be used to relay syslog messages from the vservers to the master &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; on the host. (&amp;lt;tt&amp;gt;syslog-ng&amp;lt;/tt&amp;gt; would also have done the job nicely.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;**** It's also possible to bind mount the &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; socket in every guest; however, I'm afraid this breaks if you restart socklog after a guest is up. Workaround: make &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; a symlink to, say, &amp;lt;tt&amp;gt;/var/run/syslog/socket&amp;lt;/tt&amp;gt; everywhere and bind mount the host's &amp;lt;tt&amp;gt;/var/run/syslog&amp;lt;/tt&amp;gt; directory in the guests; that way the socket will still be available even if socklog unlinks and recreates it.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* It should be straightforward and next to transparent to manage the services running in vservers.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;** With &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt;, it's easy to delegate management rights of a service to users (chown and chmod some files in the pertinent &amp;lt;tt&amp;gt;supervise&amp;lt;/tt&amp;gt; directory). This should continue to work&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Prerequisites ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Prerequisites ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KornAndras</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4084&amp;oldid=prev</id>
		<title>200.166.248.132: /* Motivation and goals */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=4084&amp;oldid=prev"/>
				<updated>2009-11-23T18:21:06Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Motivation and goals&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:21, 23 November 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly supervise services running in vserver guests.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly supervise services running in vserver guests.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;== Motivation and goals ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wTRnHL &lt;/ins&gt;http://&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;j8Jw83mNs0doPpsqvjrcns5&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;info&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This is what I wanted to achieve:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* Partition a physical server with many responsibilities into vservers that can easily be upgraded individually without breaking any unrelated stuff.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* Each service or small set of services should run in its own vserver.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* Services should be supervised (started, stopped and managed) by [&lt;/del&gt;http://&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;smarden.org/runit runit].&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* Service logs should accumulate on the host, not the guests.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;** &amp;lt;tt&amp;gt;svlogd&amp;lt;/tt&amp;gt; rotates them nicely and can invoke my &amp;lt;tt&amp;gt;multilogcheck&amp;lt;/tt&amp;gt; script to alert me of unusual events as a postprocessor, but&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;** I don't want to install &amp;lt;tt&amp;gt;multilogcheck&amp;lt;/tt&amp;gt; inside every vserver because it's messy.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;** I don't like syslog. There are many problems with it, but I won't go into that here.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;*** Therefore, services mostly log to stdout and thus to svlogd.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;*** For services that absolutely must use syslog, I provide [http://smarden.org/socklog socklog].&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;*** Again, I don't want a separate &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; instance in every vserver.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;*** Alas, &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; is unable to listen on more than one Unix domain socket.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;**** Luckily, &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt; can be used to relay syslog messages from the vservers to the master &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; on the host. (&amp;lt;tt&amp;gt;syslog-ng&amp;lt;/tt&amp;gt; would also have done the job nicely.)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;**** It's also possible to bind mount the &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; socket in every guest; however, I'm afraid this breaks if you restart socklog after a guest is up. Workaround: make &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; a symlink to, say, &amp;lt;tt&amp;gt;/var/run/syslog/socket&amp;lt;/tt&amp;gt; everywhere and bind mount the host's &amp;lt;tt&amp;gt;/var/run/syslog&amp;lt;/tt&amp;gt; directory in the guests; that way the socket will still be available even if socklog unlinks and recreates it.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* It should be straightforward and next to transparent to manage the services running in vservers.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;** With &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt;, it's easy to delegate management rights of a service to users (chown and chmod some files in the pertinent &amp;lt;tt&amp;gt;supervise&amp;lt;/tt&amp;gt; directory). This should continue to work&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Prerequisites ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Prerequisites ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>200.166.248.132</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=3313&amp;oldid=prev</id>
		<title>KornAndras: /* Running services */ disadvantages</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=3313&amp;oldid=prev"/>
				<updated>2008-09-28T10:19:09Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Running services: &lt;/span&gt; disadvantages&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 10:19, 28 September 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 199:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 199:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Comments and additions welcome.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Comments and additions welcome.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;03&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;29&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;2 February 2007 &lt;/del&gt;(CET)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== Disadvantages ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The most significant problem with this approach (as opposed to using initstyle plain and a separate runit instance in each vserver) is that it's no longer straightforward to manage the services running in vservers from inside the vservers; package management scripts can't stop them for upgrades, for example (unless you modify the initscripts in quite horrible ways).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Initial setup is also slightly more complicated.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;These have to be weighed against the advantages of:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* having fewer superfluous processes (like a separate &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;runsvdir&amp;lt;/tt&amp;gt; in each vserver);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* being able to manage the services easily from the host;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* avoiding the need to run &amp;lt;tt&amp;gt;sshd&amp;lt;/tt&amp;gt; inside each guest in order to be able to easily delegate service management privileges to others.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Nowadays I tend to think the initstyle plain method is better after all.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;--[[User:KornAndras|Guy-]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;12&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;18&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;28 September 2008 &lt;/ins&gt;(CET)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KornAndras</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=3312&amp;oldid=prev</id>
		<title>KornAndras: /* Motivation and goals */ bind mounting /dev/log socket is also possible</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=3312&amp;oldid=prev"/>
				<updated>2008-09-28T10:05:48Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Motivation and goals: &lt;/span&gt; bind mounting /dev/log socket is also possible&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 10:05, 28 September 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*** Alas, &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; is unable to listen on more than one Unix domain socket.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*** Alas, &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; is unable to listen on more than one Unix domain socket.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;**** Luckily, &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt; can be used to relay syslog messages from the vservers to the master &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; on the host. (&amp;lt;tt&amp;gt;syslog-ng&amp;lt;/tt&amp;gt; would also have done the job nicely.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;**** Luckily, &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt; can be used to relay syslog messages from the vservers to the master &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; on the host. (&amp;lt;tt&amp;gt;syslog-ng&amp;lt;/tt&amp;gt; would also have done the job nicely.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;**** It's also possible to bind mount the &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; socket in every guest; however, I'm afraid this breaks if you restart socklog after a guest is up. Workaround: make &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; a symlink to, say, &amp;lt;tt&amp;gt;/var/run/syslog/socket&amp;lt;/tt&amp;gt; everywhere and bind mount the host's &amp;lt;tt&amp;gt;/var/run/syslog&amp;lt;/tt&amp;gt; directory in the guests; that way the socket will still be available even if socklog unlinks and recreates it.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* It should be straightforward and next to transparent to manage the services running in vservers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* It should be straightforward and next to transparent to manage the services running in vservers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;** With &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt;, it's easy to delegate management rights of a service to users (chown and chmod some files in the pertinent &amp;lt;tt&amp;gt;supervise&amp;lt;/tt&amp;gt; directory). This should continue to work.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;** With &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt;, it's easy to delegate management rights of a service to users (chown and chmod some files in the pertinent &amp;lt;tt&amp;gt;supervise&amp;lt;/tt&amp;gt; directory). This should continue to work.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KornAndras</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=2583&amp;oldid=prev</id>
		<title>KornAndras: typo fix</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=2583&amp;oldid=prev"/>
				<updated>2007-06-28T13:11:30Z</updated>
		
		<summary type="html">&lt;p&gt;typo fix&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:11, 28 June 2007&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;supervies &lt;/del&gt;services running in vserver guests.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;supervise &lt;/ins&gt;services running in vserver guests.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Motivation and goals ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Motivation and goals ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KornAndras</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=2273&amp;oldid=prev</id>
		<title>KornAndras: Initial version</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=Running_runit-supervised_services_inside_a_vserver&amp;diff=2273&amp;oldid=prev"/>
				<updated>2007-02-02T02:29:31Z</updated>
		
		<summary type="html">&lt;p&gt;Initial version&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page describes a setup where you have a [http://smarden.org/runit runit] installation on the host and use it to directly supervies services running in vserver guests.&lt;br /&gt;
&lt;br /&gt;
== Motivation and goals ==&lt;br /&gt;
&lt;br /&gt;
This is what I wanted to achieve:&lt;br /&gt;
&lt;br /&gt;
* Partition a physical server with many responsibilities into vservers that can easily be upgraded individually without breaking any unrelated stuff.&lt;br /&gt;
* Each service or small set of services should run in its own vserver.&lt;br /&gt;
* Services should be supervised (started, stopped and managed) by [http://smarden.org/runit runit].&lt;br /&gt;
* Service logs should accumulate on the host, not the guests.&lt;br /&gt;
** &amp;lt;tt&amp;gt;svlogd&amp;lt;/tt&amp;gt; rotates them nicely and can invoke my &amp;lt;tt&amp;gt;multilogcheck&amp;lt;/tt&amp;gt; script to alert me of unusual events as a postprocessor, but&lt;br /&gt;
** I don't want to install &amp;lt;tt&amp;gt;multilogcheck&amp;lt;/tt&amp;gt; inside every vserver because it's messy.&lt;br /&gt;
** I don't like syslog. There are many problems with it, but I won't go into that here.&lt;br /&gt;
*** Therefore, services mostly log to stdout and thus to svlogd.&lt;br /&gt;
*** For services that absolutely must use syslog, I provide [http://smarden.org/socklog socklog].&lt;br /&gt;
*** Again, I don't want a separate &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; instance in every vserver.&lt;br /&gt;
*** Alas, &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; is unable to listen on more than one Unix domain socket.&lt;br /&gt;
**** Luckily, &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt; can be used to relay syslog messages from the vservers to the master &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; on the host. (&amp;lt;tt&amp;gt;syslog-ng&amp;lt;/tt&amp;gt; would also have done the job nicely.)&lt;br /&gt;
* It should be straightforward and next to transparent to manage the services running in vservers.&lt;br /&gt;
** With &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt;, it's easy to delegate management rights of a service to users (chown and chmod some files in the pertinent &amp;lt;tt&amp;gt;supervise&amp;lt;/tt&amp;gt; directory). This should continue to work.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
# A fairly recent vserver kernel with support for persistent contexts (I used 2.6.19.2-vs2.2.0-rc8.7).&lt;br /&gt;
# A recent version of util-vserver that supports persistent contexts correctly (I used [http://people.linux-vserver.org/~dhozac/p/uv/experimental/util-vserver-0.30.213-rc1.tar.bz2 0.30.213-rc1]).&lt;br /&gt;
# Daniel_Hozac's [http://people.linux-vserver.org/~dhozac/t/signal-relay.c signal-relay] program.&lt;br /&gt;
&lt;br /&gt;
== The big picture ==&lt;br /&gt;
&lt;br /&gt;
Let's see how it all fits together.&lt;br /&gt;
&lt;br /&gt;
We'd like to achieve something like this (output of &amp;lt;tt&amp;gt;vps axfu&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
USER       PID CONTEXT             %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;
root         1     0 MAIN           0.0  0.0    104    16 ?        Ss   Jan29   0:06 runit&lt;br /&gt;
root      4188     0 MAIN           0.0  0.0    132    32 ?        Ss   Jan29   0:10 runsvdir -P /var/service log: .......................................................&lt;br /&gt;
root      4250     0 MAIN           0.0  0.0    108    28 ?        Ss   Jan29   0:00  \_ runsv vserver-logrelay-squid&lt;br /&gt;
log       4256     0 MAIN           0.0  0.0    128    44 ?        S    Jan29   0:00  |   \_ svlogd -t /var/log/sv/vserver-logrelay-squid&lt;br /&gt;
logrelay  3106     0 MAIN           0.0  0.1  25428  1944 ?        S    00:44   0:00  |   \_ socat -d -d -d -D -ls -u UNIX-LISTEN:/etc/vservers/squid/vdir/dev/log,unlink-early,nonblock,mode=666,setuid=logrelay UNIX-CONNECT:/dev/log,type=2,nonblock,forever&lt;br /&gt;
root     19272     0 MAIN           0.0  0.0    108    28 ?        Ss   Feb01   0:00  \_ runsv squid&lt;br /&gt;
log      19273     0 MAIN           0.0  0.0    128    44 ?        S    Feb01   0:00  |   \_ svlogd -t /var/log/sv/squid&lt;br /&gt;
root     10324     0 MAIN           0.0  0.0   5728   364 ?        S    Feb01   0:00  |   \_ signal-relay vserver squid exec squid -N -D -sYC&lt;br /&gt;
proxy    10334     2 squid          0.0  0.5  24968  8036 ?        Sl   Feb01   0:01  |       \_ squid -N -D -sYC&lt;br /&gt;
root     24219     0 MAIN           0.0  0.0    108    32 ?        Ss   02:02   0:00  \_ runsv nmbd&lt;br /&gt;
root     24220     0 MAIN           0.0  0.0   5732   376 ?        S    02:02   0:00  |   \_ signal-relay vserver samba exec /usr/sbin/nmbd -F&lt;br /&gt;
root     24230     3 samba          0.0  0.1  30080  2360 ?        Ss   02:02   0:00  |       \_ /usr/sbin/nmbd -F&lt;br /&gt;
root     24251     3 samba          0.0  0.0  32172  1496 ?        S    02:02   0:00  |           \_ /usr/sbin/nmbd -F&lt;br /&gt;
root     24253     0 MAIN           0.0  0.0    108    28 ?        Ss   02:02   0:00  \_ runsv smbd&lt;br /&gt;
root     24254     0 MAIN           0.0  0.0   5732   376 ?        S    02:02   0:00  |   \_ signal-relay vserver samba exec /usr/sbin/smbd -F&lt;br /&gt;
root     24268     3 samba          0.0  0.2  41888  3404 ?        Ss   02:02   0:00  |       \_ /usr/sbin/smbd -F&lt;br /&gt;
root     24289     3 samba          0.0  0.0  41888  1232 ?        S    02:02   0:00  |           \_ /usr/sbin/smbd -F&lt;br /&gt;
root     29625     0 MAIN           0.0  0.0    104    28 ?        Ss   02:22   0:00  \_ runsv cron-squid&lt;br /&gt;
root     29626     0 MAIN           0.0  0.0   5732   376 ?        S    02:22   0:00      \_ signal-relay vserver squid exec cron -f&lt;br /&gt;
root     29637     2 squid          0.0  0.0  11492  1060 ?        S    02:22   0:00          \_ cron -f&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For service supervision to work, we must be able to send signals to our services. Specifically, &amp;lt;tt&amp;gt;runsv&amp;lt;/tt&amp;gt; must be able to send signals to its children.&lt;br /&gt;
Alas, it's not prepared to send signals across context boundaries, which is where &amp;lt;tt&amp;gt;signal-relay&amp;lt;/tt&amp;gt; comes in.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;signal-relay&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;signal-relay&amp;lt;/tt&amp;gt; is a small program not unlike &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;chpst&amp;lt;/tt&amp;gt; that does the following:&lt;br /&gt;
&lt;br /&gt;
* it forks a child;&lt;br /&gt;
** inside the child, it execs the program specified on its command line;&lt;br /&gt;
* in the parent, it sets up signal handlers for every signal that relay the signal to the child, even if the child is running in a different context;&lt;br /&gt;
* if the child exits, &amp;lt;tt&amp;gt;signal-relay&amp;lt;/tt&amp;gt; exits.&lt;br /&gt;
* (It can also put the child into its own process group; use the &amp;lt;tt&amp;gt;-P&amp;lt;/tt&amp;gt; switch. Sending signals to process groups in a different context doesn't work yet, though.)&lt;br /&gt;
&lt;br /&gt;
=== Setting up the vservers ===&lt;br /&gt;
&lt;br /&gt;
When we start a service for runit, we want the command that starts the service to stay in the foreground until the moment the service dies. &amp;lt;tt&amp;gt;vserver exec&amp;lt;/tt&amp;gt; looks just right, but there is a catch: it only works for vservers that have been &amp;quot;started&amp;quot;. &amp;lt;tt&amp;gt;vserver start&amp;lt;/tt&amp;gt;, however, doesn't fit very well into the &amp;lt;tt&amp;gt;runit&amp;lt;/tt&amp;gt; way of doing things. You can set it up as a service (this is discussed in [[util-vserver:InitStyles]]), but it seems superfluous to leave some processes around just to keep a vserver &amp;quot;started&amp;quot; so that we can run services in it.&lt;br /&gt;
&lt;br /&gt;
What we need is a way of basically doing &amp;quot;start vserver &amp;lt;guest&amp;gt; if it's not started, then exec program &amp;lt;service&amp;gt; inside it&amp;quot;. Normally, a context with no processes running inside it is destroyed by the kernel; thus, just setting &amp;lt;tt&amp;gt;/etc/vservers/guest/apps/init/cmd.start&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/bin/true&amp;lt;/tt&amp;gt; isn't going to work; we would need something that stays around for a while, like a script that calls &amp;lt;tt&amp;gt;sleep 1m &amp;amp;&amp;lt;/tt&amp;gt;. This would make &amp;lt;tt&amp;gt;vserver start&amp;lt;/tt&amp;gt; happy, so in our service run script, we could do something like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vserver guest status || vserver guest start&lt;br /&gt;
exec signal-relay vserver guest exec /path/to/service-program&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more elegant solution is to make the guest context ''persistent''. This way it sticks around even if there are no processes left in it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/vservers/guest&lt;br /&gt;
echo persistent &amp;gt;&amp;gt;flags&lt;br /&gt;
echo persistent &amp;gt;&amp;gt;nflags&lt;br /&gt;
echo /bin/true &amp;gt;apps/init/cmd.start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(I ''guess'' &amp;lt;tt&amp;gt;nflags&amp;lt;/tt&amp;gt; is for the network context.)&lt;br /&gt;
&lt;br /&gt;
Now, &amp;lt;tt&amp;gt;vserver guest start&amp;lt;/tt&amp;gt; should be able to &amp;quot;start&amp;quot; our vserver (set up all of its state), and exit without leaving stray processes around.&lt;br /&gt;
&lt;br /&gt;
== Running services ==&lt;br /&gt;
&lt;br /&gt;
Say you have a vserver called &amp;lt;tt&amp;gt;squid&amp;lt;/tt&amp;gt;, and you want to run your &amp;lt;tt&amp;gt;squid&amp;lt;/tt&amp;gt; proxy inside it to keep it insulated from the other processes on the system, and vice versa.&lt;br /&gt;
&lt;br /&gt;
In our current setup, the following run script will do the trick (it borrows a bit from Debian's initscript and uses the Debian defaults file):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
# Set a default for max. filedescriptors&lt;br /&gt;
SQUID_MAXFD=4096&lt;br /&gt;
&lt;br /&gt;
# Figure out the name of the service we're running as&lt;br /&gt;
SVNAME=$(basename $(pwd))&lt;br /&gt;
&lt;br /&gt;
# Read the configfile of this service; if it sets VSERVERNAME, we'll assume we have to run inside the specified vserver&lt;br /&gt;
CONFIG=/etc/default/&amp;quot;$SVNAME&amp;quot;&lt;br /&gt;
[ -r &amp;quot;$CONFIG&amp;quot; ] &amp;amp;&amp;amp; . &amp;quot;$CONFIG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Source Debian defaults&lt;br /&gt;
[ -n &amp;quot;$VSERVERNAME&amp;quot; ] &amp;amp;&amp;amp; VROOT=&amp;quot;/etc/vservers/$VSERVERNAME/vdir&amp;quot; || VROOT=/&lt;br /&gt;
[ -r &amp;quot;$VROOT/etc/default/squid&amp;quot; ] &amp;amp;&amp;amp; . &amp;quot;$VROOT/etc/default/squid&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[ &amp;quot;$SQUID_MAXFD&amp;quot; -gt 4096 ] &amp;amp;&amp;amp; SQUID_MAXFD=4096&lt;br /&gt;
&lt;br /&gt;
if test -f /proc/sys/fs/file-max; then&lt;br /&gt;
        global_file_max=$(cat /proc/sys/fs/file-max)&lt;br /&gt;
        minimal_file_max=$(($SQUID_MAXFD + 4096))&lt;br /&gt;
        [ &amp;quot;$global_file_max&amp;quot; -lt &amp;quot;$minimal_file_max&amp;quot; ] &amp;amp;&amp;amp; echo &amp;quot;$minimal_file_max&amp;quot; &amp;gt;/proc/sys/fs/file-max&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [ ! &amp;quot;$VSERVERNAME&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
        VSERVERARGS=&amp;quot;signal-relay vserver $VSERVERNAME exec&amp;quot;&lt;br /&gt;
        vserver &amp;quot;$VSERVERNAME&amp;quot; status || vserver &amp;quot;$VSERVERNAME&amp;quot; start # start the vserver if necessary&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exec chpst -o&amp;quot;$SQUID_MAXFD&amp;quot; $VSERVERARGS squid -N -D -sYC&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script is generic in the sense that it works with or without a vserver setup.&lt;br /&gt;
&lt;br /&gt;
You can run an &amp;lt;tt&amp;gt;svlogd&amp;lt;/tt&amp;gt; for this service like you normally would; or you could have all your &amp;lt;tt&amp;gt;svlogd&amp;lt;/tt&amp;gt;s run in a different vserver.&lt;br /&gt;
&lt;br /&gt;
A run script for &amp;lt;tt&amp;gt;cron&amp;lt;/tt&amp;gt; that automatically figures out if it should run in a vserver:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1&lt;br /&gt;
DEPENDENCIES=&amp;quot;&amp;quot;&lt;br /&gt;
RLIMIT=&amp;quot;chpst -t 172800&amp;quot;&lt;br /&gt;
SVNAME=$(basename $(pwd))&lt;br /&gt;
CONFIG=/etc/default/&amp;quot;$SVNAME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Assume part after dash is name of vserver&lt;br /&gt;
if [ ! &amp;quot;${SVNAME/*-/}&amp;quot; = &amp;quot;$SVNAME&amp;quot; ]; then&lt;br /&gt;
        VSERVERNAME=&amp;quot;${SVNAME/*-/}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# By default, we depend on the socklog service if it exists&lt;br /&gt;
[ -e /service/socklog ] &amp;amp;&amp;amp; DEPENDENCIES=socklog&lt;br /&gt;
&lt;br /&gt;
# And also on the logrelay service of the pertinent vserver&lt;br /&gt;
[ -e /service/vserver-logrelay-&amp;quot;$VSERVERNAME&amp;quot; ] &amp;amp;&amp;amp; DEPENDENCIES=&amp;quot;$DEPENDENCIES vserver-logrelay-$VSERVERNAME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Can override VSERVERNAME, RLIMIT and DEPENDENCIES here if necessary&lt;br /&gt;
[ -r &amp;quot;$CONFIG&amp;quot; ] &amp;amp;&amp;amp; . &amp;quot;$CONFIG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ ! &amp;quot;$VSERVERNAME&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
        VSERVERARGS=&amp;quot;signal-relay vserver $VSERVERNAME exec&amp;quot;&lt;br /&gt;
        vserver &amp;quot;$VSERVERNAME&amp;quot; status || vserver &amp;quot;$VSERVERNAME&amp;quot; start&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [ -n &amp;quot;$DEPENDENCIES&amp;quot; ]; then&lt;br /&gt;
        sv start $DEPENDENCIES || exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exec $RLIMIT $VSERVERARGS cron -f&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, if you place this run script in a service directory called &amp;lt;tt&amp;gt;cron-squid&amp;lt;/tt&amp;gt;, it will run a cron daemon in the &amp;lt;tt&amp;gt;squid&amp;lt;/tt&amp;gt; guest. This takes care of rotating the squid logs under &amp;lt;tt&amp;gt;/var/log/squid&amp;lt;/tt&amp;gt;, for example; although this could also be done on the host with a few kludges.&lt;br /&gt;
&lt;br /&gt;
The vserver-logrelay-template/run script looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1&lt;br /&gt;
SVNAME=$(basename $(pwd))&lt;br /&gt;
RUNASUSER=logrelay&lt;br /&gt;
MODE=666&lt;br /&gt;
VSERVERNAME=$(echo $SVNAME | sed 's/vserver-logrelay-//')&lt;br /&gt;
[ -r &amp;quot;/etc/default/$SVNAME&amp;quot; ] &amp;amp;&amp;amp; . &amp;quot;/etc/default/$SVNAME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exec socat -d -d -d -D -ls -u \&lt;br /&gt;
        UNIX-LISTEN:/etc/vservers/$VSERVERNAME/vdir/dev/log,unlink-early,nonblock,mode=$MODE,setuid=$RUNASUSER \&lt;br /&gt;
        UNIX-CONNECT:/dev/log,type=2,nonblock,forever&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will pass syslog messages from a vserver to the syslog of the host by acting as a syslog server for the &amp;lt;tt&amp;gt;/dev/log&amp;lt;/tt&amp;gt; socket of the guest. Thus, you don't need to run a &amp;lt;tt&amp;gt;syslogd&amp;lt;/tt&amp;gt; inside the vserver and you don't need to migrate to &amp;lt;tt&amp;gt;syslog-ng&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;socklog&amp;lt;/tt&amp;gt; on the host.&lt;br /&gt;
&lt;br /&gt;
Symlink this run script into a service directory called &amp;lt;tt&amp;gt;vserver-logrelay-squid&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, &amp;lt;tt&amp;gt;socat&amp;lt;/tt&amp;gt; has a largish memory footprint; something more lightweight could, perhaps, be used.&lt;br /&gt;
&lt;br /&gt;
Comments and additions welcome.&lt;br /&gt;
--[[User:KornAndras|Guy-]] 03:29, 2 February 2007 (CET)&lt;/div&gt;</summary>
		<author><name>KornAndras</name></author>	</entry>

	</feed>