I need some guidance here.
I need to start 3 applications at boot time. Or better, I just want to start them automatically. It doesn't need to be at boot time. It may be after the desktop is loaded or whatever. The important is that they only run after the network is up and running.
These services are bitcoind (bitcoin full node), rtorrent and irssi.
I tried to start them in my .profile file but I was having issues because I end up sometimes not being able to login because I en up verifying that these services were messing up with my terminal. What happens is that if I try to start these applications manually the exact same way I have in .profile, within screen, the applications starts but I can't get the prompt back. The cursor stays blinking in terminal for ever and I have to close that terminal window and open another. So, when I reboot my laptop, I end up eventually hanged up after I enter my password in login manager and I can't get into my Desktop.
So, I'm trying to change the approach an instead of using .profile to start applications within screen, I was trying to use cron jobs. But there's another issue here. Network is probably down when cron tries to start them.
So, I'm now trying systemd that allows us to check for network status. But this brings another downside. I've been reading how to do this and seems that the way it can be done, might eventually slow down boot up time once that the boot only continues after all devices are up and with IPs assigned.
Anyway, I can bare with this downside because I don't intend to reboot that many times.
So, I need some guidance on how to achieve this.
For what I read so far, we need to create a service file under
Code: Select all
/etc/systemd/system
Code: Select all
name.of.app.service
Code: Select all
[Unit]
[Service]
[Install]
My goal is to launch irssi, bitcoind and rtorrent within screen, after my network is up and running.
The commands I usually run manually is:
Code: Select all
screen -S rtorrent -fa -D -m rtorrent
screen -S bitcoind -fa -D -m bitcoind
screen -S irssi -fa -D -m irssi
Code: Select all
/etc/systemd/system/rtorrent.service
/etc/systemd/system/bitcoind.service
/etc/systemd/system/irssi.service
Code: Select all
[Unit]
Description=rtorrent for torrent file sharing
Documentation=man:rtorrent
After=
[Service]
ExecStart=screen -S rtorrent -fa -D -m rtorrent
[Install]
(Not sure if anything is neeed/mandatory here)