From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Sun, 15 Apr 2018 20:18:08 +0200 Subject: [Buildroot] [PATCH 1/2] modem-manager: fix test of unset variable in init script In-Reply-To: <650761555.1610.1523806309320.JavaMail.zimbra@datacom.ind.br> References: <20180413162521.7078-1-casantos@datacom.ind.br> <20180413162521.7078-2-casantos@datacom.ind.br> <20180414180725.4964d59d@windsurf> <650761555.1610.1523806309320.JavaMail.zimbra@datacom.ind.br> Message-ID: <20180415201808.013e84f3@windsurf.numericable.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hello, On Sun, 15 Apr 2018 12:31:49 -0300 (BRT), Carlos Santos wrote: > >> +MODEMMANAGER_BIN=/usr/sbin/ModemManager > >> PIDFILE=/var/run/ModemManager.pid > >> > >> [ -x $MODEMMANAGER_BIN ] || exit 0 > > > > In fact, I think this test doesn't make sense. It just exits without > > any error if the binary doesn't exists, which is silly. > > > > I'm advocating for removing such tests altogether, which would make the > > MODEMMANAGER_BIN variable unnecessary. > > I think the original purpose of these test was allowing the user to > disable the service by chmod'ing -x the executable file. We discussed > a similar situation in > > https://patchwork.ozlabs.org/patch/818897/ > > [which by the way is still in my endless to-do list] Well, if you look at my feedback on this patch, I was already saying that the test to check whether radvd was executable or not was not useful. I don't think making a binary program non-executable as a way of disabling its startup at boot time is very common. Probably a ENABLED=true/false variable in /etc/default/ is more common. So, I think we should remove all those [ -x /usr/sbin/ ] checks in our init scripts. Cc'ing Peter, Arnout and Yann to gather additional opinions on this. Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com