Bug 253559

Summary: net/kea: consider conditional REQUIRES
Product: Ports & Packages Reporter: Kamigishi Rei <spambox>
Component: Individual Port(s)Assignee: Neel Chauhan <nc>
Status: Closed FIXED    
Severity: Affects Only Me CC: apevnev, nc
Priority: --- Flags: apevnev: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
dynamically require DB server to be up on startup apevnev: maintainer-approval+

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