<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Galagzee! &#187; supervisor</title>
	<atom:link href="http://my.galagzee.com/tag/supervisor/feed/" rel="self" type="application/rss+xml" />
	<link>http://my.galagzee.com</link>
	<description>Tech in a Galagzee, Not So Far Away.</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:09:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installing daemontools service supervisor on FreeBSD 7.0</title>
		<link>http://my.galagzee.com/2008/06/30/installing-daemontools-service-supervisor-on-freebsd-70/</link>
		<comments>http://my.galagzee.com/2008/06/30/installing-daemontools-service-supervisor-on-freebsd-70/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 20:06:18 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[daemontools]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[supervise]]></category>
		<category><![CDATA[supervisor]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=78</guid>
		<description><![CDATA[D. J. Bernstein&#8217;s daemontools includes a service supervisor which ensures services it supervises are restarted should they ever stop due to a program/system error. Daemontoos is easy to install, and is best installed from FreeBSD&#8217;s ports system at /usr/ports/sysutils/daemontools.  Be sure to also install the manual, which you can find in a sub-directory work/daemontools-man. The]]></description>
			<content:encoded><![CDATA[<p>D. J. Bernstein&#8217;s <a href="http://cr.yp.to/daemontools.html" target="_blank">daemontools</a> includes a service supervisor which ensures services it supervises are restarted should they ever stop due to a program/system error. Daemontoos is easy to install, and is best installed from FreeBSD&#8217;s ports system at <strong>/usr/ports/sysutils/daemontools</strong>.  Be sure to also install the manual, which you can find in a sub-directory <strong>work/daemontools-man</strong>. The README file that can be found within instructs to [manually] install the manual entries using the command <strong>gzip *.8 ; cp *.8.gz /usr/share/man/man8/</strong> (while residing in the daemontools-man directory). Once installed, there are few additional steps to do:</p>
<ol>
<li>Copy <strong>/usr/ports/sysutils/daemontools/work/svscan.sh.sample</strong> to<br />
<strong>/usr/local/etc/rc.d/svscan.sh</strong> and give it owner execute privileges with <strong><br />
chmod 700 /usr/local/etc/rc.d/svscan.sh</strong></li>
<li><strong>Create /var/service and create a symlink to it from /service<br />
</strong>mkdir /var/service<br />
ln -s /var/service /service</li>
<li><strong>Add following to /etc/rc.conf:</strong><br />
#start /var/service scanning<br />
svscan_enable=&#8221;YES&#8221;</li>
<li><strong>Reboot the system (svscan will *not* start on a BSD system before the system is rebooted)<br />
</strong></li>
</ol>
<p>Optionally you can also install Bruce Guenter&#8217;s supervise-scripts that make life a whole lot easier with daemontools&#8217; supervise.</p>
<ol>
<li><strong>Install latest bglibs if not yet installed</strong><br />
** bglibs is best to install from a <a href="http://www.untroubled.org/bglibs/" target="_blank">downloaded tarball</a> rather than from the ports (while the ports version installs the libs in a more logical location at /usr/local/lib/bglibs/ the programs that utilize the library (bcron, ucspi-unix, etc.) have difficulty locating it.** few symlinks are required (these refer to the locations bglibs installs itself when compiled from the tarball rather than from the ports):<br />
/usr/local/bglibs -&gt; /usr/local/lib/bglibs<br />
/usr/local/bglibs/lib/libbg-sysdeps.so.2 -&gt; /usr/local/lib/libbg-sysdeps.so.2<br />
/usr/local/bglibs/lib/libbg.so.2 -&gt; /usr/local/lib/libbg.so.2</li>
<li><strong>Download, compile, and install <a href="http://www.untroubled.org/supervise-scripts/" target="_blank">supervise-scripts</a>.</strong> Once installed, you&#8217;ll find new commands <em>svc-start, svc-stop, svc-restart, svc-add, svc-remove, svc-isdown, svc-isup, svc-waitdown, svc-waitup, and svc-status</em> in /usr/local/bin. These make scripting and managing services much easier.</li>
</ol>
<p>When switching programs to be svscan-started and svscan-managed, remember to make sure they&#8217;re not being started either as default services by the system, or that a prior startup setting doesn&#8217;t exist in  /etc/rc.conf. Disable them (depending on the service) by commenting out the startup in /etc/rc.conf, by adding a &#8220;NO&#8221; clause in /etc/rc.conf (such as <strong>cron_enable=&#8221;NO&#8221;</strong>), or by disabling the corresponding startup script in /usr/local/etc/rc.d.</p>
<p>If you mess up a service initialization, uninstall the failed service (i.e. unlink the service&#8217;s primary service directory from /var/service), delete the &#8220;supervise&#8221; subfolders (and &#8220;down&#8221; file if present) from the service&#8217;s primary service directory (there&#8217;s one also in the &#8220;log&#8221; subfolder). Then <strong>reboot the system</strong>, and reinstall the service either by using the supervise-scripts command <strong>svc-add</strong>, or by simply symlinking the service&#8217;s primary service directory to /var/service (for example <strong>ln -s /var/db/mysql-supervise /var/service/mysql</strong>).</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2008/06/30/installing-daemontools-service-supervisor-on-freebsd-70/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
