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
Create script with name dxspider and like as below
#!/bin/sh ### BEGIN INIT INFO # Provides: dxspider # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 5 # Default-Stop: 0 1 6 # Short-Description: Dxspider ### END INIT INFO # # Created by SV5FRI # Email: sv5fri@gmail.com # ############################## NAME=dxspider DESC=dxspider PID=`ps -A |grep perl|awk '{print $1}'` set -e pidfile=/spider/local/cluster.lck . /lib/lsb/init-functions RETVAL=0 # See how we were called. start() { echo "Starting DxSpider Server..." /bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" > /dev/tty3& RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/dxspider echo return $RETVAL } stop() { echo "Stopping DxSpider Server..." pkill -F $pidfile RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/dxspider echo return $RETVAL } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) if [ -f "$pidfile" ]; then echo "Dxspider is running with pid: $PID" else echo "Dxspider is stopped..." # RETVAL=$? fi ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit $? ;; esac exit $?
Change permissions
chmod +x dxspider
Remove or disable line from /etc/inittab
DX:2345:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty6
Start dxspider
/etc/init.d/dxspider start
Stop dxspider
/etc/init.d/dxspider stop
Check if running dxspider
/etc/init.d/dxspider status
If you need help please contact with me
Good luck
Thank you for this excellent script. I tried it out and it does work, but I am not able to see spots when I start DXSpider as a service. I can log in to the console, but no spots appear.
As a service is it loading the connect scripts?
Thank you! 73 – Rich, K0PIR
Nevermind I see it just took a few minutes. Thank you, this is just what is needed!
Trying to use it i have this error:
root@raspberrypi:/etc/init.d# ./dxspider start
[….] Starting dxspider (via systemctl): dxspider.serviceFailed to start dxspider.service: Unit dxspider.service failed to load: No such file or directory.
failed!
root@raspberrypi:/etc/init.d#
Please…. could you help me?
Hello Ruben,
Could you please give more details for your installation. Because from output error something is wrong with path (directory or file)
Is possible to send the path where is the Dxspider installation
73, de Yiannis, SV5FRI
Hi
Also could you please check if exist following path’s
/usr/bin/perl
/spider/perl/cluster.pl
also check if exist the Symbolic Link /spider if doesn’t exist please to create
ln -s ~sysop/spider /spider
Please check installation tutorial for Dxspider
I will wait for your answer
73, de Yiannis, SV5FRI
Hello Yiannis,
I am trying to get the dxspider up and running but I got stuck.
DXspider does not startup as service.
when I am running the script by hand root@raspberrypi:/etc/init.d/dxspider start I get the error
/etc/init.d/dxspider: 24: /etc/init.d/dxspider: ./lib/lsb/init-functions: Permission denied
The file is there
root@raspberrypi:/etc/init.d# ls -l | grep dxspider
-rwxr-xr-x 1 root root 1392 Aug 13 14:02 dxspider
Do you have any idea what I am doing wrong here?
I am running debian version 8.0
I followed the instructions by the letter from k0pir and his youtube
Dear Johan,
Sorry for late to answer you but just return from my vacation.
could you please send me your script to checking
Hello Yiannis
The contents of the dxspider file.
It is copy and pasted from the file into nano
#!/bin/sh
### BEGIN INIT INFO
# Provides: dxspider
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Dxspider
### END INIT INFO
#
# Created by SV5FRI
# Email: sv5fri@gmail.com
#
##############################
NAME=dxspider
DESC=dxspider
PID=`ps -A |grep perl|awk ‘{print $1}’`
set -e
pidfile=/spider/local/cluster.lck
./lib/lsb/init-functions
RETVAL=0
# See how we were called.
start()
{
echo “Starting DxSpider Server…”
/bin/su – sysop -c “/usr/bin/perl -w /spider/perl/cluster.pl” > /dev/tt$
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/dxspider
echo
return $RETVAL
}
stop()
{
echo “Stopping DxSpider Server…”
pkill -F $pidfile
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/dxspider
echo
return $RETVAL
}
restart()
{
stop
start
}
case “$1” in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
if [ -f “$pidfile” ];
then
echo “Dxspider is running with pid: $PID”
else
echo “Dxspider is stopped…”
# RETVAL=$?
fi
;;
*)
echo $”Usage: $0 {start|stop|restart|status}”
exit $?
;;
esac
exit $?
Could you please try to running the following script.
If you have problem to running it please inform me and I will send to you the script via e-mail.
#!/bin/sh
### BEGIN INIT INFO
# Provides: dxspider
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Dxspider
### END INIT INFO
#
# Create from Yiannis Panagou
# Email: ypanagou@gmail.com
#
##############################
NAME=dxspider
DESC=dxspider
PID=`ps -A |grep perl|awk ‘{print $1}’`
set -e
pidfile=/spider/local/cluster.lck
. /lib/lsb/init-functions
RETVAL=0
# See how we were called.
start()
{
echo “Starting DxSpider Server…”
/bin/su – sysop -c “/usr/bin/perl -w /spider/perl/cluster.pl” > /dev/tty3&
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/dxspider
echo
return $RETVAL
}
stop()
{
echo “Stopping DxSpider Server…”
pkill -F $pidfile
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/dxspider
echo
return $RETVAL
}
restart()
{
stop
start
}
case “$1” in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
if [ -f “$pidfile” ];
then
echo “Dxspider is running with pid: $PID”
else
echo “Dxspider is stopped…”
# RETVAL=$?
fi
;;
*)
echo $”Usage: $0 {start|stop|restart|status}”
exit $?
;;
esac
exit $?
I have dxspider running as sysop user….is it ok if i just change the path in the script to “point” in the right /sysop/dxspider directory?
Pse let me know
Dear Mike,
If your installation is a different path you can change the the parameters in the scrip.
please informed if you need help
73 Yiannis, SV5FRI
AFAIK, the file ‘cluster.lck’ used in $pidfile is located at /spider/local_data, not at /spider/local .
So, the script is unable to stop the service.
73, Mikel EA2CW
Hi Mikel,
You have right but this script it was for old Dxspider without mojo.
please use the below
Create file with name dxspider.service to the following path /usr/lib/systemd/system/
and paste the below lines
[Unit]
Description= Dxspider DXCluster service
After=network.target
[Service]
Type=simple
User=sysop
Group=sysop
ExecStart= /usr/bin/perl -w /spider/perl/cluster.pl
# Comment out line below for logging everything to /var/log/messages
StandardOutput=null
Restart=always
[Install]
WantedBy=multi-user.target
With systemctl command enabled and start like
systemctl enable dxspider.service
systemctl start dxspider.service