Bug 253559 - net/kea: consider conditional REQUIRES
Summary: net/kea: consider conditional REQUIRES
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Neel Chauhan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-16 16:00 UTC by Kamigishi Rei
Modified: 2021-03-02 22:31 UTC (History)
2 users (show)

See Also:
apevnev: maintainer-feedback+


Attachments
dynamically require DB server to be up on startup (1.09 KB, patch)
2021-02-28 22:42 UTC, Andrey Pevnev
apevnev: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kamigishi Rei 2021-02-16 16:00:52 UTC
Kea can be built with PostgreSQL and/or MySQL support; would it be feasible to add postgresql and mysql to its # REQUIRES line conditionally?

If Kea starts before the DB server it bails out immediately with a database connection error.
Comment 1 Andrey Pevnev 2021-02-19 15:22:48 UTC
I'll check if any other ports do that already, not a bad idea!
Comment 2 Kamigishi Rei 2021-02-19 15:25:02 UTC
Among what I have installed, PowerDNS does, but unconditionally (it always has both postgresql and mysql in its REQUIRES, no matter if the options are enabled), though I figure it would not be hard to make it only add to the line if the option is set.
Comment 3 Andrey Pevnev 2021-02-28 22:42:21 UTC
Created attachment 222889 [details]
dynamically require DB server to be up on startup

See if this patch works for you?
Comment 4 Kamigishi Rei 2021-03-01 08:25:49 UTC
(In reply to Andrey Pevnev from comment #3)

The generated rc.d script properly lists postgresql in the requirements and rcorder now lists kea after postgresql.

Thank you!
Comment 5 Neel Chauhan freebsd_committer freebsd_triage 2021-03-02 22:31:19 UTC
Committed!
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-03-02 22:31:44 UTC
A commit references this bug:

Author: nc
Date: Tue Mar  2 22:31:14 UTC 2021
New revision: 566999
URL: https://svnweb.freebsd.org/changeset/ports/566999

Log:
  net/kea: Add MySQL and PostgreSQL to the REQUIRES line in the rc.d script.

  This prevents database connection errors upon startup.

  PR:		253559
  Submitted by:	Kamigishi Rei <spambox AT haruhiism DOT net>
  Approved by:	Andrey Pevnev <apevnev AT me DOT com> (maintainer)

Changes:
  head/net/kea/Makefile
  head/net/kea/files/kea.in