New fedora-rpmdevtools: cleanup old stuff
Ville Skyttä
ville.skytta at iki.fi
Mon Mar 21 18:05:47 UTC 2005
On Mon, 2005-03-21 at 10:41 -0700, Michal Jaegermann wrote:
> On Mon, Mar 21, 2005 at 09:55:29AM +0200, Ville Skyttä wrote:
> >
> > > gconfd_pids=$(pidof gconfd-2) && kill -HUP $gconfd_pids
> >
> > This will break the same way as the original killall -HUP when there's
> > no gconfd-2 running (pidof exits with non-zero).
>
> Err... no. If pidof exits with non-zero then 'kill -HUP ...' does
> not run. That was the point.
You are missing the fact that if pidof exits with non-zero, kill -HUP
will indeed not run, but we will *already* have a non-zero exit status
which will hose the upgrade if there's nothing that resets it.
$ foobar=$(/sbin/pidof does-not-exist) && kill -HUP $foobar
$ echo $?
1
$ foobar=$(/sbin/pidof does-not-exist) && kill -HUP $foobar || :
$ echo $?
0
The latter form will also make sure that the upgrade will not fail if
kill -HUP exits with non-zero for whatever reason.
More information about the fedora-extras-list
mailing list