Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Run a program at startup

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Alma110
Posts: 3
Joined: 2020-09-23 10:48

[Software] Run a program at startup

#1 Post by Alma110 »

Hello.
I just installed debian 11. I want a program to start when I start Debian.
That it is not necessary to open a session, for the program to be executed.
Greetings.

Random_Troll
Posts: 444
Joined: 2023-02-07 13:35
Been thanked: 105 times

Re: [Software] Run a program at startup

#2 Post by Random_Troll »

/etc/rc.local can be used to run commands at the end of the multi-user "runlevel" (.target under systemd).

Make the file executable to enable the script, as per the comments in the file.
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 604
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 141 times

Re: [Software] Run a program at startup

#3 Post by fabien »

There is also the possibility to use cron.

man 5 crontab

Code: Select all

              string         meaning
              ------         -------
              @reboot        Run once, at startup.

User avatar
NorthEast
Posts: 348
Joined: 2018-11-18 04:35
Has thanked: 12 times
Been thanked: 30 times

Re: [Software] Run a program at startup

#4 Post by NorthEast »

Alma110 wrote: 2023-05-28 16:38 Hello.
I just installed debian 11. I want a program to start when I start Debian.
That it is not necessary to open a session, for the program to be executed.
Greetings.
A systemd script in a service unit file will accomplish this. Many examples online.

User avatar
kent_dorfman766
Posts: 529
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 56 times
Been thanked: 69 times

Re: [Software] Run a program at startup

#5 Post by kent_dorfman766 »

The systemd unit approach is more appropriate than the crontab approach. rc.local is fine, but creating a distinct unit service file makes you learn how.

Post Reply