Skip to content

Instantly share code, notes, and snippets.

@elyscape
Last active November 3, 2023 03:59
Show Gist options
  • Select an option

  • Save elyscape/7e8c1ea7ae186fd780c59e8cbf87181d to your computer and use it in GitHub Desktop.

Select an option

Save elyscape/7e8c1ea7ae186fd780c59e8cbf87181d to your computer and use it in GitHub Desktop.

Revisions

  1. elyscape revised this gist Nov 3, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion heartbeat.service
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,6 @@ Requisite=network.target network-online.target
    [Service]
    Type=oneshot
    EnvironmentFile=/etc/default/heartbeat
    ExecStart=/usr/bin/curl -fsS --retry 3 ${ENDPOINT}
    ExecStart=/usr/bin/curl -fsS -m 10 --retry 3 ${ENDPOINT}
    StandardOutput=null
    DynamicUser=true
  2. elyscape revised this gist Nov 3, 2023. 2 changed files with 4 additions and 2 deletions.
    File renamed without changes.
    6 changes: 4 additions & 2 deletions heartbeat.service
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    [Unit]
    Description=Heartbeat
    After=network.target network-online.target
    Requisite=network.target network-online.target

    [Service]
    Type=oneshot
    EnvironmentFile=/etc/heartbeat.conf
    EnvironmentFile=/etc/default/heartbeat
    ExecStart=/usr/bin/curl -fsS --retry 3 ${ENDPOINT}
    StandardOutput=null
    User=nobody
    DynamicUser=true
  3. elyscape revised this gist Jan 3, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion heartbeat.service
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,6 @@ Description=Heartbeat
    [Service]
    Type=oneshot
    EnvironmentFile=/etc/heartbeat.conf
    ExecStart=/bin/curl -fsS --retry 3 ${ENDPOINT}
    ExecStart=/usr/bin/curl -fsS --retry 3 ${ENDPOINT}
    StandardOutput=null
    User=nobody
  4. elyscape revised this gist Jan 3, 2018. No changes.
  5. elyscape created this gist Jan 3, 2018.
    1 change: 1 addition & 0 deletions heartbeat.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ENDPOINT=https://whatever
    9 changes: 9 additions & 0 deletions heartbeat.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    [Unit]
    Description=Heartbeat

    [Service]
    Type=oneshot
    EnvironmentFile=/etc/heartbeat.conf
    ExecStart=/bin/curl -fsS --retry 3 ${ENDPOINT}
    StandardOutput=null
    User=nobody
    9 changes: 9 additions & 0 deletions heartbeat.timer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    [Unit]
    Description=Send heartbeat every 5 minutes

    [Timer]
    OnCalendar=*-*-* *:00/5:00
    Persistent=true

    [Install]
    WantedBy=timers.target