<?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>xinetd Архиви - rosen4o.net</title>
	<atom:link href="https://rosen4o.net/tag/xinetd/feed/" rel="self" type="application/rss+xml" />
	<link>https://rosen4o.net/tag/xinetd/</link>
	<description></description>
	<lastBuildDate>Wed, 03 Dec 2008 17:11:41 +0000</lastBuildDate>
	<language>bg-BG</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>xinetd</title>
		<link>https://rosen4o.net/2008/12/03/xinetd/</link>
					<comments>https://rosen4o.net/2008/12/03/xinetd/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Wed, 03 Dec 2008 17:11:41 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[xinetd]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=441</guid>

					<description><![CDATA[<p>До сега не се бях замислял колко мощен може да бъде xinetd докато не прочетох следната статия You can use the simple but powerful xinetd on your Linux server to monitor almost anything on the server. Since xinetd just holds<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2008/12/03/xinetd/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2008/12/03/xinetd/">xinetd</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>До сега не се бях замислял колко мощен може да бъде xinetd докато не прочетох следната статия</p>
<blockquote><p>You can use the simple but powerful xinetd on your Linux server to monitor almost anything on the server. Since xinetd just holds open a port and waits for a connection, you can tell it to run a script and return the output directly to the network stream.</p>
<p>To start, you’ll need a script which will return data to stdout. In this example, I’ll use a very simple script like the following:</p>
<p>#!/bin/bash<br />
echo `uptime | egrep -o &#8216;up ([0-9]+) days&#8217; | awk &#8216;{print $2}&#8217;`</p>
<p>This script pulls the number of days that the server has been online. Make the script executable with a chmod +x.</p>
<p>Now, you’ll need to choose a port on which to run the xinetd service. I normally find a service in /etc/services that I won’t be using on the server. In this example, I’ll use isdnlog, which runs on port 20011. Create a file called /etc/xinetd.d/myscript and include the following in the file:</p>
<p>service isdnlog<br />
{<br />
disable    = no<br />
socket_type    = stream<br />
protocol    = tcp<br />
wait        = no<br />
user        = root<br />
server        = /path/to/script.sh<br />
server_args    = test<br />
}</p>
<p>Depending on your xinetd version, you may need to enable your new configuration and restart xinetd:</p>
<p>chkconfig myscript on<br />
/etc/init.d/xinetd restart</p>
<p>You can test your new script using netcat:</p>
<p>$ uptime<br />
18:10:30 up 141 days, 19:17,  1 user,  load average: 0.65, 1.47, 1.14<br />
$ nc localhost 20011<br />
141</p>
<p>If you need to pass arguments to your script, just adjust the server_args line in the xinetd configuration. Also, be sure that your script is set up to handle the arguments.</p></blockquote>
<p>Материалът <a href="https://rosen4o.net/2008/12/03/xinetd/">xinetd</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2008/12/03/xinetd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
