Bug 200914

Summary: [PATCH] net/relayd rc.d script doesn't check configuration validity
Product: Ports & Packages Reporter: Damien Fleuriot <dam>
Component: Individual Port(s)Assignee: Lars Engels <lme>
Status: Closed FIXED    
Severity: Affects Many People CC: lme
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (mm)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch rc.d script to check configuration validity none

Description Damien Fleuriot 2015-06-16 16:40:56 UTC
Created attachment 157808 [details]
patch rc.d script to check configuration validity

The init script for net/relayd does not check the configuration file for errors before trying to restart the daemon.

As such, it is prone to errors when a tired admin breaks his config, invokes the script to restart relayd, and ends up with a service outage.


This small patch inspired by nginx's rc.d adds support for configuration sanity checks before start, reload and restart actions.

It simply issues a relayd -n to ensure the configuration file is sane.


Validated working on 8-STABLE using relayd-5.5.20140810
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-05-21 10:13:33 UTC
A commit references this bug:

Author: lme
Date: Sat May 21 10:13:11 UTC 2016
New revision: 415589
URL: https://svnweb.freebsd.org/changeset/ports/415589

Log:
  Check relayd's configuration with {start,restart,reload}_precmd in the rc script.

  PR:		        200914
  Submitted by:	Damien Fleuriot <dam@my.gd>
  Approved by:	maintainer timeout (11 months)

Changes:
  head/net/relayd/files/relayd.in
Comment 2 Lars Engels freebsd_committer freebsd_triage 2016-05-21 10:13:54 UTC
Committed, thanks!