{"id":449,"date":"2016-02-15T18:44:50","date_gmt":"2016-02-15T18:44:50","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=449"},"modified":"2016-02-15T18:48:47","modified_gmt":"2016-02-15T18:48:47","slug":"stopping-a-process-from-crapping-out-without-pidcrap","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/02\/15\/stopping-a-process-from-crapping-out-without-pidcrap\/","title":{"rendered":"Stopping a process from crapping out without PIDcrap"},"content":{"rendered":"<p>So, this one comes up a lot too. So you wanna run a process, and you don&#8217;t want it to crap out, you don&#8217;t want PIDCrap or any other lunatic solution that simply doesn&#8217;t work 100%. Well, welcome to until.<\/p>\n<p>I&#8217;ve been executing a ruby script that does some stuff with fog.<\/p>\n<pre>\r\nruby my-fog-cloud-files-container-deleter-thingy.rb\r\n<\/pre>\n<p>but, it keeps <strong> crapping out with lots of errors<\/strong><\/p>\n<p>I figured crapout no more and nabbed this handy snippet, credit to good ole stackoverflow<\/p>\n<pre>\r\nuntil ruby my-fog-cloud-files-container-deleter-thingy.rb; do\r\n    echo \"Server 'myserver' crashed with exit code $?.  Respawning..\" >&2\r\n    sleep 1\r\ndone\r\n<\/pre>\n<p>Now when it craps out, it continues where it left off.. nice, simple, elegant.<\/p>\n<p>I don&#8217;t know what kind of error handling swiftly and pyrax has available in built, but this is a nice way to do it. Theoretically this oneliner might be of use for turbolift as well as any other batch like job which might end prematurely before the code deploy finishes. I wish cloud init had something like this<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, this one comes up a lot too. So you wanna run a process, and you don&#8217;t want it to crap out, you don&#8217;t want PIDCrap or any other lunatic solution that simply doesn&#8217;t work 100%. Well, welcome to until. &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/02\/15\/stopping-a-process-from-crapping-out-without-pidcrap\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,14,9,7,29],"tags":[],"class_list":["post-449","post","type-post","status-publish","format-standard","hentry","category-cloud","category-cloud-files","category-linux","category-management-tools","category-monitoring"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=449"}],"version-history":[{"count":2,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions"}],"predecessor-version":[{"id":451,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions\/451"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}