Skip to content

Instantly share code, notes, and snippets.

@moaoa
Last active November 9, 2024 17:25
Show Gist options
  • Select an option

  • Save moaoa/f6b5b03601ff72aee492e485bca152b0 to your computer and use it in GitHub Desktop.

Select an option

Save moaoa/f6b5b03601ff72aee492e485bca152b0 to your computer and use it in GitHub Desktop.

Revisions

  1. moaoa revised this gist Nov 9, 2024. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion systemd unit
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,14 @@
    // vi /etc/systemd/system/foo.service

    [Unit]
    Description=Run a command at startup

    [Service]
    ExecStart=/path/to/your/command

    [Install]
    WantedBy=multi-user.target
    WantedBy=multi-user.target

    // sudo systemctl enable foo.service

    // sudo systemctl start foo.service
  2. moaoa created this gist Nov 6, 2024.
    8 changes: 8 additions & 0 deletions systemd unit
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    [Unit]
    Description=Run a command at startup

    [Service]
    ExecStart=/path/to/your/command

    [Install]
    WantedBy=multi-user.target