I would like to run the python script, when I startup the Linux machine. How can I do so? I don't need the user to login the OS to start the script. (The user is password protected.)
Generic method – add the script to
if your python interpreter is under
if your script is marked executable (+x).
Note that some systems use
On systemd systems, rc.local might be ignored completely.
Create a service unit,
[Unit] Description=Script name [Service] ExecStart=/path/to/script.py [Install] WantedBy=multi-user.target
Tell systemd to start the script on boot with