[Dxspider-support] dxspider and systemd

Stephen Atkins stephen.atkins at gmail.com
Fri Oct 29 21:36:08 BST 2021


Not sure if this has ever been posted before but I finally got my solution
working.  Below is the systemd dxspider service that I put in
/usr/lib/systemd/system/dxspider.service:

# /etc/systemd/system/multi-user.target.wants/dxspider.service
[Unit]
Description=

[Service]
PIDFile=/var/run/dxspider/dxspider.pid
Type=simple
Environment=TERM=linux
User=sysop
TTYPath=/dev/tty8
ExecStart=/bin/sh -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >
/dev/tty7 < /dev/tty8
ExecStartPost=/bin/sh -c 'umask 022; pgrep perl >
/var/run/dxspider/dxspider.pid'
ExecStop=/usr/bin/kill -s QUIT $MAINPID
Restart=always
RestartSec=0
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillSignal=SIGHUP

[Install]
WantedBy=multi-user.target

Once that was done I created the /var/run/dxspider directory and made sure
to give it sysop:spider permissions.

Run systemctl daemon-reload

Then you can start/enable the service.  Your mileage may vary.  If you have
a better way of doing it let me know.  Should also mention that I added
sysop to the tty group so it can output to tty7 and tty8.

One problem could be if you are already running perl scripts before running
dxspider.  The ExecStartPost will grab the wrong pid.  Need to figure out a
better idea for this.

--
Stephen Atkins
VE6CPU/VE6CIC/VE6SU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20211029/9863432e/attachment.htm>


More information about the Dxspider-support mailing list