Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jul 2016 19:56:26 +0300
From:      Guy Yur <guyyur@gmail.com>
To:        Pedro Giffuni <pfg@freebsd.org>
Cc:        Glen Barber <gjb@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: resolvconf needs @RESTARTCMD@ to be replaced after r303062
Message-ID:  <CAC67Hz-ZbKAxNY_STe6An2SFfEBA_UnGH8XCZ=RKkM-m%2B__0=Q@mail.gmail.com>
In-Reply-To: <a5a5b0ca-41bc-d313-1f0a-1114ad8e5ccc@FreeBSD.org>
References:  <CAC67Hz_1wc9ddh1RmY-T96=sBH8=du6SJru3zGQZHgjjpivLCw@mail.gmail.com> <ec770c15-8b61-2136-4da4-37f005d89ea0@FreeBSD.org> <20160731023550.GF1532@FreeBSD.org> <a5a5b0ca-41bc-d313-1f0a-1114ad8e5ccc@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sun, Jul 31, 2016 at 5:46 AM, Pedro Giffuni <pfg@freebsd.org> wrote:
>
>
>>> Index: sbin/resolvconf/Makefile
>>> ===================================================================
>>> --- sbin/resolvconf/Makefile    (revision 303557)
>>> +++ sbin/resolvconf/Makefile    (working copy)
>>> @@ -30,6 +30,7 @@
>>>                 -e 's:@LIBEXECDIR@:${FILESDIR}:g' \
>>>                 -e 's:@VARDIR@:${VARDIR}:g' \
>>>                 -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \
>>> +               -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \
>>>                 -e 's:@RCDIR@:${RCDIR}:g' \
>>>                 -e 's: vpn : ng[0-9]*&:g' \
>>>                 ${DIST}/$@.in > $@
>>
>>
>
> And the underscore was not a typo.
> Thanks Guy!
>
> Pedro.

Hi,

I meant for the RESTARTCMD_= statement to be added too.
I should have sent a patch file.

Issue could be seen during boot if using dhcpcd which invokes resolvconf
or by running 'resolvconf -r SERVICENAME'

With r303567, RESTARTCMD is now empty in the script so
dynamic detection for service command is done.

Attaching new patch.

1.
Renaming RESTARTCMD, CMD1, CMD2 to _WITH_ARG since it is only
used by pdns_recursor.in.
The other files have all moved to use $RESTARTCMD passed from resolvconf.

I will send a patch upstream to do the same for pdns_recursor.in.
The ugly _WITH_ARG vars can be removed when pdns_recursor.in
is updated to new style.

2.
Renaming RESTARTCMD_ to RESTARTCMD and adding the lines for
new CMD1, CMD2, RESTARTCMD statements.


Thanks,
Guy

[-- Attachment #2 --]
Index: Makefile
===================================================================
--- Makefile	(revision 303591)
+++ Makefile	(working copy)
@@ -19,9 +19,12 @@ VARDIR=		/var/run/resolvconf
 
 # We don't assume to restart the services in /sbin.  So, though
 # our service(8) is in /usr/sbin, we can use it, here.
-CMD1=		\1 onestatus >/dev/null 2>\&1
-CMD2=		\1 restart
-RESTARTCMD=	/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}
+CMD1_WITH_ARG=		\1 onestatus >/dev/null 2>\&1
+CMD2_WITH_ARG=		\1 restart
+RESTARTCMD_WITH_ARG=	/usr/sbin/service ${CMD1_WITH_ARG} \&\& /usr/sbin/service ${CMD2_WITH_ARG}
+CMD1=		\\$$1 onestatus >/dev/null 2>\&1
+CMD2=		\\$$1 restart
+RESTARTCMD=	"/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}"
 
 .for f in ${SCRIPTS} ${FILES} ${MAN}
 ${f}:	${f}.in
@@ -29,8 +32,8 @@ ${f}:	${f}.in
 		-e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
 		-e 's:@LIBEXECDIR@:${FILESDIR}:g' \
 		-e 's:@VARDIR@:${VARDIR}:g' \
-		-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \
-		-e 's:@RESTARTCMD@:${RESTARTCMD_}:g' \
+		-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \
+		-e 's:@RESTARTCMD@:${RESTARTCMD}:g' \
 		-e 's:@RCDIR@:${RCDIR}:g' \
 		-e 's: vpn : ng[0-9]*&:g' \
 		${DIST}/$@.in > $@
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAC67Hz-ZbKAxNY_STe6An2SFfEBA_UnGH8XCZ=RKkM-m%2B__0=Q>