How to run dxspider as service.
Create init script with name dxpider as root user in the below path /etc/init.d/
|
1 2 3 4 5 |
cd /etc/init.d/ touch dxspider vi dxspider |
Create script with name dxspider and like as below
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
#!/bin/sh # # chkconfig: 235 60 30 # description: Hamradio - DXSpider Cluster # Created: 24 May 2012 by Yiannis Panagou, SV5FRI # Vesrion: 1.1 - Last Modified: 29/07/2016 # Email: sv5fri@gmail.com # # # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network pidfile=/spider/local/cluster.lck # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 lockfile=/var/lock/subsys/dxspider RETVAL=0 start() { echo "Starting DXSpider Server" /bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" >/dev/tty7& RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dxspider echo return $RETVAL } stop() { echo "Stopping DXSpider Server" killproc /usr/bin/perl RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dxspider echo return $RETVAL } restart() { stop sleep 5 start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status -p $pidfile DXSpider RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit $? ;; esac exit $? |
|
1 |
<span style="font-family: georgia, palatino, serif;">Change the permissions</span> |
|
1 |
chmod +x dxspider |
Remove or disable line from /etc/inittab
|
1 |
DX:2345:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty6 |
For start dx cluster
|
1 |
/etc/init.d/dxspider start |
For stop dxspider
|
1 |
/etc/init.d/dxspider stop |
For check if running dx cluster
|
1 |
/etc/init.d/dxspider status |
If you need help please contact with me
Good luck 🙂
Recent Comments