[Dxspider-support] Help & Questions

Dirk Koopman djk at tobit.co.uk
Sat Feb 18 21:39:15 GMT 2017


On 18/02/17 18:30, Ed via Dxspider-support wrote:
>
> #! /bin/sh
>
> ### BEGIN INIT INFO
> # Provides: dxspider
> # Required-Start: $local_fs
> # Required-Stop:
> # Default-Start: 1 2 3 4 5
> # Default-Stop:
> ### END INIT INFO
>
> /spider/perl/cluster.pl     #1 as root
>
> case $1 in
>          start|restart|force-reload)
>          /spider/perl/cluster.pl     #2 as root
>          ;;
>          stop)
>          ;;
>          status)# cluster startup/respawn
> #
>
>  From init::
>
>
> start on runlevel [2345]
> stop on runlevel [!2345]
>
> respawn
>
> exec /bin/su - sysop -c "usr/bin/ perl -w /spider/perl/cluster.pl" 
> /dev/tty6 #3 as sysop (but with incorrect syntax)
>

I must confess that I am a bit confused by this. But if this is meant to 
be a standard init.d start script then, I am afraid, it will not do what 
you want. In it you will have attempted to start the node a total of 
three times. I am also mildly surprised that it does not hang the 
startup of the operating system.

Basically, there are four standard ways of setting this up. The first 
way is easiest, but won't restart if you stop the node. The other three 
will.

1. In the file /etc/rc.local put

/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl > /dev/null&" sysop
exit 0

2. If there is a file called /etc/inittab

Add a line that looks like:

dx:2345:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl > 
/dev/null 2>&1 &" sysop

then run "telinit q"

3. If there is an /etc/init directory and/or you know that you are 
running some kind of ubuntu linux distro <= 14.04 then create a file 
called /etc/init/dxspider.conf and put this into it:

----------------------- cut -----------------------
#DXSpider startup script
#
# This service maintains a copy of dxspider from the point the system is
# started until it is shut down again.

description "DXSpider DX Cluster"
start on filesystem
stop on runlevel S

respawn
umask 0002
exec su -c "/usr/bin/perl -w /spider/perl/cluster.pl >/dev/null 2>&1" sysop
----------------------- cut -----------------------

You will probably need to reboot to make this active.

4. You have Debian Jessie or Ubuntu > 14.04 and/or you know your are 
running systemd (do a ps ax and look at the name of the process for pid 
1). In this case you will need to create a file called 
/etc/systemd/system/dxspider.service and put the following into it:

----------------------- cut -----------------------
[Unit]
Description=DXSpider DX Cluster node
After=network.target auditd.service

[Service]
EnvironmentFile=-/etc/default/dxspider
ExecStart=/spider/perl/cluster.pl > /dev/null 2>&1
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
User=sysop
Group=sysop

[Install]
WantedBy=multi-user.target
Alias=dxspider.service
----------------------- cut -----------------------

Again, the easiest way to check this is working is to reboot.









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20170218/0c793654/attachment.html>


More information about the Dxspider-support mailing list