Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 548606 - sys-cluster/heartbeat-3.0.5 requires directory in /var/run
Summary: sys-cluster/heartbeat-3.0.5 requires directory in /var/run
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Deadline: 2020-10-09
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2015-05-04 16:29 UTC by Norman Shulman
Modified: 2020-10-09 07:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Shulman 2015-05-04 16:29:44 UTC
A basic two-node cluster requires directory /var/run/resource-agents.


Reproducible: Always

Steps to Reproduce:
1.$ sudo /etc/ha.d/resource.d/IPaddr 192.168.20.48 start
2.
3.
Actual Results:  
IPaddr[10503]: INFO: Using calculated nic for 192.168.20.48: eth0
IPaddr[10503]: INFO: Using calculated netmask for 192.168.20.48: 255.255.252.0
IPaddr[10503]: DEBUG: Using calculated broadcast for 192.168.20.48: 192.168.23.255
touch: cannot touch '/var/run/resource-agents/IPaddr-eth0': No such file or directory
IPaddr[10489]: ERROR:  Generic error
ERROR:  Generic error


Expected Results:  
$ ip addr show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:77:89:2c brd ff:ff:ff:ff:ff:ff
    inet 192.168.20.46/22 brd 192.168.23.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.20.48/22 brd 192.168.23.255 scope global secondary eth0:0
       valid_lft forever preferred_lft forever


Adding

        checkpath -q -d -m 0755 -o root:root /var/run/resource-agents

to start() in /etc/init.d/heartbeat solves the problem.
Comment 1 Jorge Ventura 2016-05-20 13:55:12 UTC
This is an issue related with the FHS specification. This is what says the spec:

"This directory contains system information data describing the system since it was booted. Files under this directory must be cleared (removed or truncated as appropriate) at the beginning of the boot process. Programs may have a subdirectory of /var/run; this is encouraged for programs that use more than one run-time file. Process identifier (PID) files, which were originally placed in /etc, must be placed in /var/run. The naming convention for PID files is <program-name>.pid. For example, the crond PID file is named /var/run/crond.pid."

It's possible that the installer did create the directory but after the first reboot the directory was deleted.

To workaround is to include one line in the script to create the directory if it doesn't exist.
 
--- heartbeat.gentoo	2016-05-20 13:52:39.677274228 +0000
+++ heartbeat	2016-05-20 00:01:42.853635819 +0000
@@ -28,6 +28,7 @@
 start() {
 	checkpath -q -d -m 0755 -o root:root /var/run/heartbeat
 
+	[ -d /var/run/resource-agents ] || mkdir /var/run/resource-agents
 
 	ebegin "Starting heartbeat"
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-10-09 07:36:48 UTC
Package removed.