Score:-2

How do I autostart a program with a "X" second delay after internet connection is established at login (LINUX)

ru flag

I want to use systemd to configure this, do I have to create a custom target and then custom services on it to make this happen? How do I do that?

us flag
Rob
That sounds like an XY problem - See https://meta.serverfault.com/questions/3608/how-can-i-ask-better-questions-on-server-fault
ru flag
What don't you understand about what I just wrote?
in flag
What you write can be understood, however, it is not clear what what you are trying to achieve, and what you asking for suggests this to be an [XY problem](https://xyproblem.info/).
Score:1
es flag

You could try creating a .service that depends on network-online.target and uses ExecStartPre to sleep.

The dependency on network-online.target will mean the service is not started until networking is fully configured.

Using a sleep command in ExecStartPre will delay the execution of ExecStart, which is what would run the real program.

This is a partial .service file that sleeps for 10 seconds after networking is configured.

[Unit]
Requires=network-online.target
After=network-online.target

[Service]
ExecStartPre=/bin/sleep 10
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.