<?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>Solutions Log &#187; Linux</title> <atom:link href="http://solutions.unixsherpa.com/category/os/linux/feed/" rel="self" type="application/rss+xml" /><link>http://solutions.unixsherpa.com</link> <description>by Dan Reiland</description> <lastBuildDate>Tue, 05 Apr 2011 16:42:14 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Unable to Browse Windows Network Shares in Ubuntu</title><link>http://solutions.unixsherpa.com/2011/03/21/unable-to-browse-windows-network-shares-in-ubuntu/</link> <comments>http://solutions.unixsherpa.com/2011/03/21/unable-to-browse-windows-network-shares-in-ubuntu/#comments</comments> <pubDate>Tue, 22 Mar 2011 04:52:56 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[nautilus]]></category> <category><![CDATA[ubuntu]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=355</guid> <description><![CDATA[Issue: When attempting to browse Windows network shares from Gnome Nautilus, the window will become unresponsive and the operation will eventually timeout. Affects: Ubuntu 10.04 LTS Ubuntu 10.10 Cause: wins is not enabled as a host resolution mechanism in /etc/nsswitch.conf; winbind is not installed. Resolution: Open /etc/nsswitch.conf in your favorite editor and ensure the hosts [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> When attempting to browse Windows network shares from Gnome Nautilus, the window will become unresponsive and the operation will eventually timeout.</p><p><strong>Affects:</strong></p><ul><li>Ubuntu 10.04 LTS</li><li>Ubuntu 10.10</li></ul><p><strong>Cause:</strong><br
/> <em>wins</em> is not enabled as a host resolution mechanism in <em>/etc/nsswitch.conf</em>; <em>winbind</em> is not installed.</p><p><strong>Resolution:</strong><br
/> Open <em>/etc/nsswitch.conf</em> in your favorite editor and ensure the <em>hosts</em> line matches the precise order below (you are adding wins).</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;hosts: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;files mdns4_minimal [NOTFOUND=return] wins dns mdns4</div></div><p>Install <em>winbind</em></p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install winbind</div></div><p><strong>References:</strong><br
/> <a
href="http://ubuntuforums.org/showthread.php?t=1169149">http://ubuntuforums.org/showthread.php?t=1169149</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2011/03/21/unable-to-browse-windows-network-shares-in-ubuntu/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Empathy Reports Network Error When Connecting to MSN</title><link>http://solutions.unixsherpa.com/2011/03/21/empathy-reports-network-error-when-connecting-to-msn/</link> <comments>http://solutions.unixsherpa.com/2011/03/21/empathy-reports-network-error-when-connecting-to-msn/#comments</comments> <pubDate>Tue, 22 Mar 2011 04:33:10 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[ubuntu]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=352</guid> <description><![CDATA[Issue: telepathy-butterfly Affects: Ubuntu 10.04 LTS Ubuntu 10.10 Cause: A bug is present in the telepathy-butterfly package. Resolution: An update is pending approval and will be available for both Ubuntu 10.04 and 10.10. Informal patches are available, however, I prefer to stick to the mainline distribution as much as possible to avoid introducing tightly coupled [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> telepathy-butterfly</p><p><strong>Affects:</strong></p><ul><li>Ubuntu 10.04 LTS</li><li>Ubuntu 10.10</li></ul><p><strong>Cause:</strong><br
/> A bug is present in the <em>telepathy-butterfly</em> package.</p><p><strong>Resolution:</strong><br
/> An update is pending approval and will be available for both Ubuntu 10.04 and 10.10. Informal patches are available, however, I prefer to stick to the mainline distribution as much as possible to avoid introducing tightly coupled dependencies.</p><p>Remove telepathy-butterfly and its dependencies.</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo killall telepathy-butterfly<br
/> sudo dpkg --purge telepathy-butterfly<br
/> sudo apt-get install telepathy-haze</div></div><p>Reconfigure your MSN connections and attempt to activate them. You should experience no additional issues.</p><p><strong>References:</strong><br
/> <a
href="https://bugs.launchpad.net/ubuntu/+source/telepathy-butterfly/+bug/513346">https://bugs.launchpad.net/ubuntu/+source/telepathy-butterfly/+bug/513346</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2011/03/21/empathy-reports-network-error-when-connecting-to-msn/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Updating rubygems on Ubuntu</title><link>http://solutions.unixsherpa.com/2011/02/28/updating-ruby-on-ubuntu/</link> <comments>http://solutions.unixsherpa.com/2011/02/28/updating-ruby-on-ubuntu/#comments</comments> <pubDate>Mon, 28 Feb 2011 17:37:25 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Language]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[ubuntu]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=348</guid> <description><![CDATA[If you have ever tried to update rubygems on a base Ubuntu 10.04 or 10.10 install you will have been greeted with: # gem update --system ERROR: &#160;While executing gem ... (RuntimeError) &#160; &#160; gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get. You [...]]]></description> <content:encoded><![CDATA[<p>If you have ever tried to update rubygems on a base Ubuntu 10.04 or 10.10 install you will have been greeted with:</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># gem update --system<br
/> ERROR: &nbsp;While executing gem ... (RuntimeError)<br
/> &nbsp; &nbsp; gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.</div></div><p>You can work around this limitation:</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># gem install rubygems-update<br
/> # /var/lib/gems/1.8/bin/update_rubygems</div></div><p>You will now be able to update rubygems using the standard set of commands.</p><p>Reference:<br
/> <a
href="http://www.tinymission.com/blog/blogengine.web/post/2010/11/03/Updating-to-Rails-30-on-Ubuntu-1004.aspx">http://www.tinymission.com/blog/blogengine.web/post/2010/11/03/Updating-to-Rails-30-on-Ubuntu-1004.aspx</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2011/02/28/updating-ruby-on-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>rsyslog consumes excessive memory when forwarding logs with compression</title><link>http://solutions.unixsherpa.com/2011/01/13/rsyslog-consumes-excessive-memory-when-forwarding-logs-with-compression/</link> <comments>http://solutions.unixsherpa.com/2011/01/13/rsyslog-consumes-excessive-memory-when-forwarding-logs-with-compression/#comments</comments> <pubDate>Thu, 13 Jan 2011 22:10:49 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[forwarding]]></category> <category><![CDATA[rsyslog]]></category> <category><![CDATA[ubuntu]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=334</guid> <description><![CDATA[Issue: rsyslog consumed growing amounts of memory when forwarding over TCP with compression enabled. *.* @@(z1)hostname.domain.tld Cause: The compression flag causes the rsyslog process to allocate, and never release, memory. I have not determined root cause but the likely culprits are zlib or TLS (both involved when compression is enabled in this situation). Resolution: Do [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> rsyslog consumed growing amounts of memory when forwarding over TCP with compression enabled.</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">*.* @@(z1)hostname.domain.tld</div></div><p><strong>Cause:</strong><br
/> The compression flag causes the rsyslog process to allocate, and never release, memory. I have not determined root cause but the likely culprits are zlib or TLS (both involved when compression is enabled in this situation).</p><p><strong>Resolution:</strong><br
/> Do not use compression when forwarding with rsyslog. With the compression flag dropped, I was unable to reproduce the errant behavior.</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">*.* @@hostname.domain.tld</div></div><p><strong>References:</strong><br
/> <a
href="http://www.rsyslog.com/doc/rsyslog_conf_actions.html">http://www.rsyslog.com/doc/rsyslog_conf_actions.html</a></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2011/01/13/rsyslog-consumes-excessive-memory-when-forwarding-logs-with-compression/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>/etc/hosts entries not being used for non-root users</title><link>http://solutions.unixsherpa.com/2010/10/26/etchosts-entries-not-being-used-for-non-root-users/</link> <comments>http://solutions.unixsherpa.com/2010/10/26/etchosts-entries-not-being-used-for-non-root-users/#comments</comments> <pubDate>Tue, 26 Oct 2010 18:13:17 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[gentoo]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=321</guid> <description><![CDATA[Issue: Non-root users are unable to resolve addresses for entries in /etc/hosts. user@gentoo ~ $ ping localhost ping: unknown host localhost Troubleshooting: Potential causes: Malformed content or improper permissions on /etc/hosts Malformed content or improper permissions on /etc/host.conf Malformed content or improper permissions on /etc/nsswitch.conf Diagnostics: One may consider nslookup or dig to be suitable [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> Non-root users are unable to resolve addresses for entries in /etc/hosts.</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">user@gentoo ~ $ ping localhost<br
/> ping: unknown host localhost</div></div><p><strong>Troubleshooting:</strong></p><p><strong><em>Potential causes:</em></strong></p><ul><li> Malformed content or improper permissions on /etc/hosts</li><li> Malformed content or improper permissions on /etc/host.conf</li><li> Malformed content or improper permissions on /etc/nsswitch.conf</li></ul><p><strong><em>Diagnostics:</em></strong><br
/> One may consider nslookup or dig to be suitable diagnostic tools given the use case, however, they are applicable only when troubleshooting DNS server name resolution issues; these tools do not bother to look at /etc/hosts. <strong><a
href="http://linux.die.net/man/1/strace">strace</a></strong> is suitable given the diagnostic task at hand.</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">user@gentoo ~ $ strace -e open ping localhost<br
/> open(&quot;/etc/ld.so.cache&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/lib/libc.so.6&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/resolv.conf&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/resolv.conf&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/nsswitch.conf&quot;, O_RDONLY) &nbsp; &nbsp;= -1 EACCES (Permission denied)<br
/> open(&quot;/etc/ld.so.cache&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/lib/libnss_dns.so.2&quot;, O_RDONLY) &nbsp;= 3<br
/> open(&quot;/lib/libresolv.so.2&quot;, O_RDONLY) &nbsp; = 3<br
/> open(&quot;/etc/host.conf&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp; &nbsp;= 3<br
/> ping: unknown host localhost</div></div><p><strong>Cause:</strong><br
/> As reported by our strace diagnostic, our user has insufficient privileges to read /etc/nsswitch.conf resulting in the file never being utilized for name resolution. In our case, /etc/nsswitch.conf had a permission mode of 600, allowing only the owner (root in our case) read/write access.</p><p><strong>Steps to Reproduce:</strong><br
/> Change the mode of /etc/resolv.conf, /etc/host.conf, /etc/hosts to 600.</p><p><strong>Resolution:</strong><br
/> Change the mode of /etc/nsswitch.conf to 644.</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">user@gentoo ~ $ sudo chomod 644 /etc/nsswitch.conf<br
/> user@gentoo ~ $ strace -e open ping localhost<br
/> open(&quot;/etc/ld.so.cache&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/lib/libc.so.6&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/resolv.conf&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/resolv.conf&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/nsswitch.conf&quot;, O_RDONLY) &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/ld.so.cache&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/lib/libnss_files.so.2&quot;, O_RDONLY) = 3<br
/> open(&quot;/etc/host.conf&quot;, O_RDONLY) &nbsp; &nbsp; &nbsp; &nbsp;= 3<br
/> open(&quot;/etc/hosts&quot;, O_RDONLY|O_CLOEXEC) &nbsp;= 3<br
/> ping: icmp open socket: Operation not permitted<br
/> user@gentoo ~ $ ping -c 2 localhost<br
/> PING localhost (127.0.0.1) 56(84) bytes of data.<br
/> 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.066 ms<br
/> 64 bytes from localhost (127.0.0.1): icmp_req=2 ttl=64 time=0.056 ms<br
/> --- localhost ping statistics ---<br
/> 2 packets transmitted, 2 received, 0% packet loss, time 999ms<br
/> rtt min/avg/max/mdev = 0.056/0.061/0.066/0.005 ms</div></div><p><em>Note: We expect "ping: icmp open socket: Operation not permitted" -- non-root users are not allowed to open raw sockets.</em></p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2010/10/26/etchosts-entries-not-being-used-for-non-root-users/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>xinetd per_source limit issues</title><link>http://solutions.unixsherpa.com/2010/02/09/xinetd-per_source-limit-issues/</link> <comments>http://solutions.unixsherpa.com/2010/02/09/xinetd-per_source-limit-issues/#comments</comments> <pubDate>Tue, 09 Feb 2010 09:32:34 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[xinetd]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=241</guid> <description><![CDATA[Issue: Users note availability issues when accessing services backed by xinetd (subversion, rsync, etc.) Identification: Syslog on the affected server will present multiple lines containing daemon per_source_limit for 0.0.0.0. Cause: You have exceeded per_source_limit defaults imposed by your xinetd configuration. Many distributions include per_source limits that may not be suitable for your use case. Evaluate [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> Users note availability issues when accessing services backed by xinetd (subversion, rsync, etc.)</p><p><strong>Identification:</strong><br
/> Syslog on the affected server will present multiple lines containing <code
class="codecolorer text twitlight"><span
class="text">daemon per_source_limit for 0.0.0.0</span></code>.</p><p><strong>Cause:</strong><br
/> You have exceeded per_source_limit defaults imposed by your xinetd configuration. Many distributions include per_source limits that may not be suitable for your use case. Evaluate your needs carefully.</p><p><strong>Resolution:</strong><br
/> Modify the default setting for per_source in <code
class="codecolorer text twitlight"><span
class="text">/etc/xinetd.conf</span></code> or modify the service specific configuration (recommended) under <code
class="codecolorer text twitlight"><span
class="text">/etc/xinet.d</span></code>. per_source limits may be set as follows:</p><div
class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">per_source = 10</div></div><p>per_source may be set to an integer or UNLIMITED (the number represents the number of connections allowed per host). A sensible fixed value is <strong>always</strong> better than UNLIMITED.</p><p><em>Reference:</em> xinetd.conf(5)</p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2010/02/09/xinetd-per_source-limit-issues/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Replace Pipes with Tabs in a Delimited File</title><link>http://solutions.unixsherpa.com/2009/12/04/replace-pipes-with-tabs-in-a-delimited-file/</link> <comments>http://solutions.unixsherpa.com/2009/12/04/replace-pipes-with-tabs-in-a-delimited-file/#comments</comments> <pubDate>Fri, 04 Dec 2009 20:44:37 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Apple OSX]]></category> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Regular Expression]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Solaris]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[Windows]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=224</guid> <description><![CDATA[Issue: It is often necessary to replace delimiters in a file with a form the receiving party expects. sed is my favorite method of meeting the need. Solution: Replace double pipes with tabs sed 's/&#124;&#124;/ &#160; &#160; &#160; &#160; &#160; /g' file.in &#62; file.out Note: If you find the tab key simply does not work, [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> It is often necessary to replace delimiters in a file with a form the receiving party expects. sed is my favorite method of meeting the need.</p><p><strong>Solution:</strong><br
/> Replace double pipes with tabs</p><div
class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #c20cb9; font-weight: bold;">sed</span> <span
style="color: #ff0000;">'s/||/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /g'</span> file.in <span
style="color: #000000; font-weight: bold;">&gt;</span> file.out</div></div><p><em>Note: If you find the tab key simply does not work, try CTRL+V+I from your terminal.</em><br
/> <em>Reference: <a
href="http://forums.devshed.com/unix-help-35/replacing-tabs-with-spaces-372623.html">http://forums.devshed.com/unix-help-35/replacing-tabs-with-spaces-372623.html</a></em></p><p><strong>Caveats:</strong><br
/> Special consideration (and a regex) will be required for data where delimiters are present in the data itself. Consider your use case and apply appropriately.</p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/12/04/replace-pipes-with-tabs-in-a-delimited-file/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Create a pidof command to find PID numbers easily</title><link>http://solutions.unixsherpa.com/2009/10/07/create-a-pidof-command-to-find-pid-numbers-easily/</link> <comments>http://solutions.unixsherpa.com/2009/10/07/create-a-pidof-command-to-find-pid-numbers-easily/#comments</comments> <pubDate>Wed, 07 Oct 2009 20:30:44 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Apple OSX]]></category> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Solaris]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[init]]></category> <category><![CDATA[pid]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=205</guid> <description><![CDATA[Most UNIX environments include the pidof command which is put to use whenever one needs to quickly determine, by name, the pid of a running program. Apple's Mac OS X lacks the pidof command, however, one may approximate its function with the following shell script: #!/bin/sh ps axc&#124;awk &#34;{if (\$5==\&#34;$1\&#34;) print \$1}&#34;; Save the script [...]]]></description> <content:encoded><![CDATA[<p><em>Most</em> UNIX environments include the pidof command which is put to use whenever one needs to quickly determine, by name, the pid of a running program. Apple's Mac OS X lacks the pidof command, however, one may approximate its function with the following shell script:</p><div
class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666; font-style: italic;">#!/bin/sh</span><br
/> <span
style="color: #c20cb9; font-weight: bold;">ps</span> axc<span
style="color: #000000; font-weight: bold;">|</span><span
style="color: #c20cb9; font-weight: bold;">awk</span> <span
style="color: #ff0000;">&quot;{if (<span
style="color: #000099; font-weight: bold;">\$</span>5==<span
style="color: #000099; font-weight: bold;">\&quot;</span>$1<span
style="color: #000099; font-weight: bold;">\&quot;</span>) print <span
style="color: #000099; font-weight: bold;">\$</span>1}&quot;</span>;</div></div><p>Save the script as /bin/pidof and be sure to set its executable bit:</p><div
class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #c20cb9; font-weight: bold;">chmod</span> a+x <span
style="color: #000000; font-weight: bold;">/</span>bin<span
style="color: #000000; font-weight: bold;">/</span><span
style="color: #c20cb9; font-weight: bold;">pidof</span></div></div> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/10/07/create-a-pidof-command-to-find-pid-numbers-easily/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Strip empty (null) lines from a file</title><link>http://solutions.unixsherpa.com/2009/10/06/strip-empty-null-lines-from-a-file/</link> <comments>http://solutions.unixsherpa.com/2009/10/06/strip-empty-null-lines-from-a-file/#comments</comments> <pubDate>Tue, 06 Oct 2009 18:12:06 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Apple OSX]]></category> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[Solaris]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[sed]]></category> <category><![CDATA[text processing]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=203</guid> <description><![CDATA[sed meets the need; the recipe follows: sed '/^$/d' filename]]></description> <content:encoded><![CDATA[<p>sed meets the need; the recipe follows:</p><div
class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #c20cb9; font-weight: bold;">sed</span> <span
style="color: #ff0000;">'/^$/d'</span> filename</div></div> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/10/06/strip-empty-null-lines-from-a-file/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Disable disk checking during boot on Linux systems</title><link>http://solutions.unixsherpa.com/2009/08/27/disable-disk-checking-during-boot-on-linux-systems/</link> <comments>http://solutions.unixsherpa.com/2009/08/27/disable-disk-checking-during-boot-on-linux-systems/#comments</comments> <pubDate>Thu, 27 Aug 2009 19:39:46 +0000</pubDate> <dc:creator>Dan</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[ext2]]></category> <category><![CDATA[ext3]]></category> <category><![CDATA[ext4]]></category> <category><![CDATA[filesystem]]></category> <category><![CDATA[fsck]]></category><guid
isPermaLink="false">http://solutions.unixsherpa.com/?p=190</guid> <description><![CDATA[Issue: Linux (appropriately) checks filesystems after a number of boot cycles. Cause: This is by design. By default, ext[2,3,4] filesystems are automatically checked every 34 mounts or 180 days (whichever comes first). Resolution: In some cases (ephemeral machine instances in a cloud) this behavior is undesirable. It may be tuned with the following: To disable [...]]]></description> <content:encoded><![CDATA[<p><strong>Issue:</strong><br
/> Linux (appropriately) checks filesystems after a number of boot cycles.</p><p><strong>Cause:</strong><br
/> This is by design. By default, ext[2,3,4] filesystems are automatically checked every 34 mounts or 180 days (whichever comes first).</p><p><strong>Resolution:</strong><br
/> In some cases (ephemeral machine instances in a cloud) this behavior is undesirable. It may be tuned with the following:</p><p>To disable it use the following at the terminal:</p><div
class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tune2fs <span
style="color: #660033;">-c</span> <span
style="color: #000000;">0</span> <span
style="color: #660033;">-i</span> <span
style="color: #000000;">0</span> <span
style="color: #000000; font-weight: bold;">/</span>dev<span
style="color: #000000; font-weight: bold;">/</span>hdXY</div></div><p>Set it to check after 30 system boots</p><div
class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tune2fs <span
style="color: #660033;">-c</span> <span
style="color: #000000;">30</span> <span
style="color: #660033;">-i</span> <span
style="color: #000000;">0</span> <span
style="color: #000000; font-weight: bold;">/</span>dev<span
style="color: #000000; font-weight: bold;">/</span>hdXY</div></div><p>Also ensure that your /etc/fstab file reflects a similar setting. The sixth column should contain a 0 (never check) rather than a 1 (check at boot).</p> ]]></content:encoded> <wfw:commentRss>http://solutions.unixsherpa.com/2009/08/27/disable-disk-checking-during-boot-on-linux-systems/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 1/25 queries in 0.005 seconds using memcached
Object Caching 1660/1706 objects using memcached
Content Delivery Network via Amazon Web Services: S3: unixsherpa-solutions.s3.amazonaws.com

Served from: solutions.unixsherpa.com @ 2012-02-06 15:27:34 -->
