I think there are multiple things one could do to achieve this, but am uncertain which way to go:

  • if you use systemd create a systemd service I guess? How to create systemd service that runs a (python) script on startup?
  • some files similar to .bashrc always run on system startup/boot?; use this if you are less fancy / have no systemd
  • aubeynarf@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    22 hours ago

    In general, the kernel starts one program after it finishes booting, and that process starts everything else; traditionally it’s called ‘init’. systemd is a “modern” replacement.

    Different distributions and unix variants use different “init” patterns and tooling; so find out what your distribution is using.

    Those patterns are designed for this use case but you need to understand the different phases of startup and where your script should fit in.

    What distro are you using?