I’m looking for an FAQ or info on how the auto start an application after a reboot (say coming back up after a power outage).
My application is written in Perl and I had it running 24/7 in older versions of SUSE 9 and 10. I am now using SUSE 12.3.
The application is called DX Spider (a ham radio application but no RPM). The method I used to autostart the application was with the following line in /etc/inittab:
DX:235:respawn:/bin/su -c “/usr/bin/perl -w /spider/perl/cluster.pl” sysop >/dev/tty7
How do I accomplish this in SUSE 12.3? Adding the above line to /etc/inittab appears to do nothing - at perl app does not start up after a reboot.
Thanks for the help (or telling me where to look).
Must you be root or does it run as a standard user?
For root authority, you can add a command line to be ran as root to the file /etc/init.d/boot.local. It is possible to add a line to a bash script you own and have it ran when you log in as a normal user. The locations differ between KDE and GNOME, so we need to know the desktop that you are using.
Thanks for the suggestions. If I type as root the text in a terminal I get “now such file or directory” /bin/su
Either the owner or root can start the perl application. But it is best to run it as the owner to avoid potential security issues.
I have installed sysedit and will do the others you suggested as well. If I understand this, I need a bash script to start this app after a power cycle (when I am unavailable to enter any commands). So the script is run as root during boot up (in after.local), but I want it to execute as the owner. Still not sure exactly how to do this, but I’ll keep learning.
James,
Thanks for the script. I was away for awhile and just got back to working this problem. The script starts the dxspider.service via systemctl start/status. The service starts automatically if I shut it down normally - perfect. However, it does not start the service after a reboot. I noticed there is a lock file and if it exists, the perl script will not start. So now I need to be sure to remove the lock file when bringing up the service. Can I do that in dxspider.service script, before the ExecStart statement? Can I add the following line: rm /spider/local/cluster.lck
James,
Thanks for the script. I was away for awhile and just got back to
working this problem. The script starts the dxspider.service via
systemctl start/status. The service starts automatically if I shut it
down normally - perfect. However, it does not start the service after a
reboot. I noticed there is a lock file and if it exists, the perl
script will not start. So now I need to be sure to remove the lock file
when bringing up the service. Can I do that in dxspider.service script,
before the ExecStart statement? Can I add the following line: rm
/spider/local/cluster.lck