From owner-freebsd-ports-bugs@freebsd.org Wed Aug 23 03:39:51 2017 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C4E8DD70D1 for ; Wed, 23 Aug 2017 03:39:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A54D84F1E for ; Wed, 23 Aug 2017 03:39:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v7N3doOB060151 for ; Wed, 23 Aug 2017 03:39:51 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 221732] sysutils/consul - check config in rc.d script Date: Wed, 23 Aug 2017 03:39:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: thompsa@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: swills@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 03:39:51 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221732 Bug ID: 221732 Summary: sysutils/consul - check config in rc.d script Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: swills@FreeBSD.org Reporter: thompsa@FreeBSD.org Assignee: swills@FreeBSD.org Flags: maintainer-feedback?(swills@FreeBSD.org) Consul will silently fail to load if there is a syntax error in the config,= add a precheck to catch this. --- /usr/local/etc/rc.d/consul 2017-07-19 10:19:37.000000000 +1200 +++ /tmp/puppet-file20170823-57649-2mf3pd 2017-08-23 15:29:05.9859066= 60 +1200 @@ -22,7 +22,7 @@ name=3Dconsul rcvar=3Dconsul_enable -extra_commands=3D"reload" +extra_commands=3D"reload configtest" load_rc_config $name @@ -37,6 +37,10 @@ command_args=3D"-f -p ${pidfile} /usr/bin/env ${consul_env} ${procname} ag= ent -data-dir=3D${consul_dir} -config-dir=3D/usr/local/etc/consul.d ${consul_ar= gs}" start_precmd=3Dconsul_startprecmd +restart_precmd=3Dconsul_checkconfig +reload_precmd=3Dconsul_checkconfig +configtest_cmd=3Dconsul_checkconfig +upgrade_precmd=3Dconsul_checkconfig consul_startprecmd() { @@ -47,7 +51,12 @@ if [ ! -d ${consul_dir} ]; then install -d -o ${consul_user} -g ${consul_group} ${consul_d= ir} fi + consul_checkconfig +} +consul_checkconfig() +{ + ${procname} validate /usr/local/etc/consul.d } run_rc_command "$1" --=20 You are receiving this mail because: You are the assignee for the bug.=