<?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>LifeUML &#187; add</title>
	<atom:link href="http://lifeuml.com/tag/add/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifeuml.com</link>
	<description>from actor, to actors..</description>
	<lastBuildDate>Fri, 28 Aug 2009 10:17:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding/Removing Shell scripts</title>
		<link>http://lifeuml.com/addingremoving-shell-scripts/</link>
		<comments>http://lifeuml.com/addingremoving-shell-scripts/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 09:57:30 +0000</pubDate>
		<dc:creator>TuyenT</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[start up]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lifeuml.com/?p=100</guid>
		<description><![CDATA[Original Post From: StringOfThoughts
Adding a script
First of all write a script, say test.sh and put it in the directory /etc/init.d . Next we need to make it executable so.

$ sudo chmod +x test.sh

You can check if the script is working by issuing

$ sudo ./test.sh

Assuming the script is working as expected, to make the script run [...]]]></description>
			<content:encoded><![CDATA[<p>Original Post From: <a href="http://stringofthoughts.wordpress.com/2009/04/16/adding-removing-shell-scripts-ubuntu-810/" target="_blank">StringOfThoughts</a></p>
<p><strong>Adding a script</strong></p>
<p>First of all write a script, say test.sh and put it in the directory /etc/init.d . Next we need to make it executable so.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x test.sh</pre></div></div>

<p>You can check if the script is working by issuing</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>test.sh</pre></div></div>

<p>Assuming the script is working as expected, to make the script run at startup / reboot.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> test.sh start <span style="color: #000000;">99</span> <span style="color: #000000;">2</span> <span style="color: #000000;">3</span> <span style="color: #000000;">4</span> <span style="color: #000000;">5</span> . <span style="color: #000000; font-weight: bold;">//</span> Run at startup
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> test.sh start <span style="color: #000000;">1</span> <span style="color: #000000;">0</span> <span style="color: #000000;">6</span> .      <span style="color: #000000; font-weight: bold;">//</span> Run at reboot</pre></div></div>

<p>Just <strong>a reminder there is dot (.)</strong> at the end of command.  Don’t forget that!! Now you are done adding a script to run at startup.</p>
<p><strong>Removing a script.</strong></p>
<p>Just a reminder for new users, don’t just go to /etc/init.d and delete the script file <img src='http://lifeuml.com/smilies/yahoo_smiley.gif' alt='&#58;&#41;' class='wp-smiley' width='18' height='18' title='&#58;&#41;' /> that wouldn’t help and may cause you trouble. We need a nice little application called rcconf (Debian runlevel configuration tool)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> rcconf</pre></div></div>

<p>then run rcconf (only root can run rcconf)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> rcconf</pre></div></div>

<p><img class="aligncenter size-full wp-image-101" title="rcconf1" src="http://lifeuml.com/wp-content/uploads/2009/06/rcconf1.jpg" alt="rcconf1" width="300" height="188" /></p>
<p>The interface is very simple. It lists the scripts so all you need to do is find out where is your script and toggle “*” using space bar  and then select OK. That’s all. The script is now removed but still present in the directory /etc/init.d but you can safely delete it now.</p>
<p><em><strong>Bonus:</strong></em> My shell script to launch JasperServer at start up:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;">#!/bin/sh</span>
<span style="color: pink;">/</span>opt<span style="color: pink;">/</span>jasperserver<span style="color: pink;">-</span><span style="color: #000000;">3.1</span><span style="color: pink;">/</span>jasperctl.sh start</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lifeuml.com/addingremoving-shell-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
