Bug#604855: unblock: shibboleth-sp2/2.3.1+dfsg-3
Russ Allbery <email@example.com> writes:
> Ferenc Wagner <firstname.lastname@example.org> writes:
>> Russ Allbery <email@example.com> writes:
>>> Ferenc Wagner <firstname.lastname@example.org> writes:
>>>> Maybe invoke-rc.d --quiet apache2 restart || [ $? -eq 100 ] ?
>>> Ah, that's a good idea. I didn't realize invoke-rc.d had a special
>>> exit status for a missing script.
>> But anyway, can the Shibboleth module be enabled when Apache isn't
>> installed? The restart is already protected by this check:
>> if [ -f /etc/apache2/mods-enabled/shib2.load ] ; then
>> invoke-rc.d apache2 restart
> I think it can if Apache is then removed (but not purged)
Sure, but this isn't a problem, because if /etc/apache2/mods-enabled is
present, then /etc/init.d/apache2 is also present, and quietly
returns success if the actual daemon is not installed.
 Well, at least they belong to the same package, but they are under
/etc, so may be freely changed by the system administrator. I don't
think we should care for such pathologic cases.
Michael Biebl <email@example.com> writes:
> the apache init script already has a status method, why don't you use
> invoke-rc.d apache2 status >/dev/null 2>&1 && invoke-rc.d apache2 restart
I like this idea. Any objections against the following code?
if [ -f /etc/apache2/mods-enabled/shib2.load ] ; then
if invoke-rc.d apache2 status >/dev/null ; then
invoke-rc.d apache2 restart
I decided to swap &&s for readability and "|| true" for keeping the exit
status of the restart operation should we decide to actually try that.