[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/init.d/networking does not start everything in /etc/network/interfaces



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, May 18, 2016 at 03:42:27PM +0200, Elimar Riesebieter wrote:
> * Lisi Reisz <lisi.reisz@gmail.com> [2016-05-18 12:31 +0100]:
> 
> > On Tuesday 17 May 2016 18:29:36 Elimar Riesebieter wrote:
> [...]
> > > /etc/init.d/networking stop does ifdown -a
> > > /etc/init.d/networking start does ifup -a
> > 
> > But 
> > # ifdown -a; ifup -a
> > is much more elegant!!
> 
> I would use '&&' in favour of ';' as ';' doesn't wait to complete
> the job:

It *does* wait[1] -- it just would continue doing the second part regardless
of the exit status of the first. So if the ifdown part exits with nonzero
(most probably signaling an error), the ifup part would be tried nevertheless.

So in this case, probably

> # ifdown -a && ifup -a

would be the right thing, as you say.

> is much more secure!!

That depends on what you want. Perhaps (probably not in this case, though)
you really want the second, third... command executed in any case. Then
the semicolon would be The Right Thing [TM]

regards

[1] As you can easily check yourself by issuing:

  sleep 10 ; echo "good morning"

- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlc8dcsACgkQBcgs9XrR2kaEaACfT7rPm/3SWV5eoI1pBZr900ey
kgMAnih/p/+vdJkkp0FiAxmid6/7spui
=xjHH
-----END PGP SIGNATURE-----


Reply to: