Bug 1327051 - /var/run/beaker is not created on initial install of beaker-server on RHEL7
Summary: /var/run/beaker is not created on initial install of beaker-server on RHEL7
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Community
Component: general   
(Show other bugs)
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: 24.0
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Keywords: Patch, Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-14 07:42 UTC by Dan Callaghan
Modified: 2017-02-21 18:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-21 18:51:23 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Dan Callaghan 2016-04-14 07:42:22 UTC
Steps to Reproduce:
1. Do a fresh install of beaker-server on RHEL7
2. systemctl start beakerd

Actual results:
Fails to start because it can't write its pid file:
Apr 14 07:28:31 beaker01.qa.fedoraproject.org systemd[1]: Starting Beaker scheduler...
Apr 14 07:28:33 beaker01.qa.fedoraproject.org systemd[1]: PID file /var/run/beaker/beakerd.pid not readable (yet?) after start.
Apr 14 07:28:33 beaker01.qa.fedoraproject.org systemd[1]: beakerd.service never wrote its PID file. Failing.
Apr 14 07:28:33 beaker01.qa.fedoraproject.org systemd[1]: Failed to start Beaker scheduler.
Apr 14 07:28:33 beaker01.qa.fedoraproject.org systemd[1]: Unit beakerd.service entered failed state.
Apr 14 07:28:33 beaker01.qa.fedoraproject.org systemd[1]: beakerd.service failed.

Expected results:
should start

Additional info:
/var/run/beaker won't exist. We ship a tmpfiles.d config to create it, but it's never invoked when the package is freshly installed.

This is some kind of packaging bug, as in we should probably be invoking systemd-tmpfiles in RPM %post or something, but I can't find any Fedora guidelines about that so I'm not sure.

Comment 1 Dan Callaghan 2016-12-12 23:16:31 UTC
According to https://fedoraproject.org/wiki/Packaging:Tmpfiles.d we're supposed to ship the tmpfiles snippet but also own the directory in the RPM. That way it will be created on first install.

Comment 2 Dan Callaghan 2016-12-12 23:23:25 UTC
Possibly we should tweak /distribution/beaker/setup to reproduce this in our tests. Currently it avoids the problem because the beaker packages are installed by Anaconda and so then after reboot the tmpfiles snippet is already taking effect. Whereas a real human is more likely to yum install the beaker packages by hand after Anaconda is done (hence hitting this bug).

Comment 4 Dan Callaghan 2016-12-12 23:31:35 UTC
(In reply to Dan Callaghan from comment #2)

https://gerrit.beaker-project.org/5534

Comment 5 Dan Callaghan 2016-12-13 00:00:47 UTC
This patch makes the beaker-server package on /run/beaker, which lets it start up after a fresh installation:

https://gerrit.beaker-project.org/5535

However systemd still complains:

Dec 13 09:57:02 belljar.usersys.redhat.com systemd[1]: PID file /var/run/beaker/beakerd.pid not readable (yet?) after start.

although the service starts fine and the pid file does exist. So I think that just means the dodgy DaemonContext from python-daemon which we are using is creating the pid file in the wrong order or something. I don't think it's worth fixing though, I would rather just eliminate all double-forking and pid files in favour of systemd notification instead. We can do that once we are no longer targetting RHEL6 as a deployment platform.

Comment 6 Dan Callaghan 2016-12-13 00:02:55 UTC
(In reply to Dan Callaghan from comment #5)
> This patch makes the beaker-server package on /run/beaker

I meant, own.

Comment 7 Dan Callaghan 2016-12-13 23:29:45 UTC
Now that dogfood is reproducing this, I realised it also affects /var/run/beaker-lab-controller which is the directory we are using for the LC daemons (why is it different? I don't know...). So that will need fixing too.

Comment 10 Dan Callaghan 2017-02-21 18:51:23 UTC
Beaker 24.0 has been released.


Note You need to log in before you can comment on or make changes to this bug.