{"id":115,"date":"2013-04-07T00:21:02","date_gmt":"2013-04-07T00:21:02","guid":{"rendered":"http:\/\/digital-madness.in\/blog\/?p=115"},"modified":"2018-02-17T18:01:41","modified_gmt":"2018-02-17T18:01:41","slug":"ubuntu-12-04-upstart-at-boot-services","status":"publish","type":"post","link":"http:\/\/digital-madness.in\/blog\/2013\/ubuntu-12-04-upstart-at-boot-services\/","title":{"rendered":"Ubuntu (12.04) upstart (at boot) services"},"content":{"rendered":"<h3>Creating your own ubuntu upstart service:<\/h3>\n<ul>\n<li><span style=\"line-height: 13px;\">Create a shell script. (Name it whatever you want. Here I am assuming it to be &#8220;autorun.sh&#8221;)<br \/>\n<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvi autorun.sh\r\n<\/pre>\n<\/li>\n<li><span style=\"line-height: 13px;\">Copy the shell script to <\/span><em style=\"line-height: 13px;\"><strong>\/etc\/init.d\/<br \/>\n<\/strong><\/em><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo cp autorun.sh \/etc\/init.d\/autorun.sh\r\n<\/pre>\n<\/li>\n<li>Make the script executable.\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo chmod +x \/etc\/init.d\/autorun.sh\r\n<\/pre>\n<\/li>\n<li><span style=\"line-height: 13px;\">Update the upstart table of ubuntu by creating symbolic links.<br \/>\n<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo update-rc.d autorun.sh defaults\r\n<\/pre>\n<\/li>\n<li>Done.<\/li>\n<\/ul>\n<h3>To boot an already existing script:<\/h3>\n<ul>\n<li><span style=\"line-height: 13px;\"><span style=\"line-height: 13px;\"><span style=\"line-height: 13px;\">Update the upstart table of ubuntu by creating symbolic links.<\/span><\/span><\/span>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo update-rc.d service_name defaults\r\n<\/pre>\n<\/li>\n<li>Enable a disabled upstart service\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo update-rc.d service_name enable\r\n<\/pre>\n<\/li>\n<\/ul>\n<h3>To remove a script from upstart:<\/h3>\n<ol>\n<li><span style=\"line-height: 13px;\"><span style=\"line-height: 13px;\"><span style=\"line-height: 13px;\">(option-1)<br \/>\nupdate the table and remove the script(not necessary)<\/span><\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo update-rc.d -f autorun.sh remove\r\nsudo rm \/etc\/init.d\/autorun.sh (optional)\r\n<\/pre>\n<\/li>\n<li>(option-2)<br \/>\nDisable the service from boot<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo update-rc.d -f autorun.sh disable\r\n<\/pre>\n<\/li>\n<li>(option-3)<br \/>\nif there is a configuration file for the script in <strong><strong>\/etc\/init\/<\/strong><\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo echo 'manual' | \/etc\/init\/scriptname.override\r\nsudo update-rc.d -f scriptname remove\r\n<\/pre>\n<\/li>\n<\/ol><p>Reference:\u00a0<a title=\"Ubuntu Start Cookbook\" href=\"http:\/\/upstart.ubuntu.com\/cookbook\/\" target=\"_blank\" rel=\"noopener\">ubuntu upstart cookbook<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating your own ubuntu upstart service: Create a shell script. (Name it whatever you want. Here I am assuming it to be &#8220;autorun.sh&#8221;) vi autorun.sh Copy the shell script to \/etc\/init.d\/ sudo cp autorun.sh \/etc\/init.d\/autorun.sh Make the script executable. sudo chmod +x \/etc\/init.d\/autorun.sh Update the upstart table of ubuntu by creating symbolic links. sudo update-rc.d&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[43],"tags":[31,32,30,10,29],"class_list":["post-115","post","type-post","status-publish","format-standard","hentry","category-ubuntu","tag-boot","tag-linux","tag-services","tag-ubuntu","tag-upstart"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/posts\/115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/comments?post=115"}],"version-history":[{"count":9,"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":199,"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions\/199"}],"wp:attachment":[{"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/digital-madness.in\/blog\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}