Bug 200914 - [PATCH] net/relayd rc.d script doesn't check configuration validity
Summary: [PATCH] net/relayd rc.d script doesn't check configuration validity
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Lars Engels
Keywords: patch
Depends on:
Reported: 2015-06-16 16:40 UTC by Damien Fleuriot
Modified: 2016-05-21 10:13 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mm)

patch rc.d script to check configuration validity (554 bytes, patch)
2015-06-16 16:40 UTC, Damien Fleuriot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 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

  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)

Comment 2 Lars Engels freebsd_committer 2016-05-21 10:13:54 UTC
Committed, thanks!