Page MenuHomeVyOS Platform

Cluster heartbeat doesn't start b.c lack of directory /run/heartbeat/
Closed, ResolvedPublicBUG

Description

Heartbeat service can't start because it lacks of directory /run/heartbeat after configuration

Configuration:

set interfaces ethernet eth1 address '203.0.113.1/24'
set system host-name 'r11-roll'

set cluster group l2tp primary 'r11-roll'
set cluster group l2tp secondary 'r12-lts'
set cluster group l2tp service '203.0.113.254/24/eth1'
set cluster interface 'eth1'
set cluster keepalive-interval '5000'
set cluster monitor-dead-interval '20000'
set cluster pre-shared-secret 'foo'

Service heartbeat status:

vyos@r11-roll:~$ sudo systemctl status heartbeat.service
● heartbeat.service - Heartbeat High Availability Cluster Communication and Membership
     Loaded: loaded (/lib/systemd/system/heartbeat.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-12-17 15:44:06 EET; 4min 5s ago
       Docs: man:heartbeat(8)
             http://www.linux-ha.org/wiki/Documentation
    Process: 6613 ExecStart=/usr/lib/heartbeat/heartbeat -f (code=exited, status=4)
   Main PID: 6613 (code=exited, status=4)
        CPU: 61ms

sudo systemctl restart heartbeat.service

Reason:

Dec 17 15:48:19 r11-roll heartbeat[7044]: [7044]: ERROR: socket_wait_conn_new: trying to create in /run/heartbeat/register bind:: No such file or directory
Dec 17 15:48:19 r11-roll heartbeat[7044]: [7044]: debug: Cannot open registration socket at /run/heartbeat/register

To get in working needs to add this directory and restart the service:

sudo mkdir /run/heartbeat/
sudo systemctl restart heartbeat.service

vyos@r11-roll:~$ sudo systemctl status heartbeat.service
● heartbeat.service - Heartbeat High Availability Cluster Communication and Membership
     Loaded: loaded (/lib/systemd/system/heartbeat.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-12-17 17:04:14 EET; 9min ago
       Docs: man:heartbeat(8)
             http://www.linux-ha.org/wiki/Documentation
   Main PID: 7465 (heartbeat)
      Tasks: 4 (limit: 4695)
     Memory: 7.1M
        CPU: 243ms
     CGroup: /system.slice/heartbeat.service
             ├─7465 heartbeat: master control process
             ├─7469 heartbeat: FIFO reader
             ├─7470 heartbeat: write: mcast eth1
             └─7471 heartbeat: read: mcast eth1

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.4-rolling-202112160318
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)