I just did all the below and prior to reboot all looked good, but once I rebooted Deluge still started immediately., any thoughts on what’s going on?
I would like to create a service to run a script at system startup and would like to know if I have it right before I actually create it.
What I would like is to delay Deluge for 4 minutes at system boot to give my external drives time to actually mount before Deluge starts.
From what I’ve gathered so far is putting the below in a txt file, naming it delugedlay.sh, make it executable, place it in my desired location. Once I do that I need to know if I understand correctly what is needed for a systemd service.
#!/bin/bash
sleep 240 && deluge
Open a terminal in the folder it’s located and run chmod +x delugedelay.sh
What is the output of systemctl start and systemctl status for your service? Does it say that the service ran? If yes, you may want to let your script log to a text file so that you know about any errors or abnormal termination of an executable.
Is deluge on autostart? Also, you may want to note the time at which the deluge delay script starts (systemctl status …) and compare it with the current time to see whether the service ran earlier than expected.
You may be on to something, cause I remember yesterday to remove Deluge from Plasma’s Autostart but did not think to go into preferences in deluge itself and untick autostart.
EDIT:
Actually there is no autostart in Deluge just show tray icon and minimize to tray, hence why it had to be added to Plasma’s Autostart.
It is technically possible to launch an executable after some delay like the above service. However I am not aware if deluge independently auto starts before the service can run with a delay.
I was still working on reproducing it last night. But I don’t know all the requirements of the OP, I don’t know about the dependencies, it may be that another service is a startup requirement for Deluge itself. (Sorry for any mistakes or misunderstandings, my English is not made for flawless communication, so I’m looking for support on Google Translate - my German ist better, we can try that )
After=deluge.service – Service X starts AFTER Deluge
Wants=deluge.service – Service X wants Deluge to be active
It would not work under certain circumstances:
Unfulfilled fundamental dependencies for Deluge
Incorrect systemd unit configuration for Deluge:
Missing or incorrect ExecStart: The command to start Deluge (ExecStart=) is incorrect, points to a non-existent executable file or contains incorrect arguments.
Missing [Install] section: If the [Install] section (especially WantedBy=multi-user.target) is missing or incorrect, the service will not be started automatically at boot time after systemctl enable deluge.service.
Incorrect Type=: If the Type= of the service (e.g. simple, forking, notify) does not correctly match the behavior of the Deluge daemon, systemd can misinterpret the status of the service, which leads to start errors or timeouts.