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

Re: use of "invoke-rc.d $PACKAGE stop || exit $?" in prerm scripts



* Bernd Schubert <bernd.schubert@pci.uni-heidelberg.de> wrote:

>> inside their prerm maintainer scripts. If stopping $PACKAGE through
>> invoke-rc.d/init-script fails, removing the package fails as well.

>> Using:

>>   invoke-rc.d $PACKAGE stop || true
>>   /etc/init.d/$PACKAGE stop || true

> We are using chroot environments (e.g. with sid) where no daemon is running
> and invoke-rc.d will only do an "exit 0" in those chroots.

How do you achieve that? For example symlinking invoke-rc.d to
/bin/true is a workaround, but I'm searching for a general solution
to avoid that daemons are started when upgrading even though they
did not run before the upgrade (or don't start any service at all,
e.g. in chroots - as you mentioned).

> Using the method above, wouldn't there be any chance that a bad
> init script could kill daemons started outside the chroot?

The init script would be broken then.
Anyway, I don't see the difference between "stop || exit $?" and
"stop || true" in this case.

-mika-



Reply to: