{"id":2292471,"date":"2016-10-09T15:56:13","date_gmt":"2016-10-09T13:56:13","guid":{"rendered":"http:\/\/www.sv5fri.eu\/?p=2292471"},"modified":"2019-01-04T11:08:30","modified_gmt":"2019-01-04T09:08:30","slug":"dxspider-init-script-for-raspbian","status":"publish","type":"post","link":"https:\/\/www.sv5fri.eu\/?p=2292471","title":{"rendered":"Run DxSpider as service on the Raspbian"},"content":{"rendered":"<p class=\"first-para\">How to run dxspider as service.<\/p>\n<p>Create init script with name dxpider as root user in the below path \/etc\/init.d\/<\/p>\n<div id=\"crayon-57fa4ca49986a824790697\" class=\"crayon-syntax crayon-theme-familiar crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd \/etc\/init.d\n\n\ntouch dxspider\n\n\nvi dxspider<\/pre>\n<p>Create script with name <strong>dxspider<\/strong> and like as below<\/p>\n<\/div>\n<p><!--more--><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#!\/bin\/sh\n### BEGIN INIT INFO\n# Provides:             dxspider\n# Required-Start:       $all\n# Required-Stop:        $all\n# Default-Start:        2 3 5\n# Default-Stop:         0 1 6\n# Short-Description:    Dxspider\n### END INIT INFO\n#\n# Created by SV5FRI\n# Email: sv5fri@gmail.com\n#\n##############################\nNAME=dxspider\nDESC=dxspider\n\nPID=`ps -A |grep perl|awk '{print $1}'`\n\nset -e\n\npidfile=\/spider\/local\/cluster.lck\n\n. \/lib\/lsb\/init-functions\n\nRETVAL=0\n\n# See how we were called.\n\n  start()\n   {\n        echo  \"Starting DxSpider Server...\"\n        \/bin\/su - sysop -c \"\/usr\/bin\/perl -w \/spider\/perl\/cluster.pl\" &gt; \/dev\/tty3&amp;\n        RETVAL=$?\n        [ $RETVAL -eq 0 ] &amp;&amp; touch \/var\/lock\/dxspider\n        echo\n        return $RETVAL\n   }\n\n  stop()\n   {\n        echo \"Stopping DxSpider Server...\"\n        pkill -F  $pidfile\n        RETVAL=$?\n        [ $RETVAL -eq 0 ] &amp;&amp; rm -f \/var\/lock\/dxspider\n        echo\n        return $RETVAL\n        }\n\n  restart()\n   {\n       stop\n       start\n   }\n\ncase \"$1\" in\n  start)\n     start\n  ;;\n\n  stop)\n    stop\n  ;;\n\n  restart)\n    restart\n  ;;\n  status)\n        if [ -f \"$pidfile\" ];\n         then\n                echo \"Dxspider is running with pid: $PID\"\n         else\n                echo \"Dxspider is stopped...\"\n#        RETVAL=$?\n      fi\n  ;;\n\n  *)\n       echo $\"Usage: $0 {start|stop|restart|status}\"\n        exit $?\n        ;;\nesac\nexit $?<\/pre>\n<p>&nbsp;<\/p>\n<p>Change permissions<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">chmod +x dxspider<\/pre>\n<p>Remove or disable line from \/etc\/inittab<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">DX:2345:respawn:\/bin\/su -c \"\/usr\/bin\/perl -w \/spider\/perl\/cluster.pl\" sysop &gt;\/dev\/tty6<\/pre>\n<p>Start dxspider<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\/etc\/init.d\/dxspider start<\/pre>\n<p>Stop dxspider<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\/etc\/init.d\/dxspider stop<\/pre>\n<p>Check if running dxspider<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">\/etc\/init.d\/dxspider status<\/pre>\n<p>If you need help please contact with me<\/p>\n<p>Good luck<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to run dxspider as service. Create init script with name dxpider as root user in the below path \/etc\/init.d\/ cd \/etc\/init.d touch dxspider vi dxspider&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[280,3],"tags":[84,44,40,28,78,83,81,82,43,42,79,56,80],"class_list":["post-2292471","post","type-post","status-publish","format-standard","hentry","category-linux","category-projects","tag-debian","tag-dxcluster","tag-dxspider","tag-ham-radio","tag-init-file","tag-jessie-3","tag-pi-3","tag-pi3","tag-raspberry","tag-raspberry-pi","tag-raspbian","tag-run-dxspider-as-service","tag-systemctl"],"_links":{"self":[{"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=\/wp\/v2\/posts\/2292471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2292471"}],"version-history":[{"count":1,"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=\/wp\/v2\/posts\/2292471\/revisions"}],"predecessor-version":[{"id":4318076,"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=\/wp\/v2\/posts\/2292471\/revisions\/4318076"}],"wp:attachment":[{"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2292471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2292471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sv5fri.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2292471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}