[OpenWrt-Devel] [PATCH] base-files: procd initscripts restart on reload
Tristan Plumb
tristan at trstn.net
Sun Sep 14 12:02:02 EDT 2014
In-Reply-To=<20140914153745.GA1251%40illyse.org>
Message-Id: <257d53.2b072c7b.FQSi.mx at tumtum.plumbweb.net>
Date: Sun, 14 Sep 2014 12:02:02 -0400
User-Agent: mx
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8
Baptiste Jonglez wrote:
>On Sun, Sep 14, 2014 at 08:14:11AM -0400, Tristan Plumb wrote:
>> Currently procd enabled initscripts will restart on reload when the command
>> line changes, which works for many packages, but not anything that keeps its
>> configuration in a file, like dnsmasq.
> Wouldn't it be better to check whether the generated config file changed,
> and restart the daemon only if this is the case?
Yes, it would be better. I don't see a general way to do this though,
unless we have a list of files (which I am fairly sure we currently
don't). Then, something like
temp=`mktemp`
pids="`pidof $cmd`"
md5sum $files > $temp
start
if([ $pids == "`pidof $cmd`" ] && md5sum -s -c $temp); then
restart
fi
rm $temp
might do.
Tristan
--
All original matter is hereby placed immediately under the public domain.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list