Skip to content

Instantly share code, notes, and snippets.

@rraallvv
Created November 5, 2018 11:48
Show Gist options
  • Select an option

  • Save rraallvv/ff2e4b8eea5a532fb8b77a99d6366a3f to your computer and use it in GitHub Desktop.

Select an option

Save rraallvv/ff2e4b8eea5a532fb8b77a99d6366a3f to your computer and use it in GitHub Desktop.

Revisions

  1. rraallvv created this gist Nov 5, 2018.
    21 changes: 21 additions & 0 deletions curl.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    [Unit]
    Description=CURL daemon
    After=network.target

    [Service]
    User=myuser
    Group=myuser

    #CPUQuota=
    #MemoryLimit=
    #IOReadIOPSMax=
    #IOWriteIOPSMax=

    ExecStart=/usr/bin/curl --limit-rate 2M -L -O -C - https://example.com/somefile
    ExecStop=/usr/bin/killall -w -s 2 /usr/bin/curl
    WorkingDirectory=/home/myuser
    Restart=on-failure
    RestartSec=5

    [Install]
    WantedBy=multi-user.target