<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>G-Loaded Journal &#187; Security</title>
	<atom:link href="http://www.g-loaded.eu/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Thu, 02 Sep 2010 17:01:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Using setenforce to switch SELinux mode wisely</title>
		<link>http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/</link>
		<comments>http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 15:05:14 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SELinux]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1401</guid>
		<description><![CDATA[setenforce is a command line utility that is used to switch the mode SELinux is running in from enforcing to permissive and vice versa without requiring a reboot. Lately, I&#8217;ve started experimenting again with SELinux on a live system. The default targeted SELinux policy, as usual, needs some adjustment to work with a custom server [...]]]></description>
			<content:encoded><![CDATA[<p><strong>setenforce</strong> is a command line utility that is used to switch the mode <a href="http://en.wikipedia.org/wiki/Security-Enhanced_Linux">SELinux</a> is running in from <em>enforcing</em> to <em>permissive</em> and vice versa without requiring a reboot. Lately, I&#8217;ve started experimenting again with <strong>SELinux</strong> on a live system. The default targeted SELinux policy, as usual, needs some adjustment to work with a custom server configuration. So, I created some custom policy modules and loaded them onto the live system in order to test if my &#8220;<em>allow</em>&#8221; rules were effective.<br />
<span id="more-1401"></span><br />
In such cases, the system administrator must be wise enough to minimize risk. SELinux is not a forgiving feature. If the custom policy blocks the execution of a software and SELinux is running in enforcing mode, then the software does not run. That&#8217;s what SELinux is about after all.</p>
<p>The <strong>permissive mode</strong> exists mainly for testing. In this mode, the auditing mechanism generates notices (<em>AVC Denials</em>) about the action/event that was blocked, but without actually blocking that action/event. It is just a way to check what would have happened if SELinux had been running in <em>enforcing</em> mode. There are two ways to switch SELinux to permissive mode. One is to configure it through its configuration file (<code>/etc/selinux/config</code> on <abbr title="Enterprise Linux">EL</abbr>) to start in permissive mode on boot and the other is to use the aforementioned utility, <em>setenforce</em>, to switch modes while the system is live.</p>
<p>When performing tests on a live system, I usually take all precautions to minimize the risk of failure and usually, if possible, I am around to monitor the progress of the test. But, this time I had to use the custom SELinux policy for some days to see if it is actually effective or it needs further fine-tuning.</p>
<p><strong>The Mistake</strong>: I used setenforce to set SELinux into permissive mode (<code>/usr/sbin/setenforce 0</code>). setenforce is for <strong>temporary changes</strong> and it is definitely not suitable for testing the policy for a long period of time. This is because if for any reason the system reboots, SELinux will be set back into the mode that is defined into its configuration file. The mode set by <code>setenforce</code> does not survive a reboot. So, if the custom policy happens to be incomplete, it will block the server&#8217;s normal operation after the reboot. And such reboots can happen&#8230;</p>
<p>This is exactly what I experienced yesterday. The datacenter on which my virtual server is hosted had problems with its main power supply. This caused one hour of downtime. But G-Loaded&#8217;s outage was a lot greater, because my custom SELinux policy was incomplete. SELinux was started in enforcing mode, so my faulty policy blocked my www service.</p>
<p>This should be a lesson to anyone who performs tests on live systems. The Right Thing&trade; was simple: boot the server into permissive mode and do as many tests as desired. I can blame the datacenter for the one-hour downtime, but for the 7-hour unavailability of <a href="http://www.g-loaded.eu">G-Loaded</a> I am the only one to blame.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/">Using setenforce to switch SELinux mode wisely</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2006/12/20/selinux-audit-reports-script/" rel="bookmark">SELinux audit reports script</a></li>
<li><a href="http://www.g-loaded.eu/2008/11/26/using-a-switch-to-prevent-system-shutdownrebootsuspend/" rel="bookmark">Using a switch to prevent system shutdown/reboot/suspend</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/09/server-upgraded-to-fedora-6/" rel="bookmark">Server upgraded to Fedora 6</a></li>
<li><a href="http://www.g-loaded.eu/2008/06/18/use-the-alternatives-system-to-switch-to-a-custom-firefox-release/" rel="bookmark">Use the Alternatives System to switch to a custom Firefox release</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/25/how-to-integrate-seaudit-report-in-logwatch/" rel="bookmark">How to integrate seaudit-report in logwatch</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Be cautious with Notepad++</title>
		<link>http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/</link>
		<comments>http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 23:15:07 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Editors]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1319</guid>
		<description><![CDATA[I use Microsoft Windows 7 RC on my main desktop computer since June 2009. Since there was no Windows ports of my favorite editors in Linux (gedit on Fedora/CentOS), I decided to use Notepad++, an open-source source code editor and Notepad replacement, which is released as free-software. Soon I realized that this application was too [...]]]></description>
			<content:encoded><![CDATA[<p>I use <strong>Microsoft Windows 7 RC</strong> on my main desktop computer since June 2009. Since there was no Windows ports of my favorite editors in Linux (<a href="http://projects.gnome.org/gedit/">gedit</a> on <strong>Fedora</strong>/<strong>CentOS</strong>), I decided to use <a href="http://notepad-plus.sourceforge.net">Notepad++</a>, an open-source source code editor and Notepad replacement, which is released as free-software. Soon I realized that this application was too far from being robust as I experienced random freezes quite often. I continued to use the application hoping that any issues would be resolved in the near future.<br />
<span id="more-1319"></span><br />
I recall that there was a time, when I <strong>lost</strong> all of my <strong>open</strong> and <strong>unsaved</strong> documents due to an application freeze. After checking their bug trackers and help forums on <strong>SourceForge</strong> for a solution to the problem, I found out that the cause of the issues was one of the <strong>plugins</strong>, but noone was really sure which one of them. The suggested solution was to try to reproduce the issue, by enabling the plugins in turns. At that time, I did not have the necessary free time to experiment with the editor, so I had disabled the whole plugin system, just to be sure that my data would be safe. And my data has indeed been safe since that day.</p>
<p>Two days ago, I decided to upgrade the program to the latest version and, during installation and without giving it much thought, I installed the application&#8217;s plugin system and a plugin called &#8220;<em>Document Monitor</em>&#8221; or something like that. This morning my system experienced another <em>Notepad++</em> freeze, but this time a <em>Virtual Machine</em>, which run under <a href="http://virtualbox.org">VirtualBox</a>, froze too. There was heavy disk I/O at that time. The virtual system was meant to be an RPM Build Server, so I re-deployed it just to be sure that everything was all right without risking any data loss during the freeze.</p>
<p>After that, I disabled Notepad++&#8217;s plugin system entirely and do not intend to use any of the plugins ever again. I continue to use the core editor, but I am also looking for alternatives. So far, <a href="http://www.pspad.com/">PSpad</a> (freeware) and <a href="http://www.carthagosoft.net/twistpad/">TwistPad</a> (commercial editor at a very reasonable price) are among the candidates. I mainly use a text editor for plain text and HTML documents, Python, PHP and BASH scripts. Any other suggestions are welcome and appreciated.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/">Be cautious with Notepad++</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2007/10/18/dictionary-lookups-anywhere/" rel="bookmark">Dictionary Lookups Anywhere</a></li>
<li><a href="http://www.g-loaded.eu/2007/10/19/zim-a-desktop-wiki/" rel="bookmark">Zim &#8211; a Desktop Wiki</a></li>
<li><a href="http://www.g-loaded.eu/2007/07/29/best-practices-of-software-licensing/" rel="bookmark">Best Practices of Software Licensing</a></li>
<li><a href="http://www.g-loaded.eu/2006/01/05/break-out-of-frames-wordpress-plugin/" rel="bookmark">Break-Out-Of-Frames WordPress Plugin</a></li>
<li><a href="http://www.g-loaded.eu/2007/01/31/wordpress-meta-tags-plugin-stable-release/" rel="bookmark">WordPress Meta Tags plugin stable release</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/17/be-cautious-with-notepad/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Free Personal Email Certificates Program discontinued by Thawte</title>
		<link>http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/</link>
		<comments>http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 16:07:34 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Certificates]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1298</guid>
		<description><![CDATA[I&#8217;ve been using Thawte&#8216;s free personal email digital certificates for some years now. Unfortunately, Thawte discontinues the Personal E-mail Certificate and Web of Trust services. All issued certificates will be revoked on November 16th 2009 and the particular services will no longer be available after that date. Read more information about this matter here. All [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <strong>Thawte</strong>&#8216;s free personal email digital certificates for some years now. Unfortunately, Thawte discontinues the <strong>Personal E-mail Certificate</strong> and <strong>Web of Trust</strong> services. All issued certificates will be <strong>revoked</strong> on November 16th 2009 and the particular services will no longer be available after that date.<br />
<span id="more-1298"></span><br />
Read more information about this matter <a href="https://siteseal.thawte.com/support/index.html?page=content&#038;id=SO12658" rel="nofollow">here</a>.</p>
<p> All current certificate owners will be offered a <em>free one-year digital certificate</em> for email encryption/signing by <strong>Verisign</strong>. Renewals of those certificates will cost $19.95 per email address (at the time of writing), while using Thwate&#8217;s program you could just pay an initial fee in order to verify your identity and then get your name to appear on all your digital certificates that had been issued by that service for your email addresses.</p>
<p>Although I believe that taking back what you have given is usually either a sign of greed and irresponsibility or proof of bad planning, I do understand Thawte&#8217;s given reasons for such a decision:</p>
<blockquote><p>[...] for the ever-expanding standards and technology requirements will outpace our ability to maintain these services at the high level of quality we require [...]</p></blockquote>
<p>When it comes to <em>secure authentication</em> or <em>digital identification</em>, <strong>quality is not negotiable</strong>. On the other hand, what is questionable is the high price of the certificate renewals, which do not involve any kind of paperwork and could also require no human intervention at all, provided that the initial verification of the certificate owner&#8217;s identity and the renewal procedure itself are being done correctly.</p>
<p>I am quite certain that there are other Certificate Authorities that offer free email certificates or email certificate programs at reasonable prices, but I didn&#8217;t have the time to check. Perhaps, a reader who has done some research on this could contribute some info.</p>
<p>I&#8217;ll be posting about this topic again soon. Stay tuned!</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/">Free Personal Email Certificates Program discontinued by Thawte</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2007/11/22/root-certificate-programs-the-root-of-all-trust/" rel="bookmark">Root Certificate Programs &#8211; The root of all trust</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/" rel="bookmark">Be your own Certificate Authority (CA)</a></li>
<li><a href="http://www.g-loaded.eu/2007/06/23/high-traffic-on-the-email-server/" rel="bookmark">High traffic on the email server</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/07/email-notifications-from-a-linux-system/" rel="bookmark">Email Notifications from a Linux System</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/18/free-software-inc/" rel="bookmark">Free Software Inc.</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/12/free-personal-email-certificates-program-discontinued-by-thawte/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Reclaiming the forums from bots</title>
		<link>http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/</link>
		<comments>http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 11:37:50 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=1251</guid>
		<description><![CDATA[It&#8217;s been a long time since the last time I had done any cleaning in the G-Loaded Forums. I use the forums for further discussion about the published content, since the comments are disabled after a period of time. During the last months the place had been left at the hands of bots. But this [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since the last time I had done any cleaning in the <a href="http://www.g-loaded.eu/forums/">G-Loaded Forums</a>. I use the forums for further discussion about the published content, since the comments are disabled after a period of time. During the last months the place had been left at the hands of bots. But this is no more. Below you will find information about all the actions I took in order to cleanup the user accounts created by bots and prevent further automatic user registrations.<br />
<span id="more-1251"></span><br />
The software I use is <a href="http://bbpress.org">bbPress</a>. In order to protect the forums from automatic user registrations, I installed the <a href="http://www.gospelrhys.co.uk/plugins/bbpress-plugins/recaptcha-bbpress-plugin">recaptcha plugin</a>. This requires registration at <a href="http://recaptcha.net/">recaptcha.net</a> and the creation of a private/puplic key pair, but the procedure is straightforward, so I won&#8217;t go into the details.</p>
<p>Second, but equally important, is the deletion of user accounts created automatically by bots. The characteristic of those accounts is that they have never posted any posts. All the advertising information existed in the user profile fields. After inspecting the database structure for a while, I deleted all the users with zero number of posts from the <em>bb_users</em> table using the following MySQL query:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> bb_users <span style="color: #993333; font-weight: bold;">WHERE</span> id <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span><span style="color: #66cc66;">&#40;</span>u<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">&#41;</span>
    <span style="color: #993333; font-weight: bold;">FROM</span> bb_users <span style="color: #993333; font-weight: bold;">AS</span> u <span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> bb_posts <span style="color: #993333; font-weight: bold;">AS</span> p <span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>poster_id<span style="color: #66cc66;">=</span>u<span style="color: #66cc66;">.</span>id <span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> bb_usermeta <span style="color: #993333; font-weight: bold;">AS</span> m <span style="color: #993333; font-weight: bold;">ON</span> m<span style="color: #66cc66;">.</span>user_id<span style="color: #66cc66;">=</span>u<span style="color: #66cc66;">.</span>id
    <span style="color: #993333; font-weight: bold;">WHERE</span> m<span style="color: #66cc66;">.</span>meta_value <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;%<span style="color: #000099; font-weight: bold;">\&quot;</span>member<span style="color: #000099; font-weight: bold;">\&quot;</span>%&quot;</span> <span style="color: #993333; font-weight: bold;">AND</span> p<span style="color: #66cc66;">.</span>post_time <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NULL</span>
  <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> bb_non_posters
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Then I deleted all the user metadata for non-existent users from the <em>bb_usermeta</em> table using the following query:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> bb_usermeta <span style="color: #993333; font-weight: bold;">WHERE</span> umeta_id <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> umeta_id <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span> m<span style="color: #66cc66;">.</span>umeta_id
    <span style="color: #993333; font-weight: bold;">FROM</span> bb_usermeta <span style="color: #993333; font-weight: bold;">AS</span> m <span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> bb_users <span style="color: #993333; font-weight: bold;">AS</span> u <span style="color: #993333; font-weight: bold;">ON</span> u<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">=</span>m<span style="color: #66cc66;">.</span>user_id
    <span style="color: #993333; font-weight: bold;">WHERE</span> u<span style="color: #66cc66;">.</span>id <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NULL</span>
  <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> bb_unlinked_meta
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The above will eventually delete all user accounts and their meta data when no posts have been published by those users. That means that even legitimate users with no posts will be deleted, but such users are very rare. If your account has been deleted, please make a new one.</p>
<p>Normally, further clean up of the tags tables should be performed, but since those users hadn&#8217;t posted anything, it is very unlikely that they had created any tags, so I think the above are just enough.</p>
<p>Using the above queries I got rid of thousands of user accounts created by bots. Make sure you have backed up your database before attempting any manipulation of the data.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/">Reclaiming the forums from bots</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2010/04/07/permanently-delete-posts-topics-bbpress/" rel="bookmark">Permanently remove deleted posts and topics in bbPress</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/06/manage-users-from-the-command-line/" rel="bookmark">User management from the command line</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/12/lock-out-a-user-after-n-failed-login-attempts/" rel="bookmark">Lock out a user after N failed login attempts</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/01/bot-allow-content-and-cc-configurator-plugin-updates/" rel="bookmark">Bot-Allow-Content and CC-Configurator plugin updates</a></li>
<li><a href="http://www.g-loaded.eu/2007/04/25/bbpress-for-wordpress/" rel="bookmark">bbPress for WordPress</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/10/06/reclaiming-the-forums-from-bots/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>A stolen bike</title>
		<link>http://www.g-loaded.eu/2009/03/28/a-stolen-bike/</link>
		<comments>http://www.g-loaded.eu/2009/03/28/a-stolen-bike/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 14:09:56 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Cycling]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=962</guid>
		<description><![CDATA[Two weeks ago, my MTB got stolen. It was a cheap bike and, after 700Km during the last 5 months without any servicing, it was in a really bad shape. I used a cheap lock to &#8220;protect&#8221; it. I relied on the bike&#8217;s bad condition and assumed that noone would want to steal it. So, [...]]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago, my <a href="http://en.wikipedia.org/wiki/Mountain_bike" title="Mountain Bike">MTB</a> got stolen. It was a cheap bike and, after 700Km during the last 5 months without any servicing, it was in a really bad shape. I used a cheap lock to &#8220;protect&#8221; it. I relied on the bike&#8217;s bad condition and assumed that noone would want to steal it. So, it was a piece of cake for someone to pick it up one night. This article goes into some of the details of that experience and outlines the minimum countermeasures you can take against bike theft.<br />
<span id="more-962"></span><br />
If I don&#8217;t take into account the last 12 years, I&#8217;ve always had a bike as a child or teenager. Noone had ever stolen one from me before. This is why I took the current situation very hard.</p>
<p>I use the bike to move around in the city, go to the university, library, gym, etc. During the last five months, it had become a necessity. But there is one really big problem. It is impossible to keep it indoors. I have to leave it outside, in the wild.</p>
<p>Now, I have bought a new MTB. I really wouldn&#8217;t like it to be stolen again. That would make me extremely pissed off. During the last two weeks, I&#8217;ve read various articles about bicycle theft, about ways to properly protect a bike, et cetera. I even went out late one night, as if I was about to steal a bike, just trying to see things through a thief&#8217;s eyes and realize what the weaknesses of leaving a bike outdoors are.</p>
<p>I won&#8217;t be writing about any things you do not know already. A determined soul or a sophisticated thief will always get what he wants. There is nothing you can do about it. But, the good news is that sophisticated thieves are not really interested in bike theft, unless we are talking about a very expensive bike. On the other hand, a very expensive bike is very unlikely to be left outdoors at night. Sophisticated thieves are of course a problem, but not the real problem. The real problem in such cases is opportunist thieves. Usually, such thieves do not know whether the bike they have stolen is an expensive or a cheap one, whether it is in good condition or not, and they usually sell it for almost nothing afterwards. They are usually victims themselves. Junkies or people in great need for some money who would steal anything that is an easy target.</p>
<p>Below you will find a very small checklist with the things one should take into account in order to protect a bike which is left outside. These of course represent my own thoughts after evaluating all the things I&#8217;ve read and seen. If you can contribute to the list, be my guest. I will really appreciate it.</p>
<ul>
<li><strong>Buy a real lock</strong>. Most of the locks I&#8217;ve seen in bike shops are not locks upon which you can rely for more than a few minutes. From what I&#8217;ve read, it is very easy even for opportunist thieves to bypass or destroy them and get your bike. I would say that 40-50 EUR should be the absolute minimum you should spend on a lock. Don&#8217;t waste your money on 10-15 EUR locks. Invest. Go to a motorcycle shop and buy the best lock you can afford. If you cannot afford a decent lock, buy a cheaper bike. It is (collectively) cheaper to upgrade your bike&#8217;s parts at a later time than to upgrade a lock. Opportunist thieves aim for easy targets. If they realize that the strength of the lock is beyond their abilities, they will not bother with your bike and go for an easier target. Of course, you should <strong>learn how to properly lock your bike</strong>. Even if you use the best of the locks, but attach the bike to a fixed object which is not reliable, then a thief would destroy the fixed object and get your bike. All locks can be opened. But some locks are a lot harder to be opened. Get a good lock and lock your bike wisely. It is the least you can do to protect it. I now use a lock from <a href="http://www.abus.de/">ABUS</a>.</li>
<li><strong>A thief needs privacy</strong>. Do not give it to him. Locking up the bike in a shady corner may be an advantage for the thief as he will be able to work on the lock being unnoticed for a longer period of time. Make him feel uncomfortable with the spot at which you have locked your bike. Make him feel unsafe. A regular opportunist thief will not bother to steal the bike if he does not feel secure enough.</li>
</ul>
<p>Of course, this list is not complete. There are many other things you can do to further protect the bike, but most of them really depend on the location and any other <strong>special conditions</strong> of the area you live in. Bike theft is a problem of all big cities. I will be glad to read your thoughts on what else should be done in order to protect a bike which is left outdoors at night.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/03/28/a-stolen-bike/">A stolen bike</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2009/10/08/operating-systems-do-not-matter-any-more/" rel="bookmark">Operating Systems do not matter any more</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/03/28/a-stolen-bike/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Critical vulnerability in Adobe Reader</title>
		<link>http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/</link>
		<comments>http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 12:39:48 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Advisory]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=923</guid>
		<description><![CDATA[Users of Adobe Reader should be aware of a newly discovered critical vulnerability in the Reader which could potentially allow a third party to execute arbitrary code, according to this security advisory by Adobe. The vulnerability affects several versions of Adobe Reader (and Acrobat). Adobe states that updates addressing the issue will be available by [...]]]></description>
			<content:encoded><![CDATA[<p>Users of <strong>Adobe Reader</strong> should be aware of a newly discovered <strong>critical vulnerability</strong> in the Reader which could potentially allow a third party to execute arbitrary code, according to this <a href="http://www.adobe.com/support/security/advisories/apsa09-01.html">security advisory</a> by Adobe. The vulnerability affects several versions of Adobe Reader (and Acrobat). Adobe states that updates addressing the issue will be available by March 11th (!!) for version 9. Updates for earlier versions of the affected software will follow. The advisory also indicates that exploits might already exist, so, take note and have a critical eye on what you download and open in the Reader.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/">Critical vulnerability in Adobe Reader</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2007/10/19/adobe-reader-8-for-linux/" rel="bookmark">Adobe Reader 8 for Linux</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/03/evince-instead-of-adobe-reader-in-linux/" rel="bookmark">Evince instead of Adobe Reader in Linux</a></li>
<li><a href="http://www.g-loaded.eu/2007/07/29/best-practices-of-software-licensing/" rel="bookmark">Best Practices of Software Licensing</a></li>
<li><a href="http://www.g-loaded.eu/2006/11/01/bot-allow-content-and-cc-configurator-plugin-updates/" rel="bookmark">Bot-Allow-Content and CC-Configurator plugin updates</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/02/20/critical-vulnerability-in-adobe-reader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Shred changes default number of passes to 3</title>
		<link>http://www.g-loaded.eu/2009/01/23/shred-changes-default-number-of-passes-to-3/</link>
		<comments>http://www.g-loaded.eu/2009/01/23/shred-changes-default-number-of-passes-to-3/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 23:22:14 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Patch]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=869</guid>
		<description><![CDATA[I thought it would be nice to share with you that I received a comment from Pádraig Brady, member of the GNU Core Utilities (coreutils) maintainers team, on yesterday&#8217;s post about effective data wiping saying that he has decreased shred&#8216;s default number of passes from 25 to 3, as shown in this git commit. The [...]]]></description>
			<content:encoded><![CDATA[<p>I thought it would be nice to share with you that I received a comment from <a href="http://www.pixelbeat.org/">Pádraig Brady</a>, member of the <a href="http://savannah.gnu.org/projects/coreutils">GNU Core Utilities</a> (coreutils) maintainers team, on yesterday&#8217;s <a href="http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/">post about effective data wiping</a> saying that he has decreased <strong>shred</strong>&#8216;s default <em>number of passes</em> from 25 to 3, as shown in this <a href="http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=83ae1bdd44432055e2cb6cf1502d1cc0cd651746">git commit</a>. The commit&#8217;s comment reveals that there has been a discussion on this matter:</p>
<pre class="codesnp">
shred: change default number of overwrites from 25 to 3

* src/shred.c: The concensus is that a default of 3
passes is appropriate for current drive technologies.
* src/TODO: Reference Paul Eggert's suggestion
of enhancing shred to conform to DoD 5220 rules.
</pre>
<p>I would like to publicly thank Pádraig for the feedback. There are times that the open source development model takes me by surprise.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/01/23/shred-changes-default-number-of-passes-to-3/">Shred changes default number of passes to 3</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2010/04/16/software-that-detects-violations-of-open-source-licenses/" rel="bookmark">Software that detects violations of open source licenses</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/01/23/shred-changes-default-number-of-passes-to-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Effective data wiping with a single complete overwrite</title>
		<link>http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/</link>
		<comments>http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 21:56:16 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=863</guid>
		<description><![CDATA[One of the first things computer users, who are concerned with security, learn is that multiple overwrites with ones and zeros are required in order to wipe data to the extent that it is unrecoverable by any forensic analysis tools. According to this article on Softpedia, on which I stumbled while searching for something else, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first things computer users, who are concerned with security, learn is that <em>multiple overwrites</em> with ones and zeros are required in order to <strong>wipe data</strong> to the extent that it is <strong>unrecoverable</strong> by any <em>forensic analysis tools</em>. According to this <a href="http://news.softpedia.com/news/Data-Wiping-Myth-Put-to-Rest-102376.shtml">article on Softpedia</a>, on which I stumbled while searching for something else, the above statement is a <strong>myth</strong>; a busted myth actually. Experts now claim that a <em>single complete overwrite</em> is enough to render the data unrecoverable.</p>
<p>Refering to the myth, the author of the article writes:</p>
<blockquote><p>
One of the reasons behind this idea is that the positioning of a hard disk drive&#8217;s head is not precise enough to ensure that the data is overwritten with new information from the exact same byte.
</p></blockquote>
<p>A <a href="http://www.springerlink.com/content/408263ql11460147/">study</a>, published on December 2008, claims that tests performed on both last and older generation hard drives have shown that recovering even a single byte of data after a complete overwrite is practically impossible.</p>
<blockquote><p>
Security researchers from Heise Security, who have reviewed the paper presented at last year&#8217;s edition of the International Conference on Information Systems Security (ICISS), explain that a single byte of data can be recovered with a 56 percent probability, but only if the head is positioned precisely eight times, which in itself has a probability of occurring of only 0.97%.
</p></blockquote>
<p>Since I was one of those who believed the statement about the multiple overwrites, I found the article very interesting. I haven&#8217;t read the study itself though.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/">Effective data wiping with a single complete overwrite</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2010/03/29/partition-misalignment-slows-4096-byte-sector-hard-drives/" rel="bookmark">Partition Misalignment Slows Down 4096-Byte Sector Hard Disks</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/" rel="bookmark">Choosing a format for data backups &#8211; tar vs cpio</a></li>
<li><a href="http://www.g-loaded.eu/2009/01/23/shred-changes-default-number-of-passes-to-3/" rel="bookmark">Shred changes default number of passes to 3</a></li>
<li><a href="http://www.g-loaded.eu/2005/12/20/build-a-single-native-kernel-module/" rel="bookmark">Build a single native kernel module</a></li>
<li><a href="http://www.g-loaded.eu/2005/12/14/the-complete-fedora-kernel-headers/" rel="bookmark">The Complete Fedora Kernel Headers</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Using the mod_dav_svn SVNParentPath directive with multiple authz files</title>
		<link>http://www.g-loaded.eu/2008/12/18/using-the-mod_dav_svn-svnparentpath-directive-with-multiple-authz-files/</link>
		<comments>http://www.g-loaded.eu/2008/12/18/using-the-mod_dav_svn-svnparentpath-directive-with-multiple-authz-files/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 03:02:50 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=805</guid>
		<description><![CDATA[I&#8217;ve been using the mod_dav_svn module for Apache, part of the subversion distribution package, in order to make several SVN repositories available over the HTTP protocol for quite some time now. More specifically, I use a multi-repository setup under the same virtualhost by using the SVNParentPath directive of mod_dav_svn. Also, the authorization policy is enforced [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the <strong>mod_dav_svn</strong> module for <a href="http://httpd.apache.org/">Apache</a>, part of the <a href="http://subversion.tigris.org/">subversion</a> distribution package, in order to make several <em>SVN repositories</em> available over the HTTP protocol for quite some time now. More specifically, I use a <em>multi-repository</em> setup under the same virtualhost by using the <code>SVNParentPath</code> directive of <em>mod_dav_svn</em>. Also, the <strong>authorization policy</strong> is enforced by <strong>mod_authz_svn</strong> by using one general <em>authz</em> file (<code>AuthzSVNAccessFile</code>) containing the <em>policy rules</em>. In case the user is not authorized to access the resource, basic HTTP authentication is used to finally grant or deny access to the user. Everything works as expected, but let&#8217;s see if this is practical too&#8230;<br />
<span id="more-805"></span><br />
It is obvious that using such a setup, all <a href="http://subversion.tigris.org/">subversion</a> repositories share the same authz file. This is fine in most circumstances, but it presumes that one person or a small team of administrators will practically be able to manage the authorization policy inside the authz file, unless you grant read/write access to everyone, which is not very likely. And this is where problems begin to arise. What happens if there are 1000 development teams and thousands of requests to the admin team asking for modifications on the authz file? This is almost chaos. On the other hand, suppose that each SVN repository belongs to a development team which wishes to manage its repo&#8217;s authorization policy itself. What can be done in such a case? Unfortunately, nothing that will not require some coding. mod_authz_svn cannot handle multiple authorization files when a multi-repository configuration (<code>SVNParentPath</code>) is used.</p>
<p>One way to resolve the issue mentioned above is to inject our own authorization code into the relevant phase of the HTTP request processing. What this authorization code is going to do is to dynamically construct the path to the requested repository&#8217;s authz file, parse the authz file, determine the level of access the user may get in accordance to the HTTP request type and, finally, return an OK or an error code back to Apache.</p>
<p>Tonight I&#8217;ve spent several hours on this. Although, the appropriate approach would be to patch mod_authz_svn, I am not that excited about such an approach as I would need several days of hard work to modify an existing apache module. Instead, I have almost finished an <strong>authorization handler</strong> and an <strong>authz file parser</strong> (only basic syntax is supported), both written in python, which can be used by apache with the help of <a href="http://www.modpython.org/">mod_python</a>.</p>
<p>This is not finished yet. As you might have assumed I need this piece of code for <a href="http://www.codetrax.org/projects/project-codetrax">Project CodeTRAX</a>. Although, I had decided not to release anything related to that project until it is finished, I might make an exception and release this piece of python code in order to get some valuable feedback about if and how secure it is.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2008/12/18/using-the-mod_dav_svn-svnparentpath-directive-with-multiple-authz-files/">Using the mod_dav_svn SVNParentPath directive with multiple authz files</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2009/10/05/strange-mod_dav_svn-error/" rel="bookmark">Strange mod_dav_svn error</a></li>
<li><a href="http://www.g-loaded.eu/2005/10/03/search-a-string-in-multiple-files/" rel="bookmark">Search for a string in multiple files</a></li>
<li><a href="http://www.g-loaded.eu/2010/04/12/a-change-of-plans-regarding-a-web-based-vcs-manager/" rel="bookmark">A change of plans regarding a web-based VCS manager</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/" rel="bookmark">VeriTAR &#8211; Verify checksums of files within a TAR archive</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/04/optimize-and-compress-css-files/" rel="bookmark">Optimize and Compress CSS Files</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2008/12/18/using-the-mod_dav_svn-svnparentpath-directive-with-multiple-authz-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>delayed-shutdown initscript</title>
		<link>http://www.g-loaded.eu/2008/11/28/delayed-shutdown-initscript/</link>
		<comments>http://www.g-loaded.eu/2008/11/28/delayed-shutdown-initscript/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 00:36:42 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.g-loaded.eu/?p=684</guid>
		<description><![CDATA[delayed-shutdown is an initscript that delays the shutdown (runlevel 0) or reboot (runlevel 6) procedure as long as a pre-defined lock file exists. The goal is to create a mechanism, which can be used by programs that perform critical operations that must not be interrupted, in order to delay system shutdown until these programs have [...]]]></description>
			<content:encoded><![CDATA[<p><strong>delayed-shutdown</strong> is an initscript that delays the shutdown (runlevel 0) or reboot (runlevel 6) procedure as long as a pre-defined <strong>lock</strong> file exists. The goal is to create a mechanism, which can be used by programs that perform critical operations that must not be interrupted, in order to delay system shutdown until these programs have finished their job. The whole concept is very simple: the program, for instance a backup script, creates a pre-defined lockfile at a pre-defined location (<em>lock is acquired</em>). If a shutdown or reboot is initiated while the script is still active, <strong>delayed-shutdown</strong> checks for the existence of the lockfile and, if it finds it, it delays the system shutdown/reboot while it periodically continues to check for the existence of the lockfile. Whenever the backup script finishes its operation and deletes the lockfile (<em>lock is released</em>), <strong>delayed-shutdown</strong> lets the system go down.</p>
<p><strong>Note</strong>: in a previous post I had tried to <a href="http://www.g-loaded.eu/2008/11/26/using-a-switch-to-prevent-system-shutdownrebootsuspend/">implement a shutdown/reboot/suspend prevention switch</a> using various <em>inefficient methods</em>. After receiving some pointers from members of the Linux-Greek-Users mailing list, I studied the initscript mechanism and wrote this solution. It has been tested on Fedora only and is <strong>released for Fedora and RedHat based linux distributions</strong>. I would appreciate feedback about its compatibility with <strong>Debian</strong> or <strong>Gentoo</strong> based systems.<br />
<span id="more-684"></span></p>
<h4>Manual Installation</h4>
<p>As user &#8216;<strong>root</strong>&#8216; follow the instructions to install the file in your <em>initscripts directory</em>:</p>
<pre class="console">
cp delayed-shutdown /etc/init.d/
chmod +x /etc/init.d/delayed-shutdown
</pre>
<p>For RedHat and relatives run:</p>
<pre class="console">
chkconfig --add delayed-shutdown
</pre>
<p>For Debian and relatives run:</p>
<pre class="console">
update-rc.d delayed-shutdown defaults
</pre>
<h4>Manual De-installation</h4>
<p>If for any reason you need to remove &#8216;delayed-shutdown&#8217; from your system do the following:</p>
<p>For RedHat and relatives run:</p>
<pre class="console">
chkconfig --del delayed-shutdown
</pre>
<p>For Debian and relatives run:</p>
<pre class="console">
update-rc.d -f delayed-shutdown remove
</pre>
<p>Delete the initscript:</p>
<pre class="console">
rm /etc/init.d/delayed-shutdown
</pre>
<h4>Usage</h4>
<p>In order to delay the shutdown process until your software finishes its operation, you should create the no-shutdown lock file:</p>
<pre class="codesnp">
/var/lock/noshutdown.lock
</pre>
<p>Then let your software do its job and, when finished, delete the no-shutdown lock file. In case of a script that would be:</p>
<pre class="codesnp">
lockfile /var/lock/noshutdown.lock
... [script is working] ...
rm -f /var/lock/noshutdown.lock
</pre>
<h4>Test</h4>
<p>A test script, test.sh, is included in the distribution package. In order perform a test, do the following:</p>
<ul>
<li>Make sure you have installed the <strong>delayed-shutdown</strong> initscript as described in the &#8220;installation section.</li>
<li>Run test.sh: <strong>./test.sh &#038;</strong></li>
<li>Reboot or shutdown the machine</li>
</ul>
<p><code>Test.sh</code> will acquire the lock, sleep in the background for 90 seconds and then release the lock. The shutdown/reboot procedure will continue after the lock has been released.</p>
<h4>Download</h4>
<p>All versions of the software, including the latest stable release, are available from the development web site&#8217;s <a href="http://www.codetrax.org/projects/delayed-shutdown/files">download area</a>.</p>
<h4>Misc</h4>
<p>The initscript <em>delayed-shutdown</em> is released under the terms of the MIT license.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2008/11/28/delayed-shutdown-initscript/">delayed-shutdown initscript</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>


<h4>Related Articles</h4>

<ul><li><a href="http://www.g-loaded.eu/2008/11/26/using-a-switch-to-prevent-system-shutdownrebootsuspend/" rel="bookmark">Using a switch to prevent system shutdown/reboot/suspend</a></li>
<li><a href="http://www.g-loaded.eu/2009/10/08/redmine-deployment-delayed/" rel="bookmark">Redmine deployment delayed</a></li>
<li><a href="http://www.g-loaded.eu/2009/10/30/selinux-setenforce-mode/" rel="bookmark">Using setenforce to switch SELinux mode wisely</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/12/lock-out-a-user-after-n-failed-login-attempts/" rel="bookmark">Lock out a user after N failed login attempts</a></li>
<li><a href="http://www.g-loaded.eu/2009/02/01/xen-domu-using-dynamic-ip-and-hostname/" rel="bookmark">Xen DomU using dynamic IP and hostname</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2008/11/28/delayed-shutdown-initscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>
