Bug#681541: apache2: add -q option to a2query
Package: apache2
Version: 2.4.2-2
Severity: minor
Please add a -q option to a2query that silences all the output for
situations in which only the exit status is of interest.
The specific motivation is that I have an Apache module package
where the modules cannot be enabled automatically. They have
mandatory configuration settings that are site-local and have no
reasonable default values. The local administrator has to configure
the modules before they can be enabled.
I therefore can't use the normal dh_apache2 handling, but I still
want to restart Apache if the module has been changed. I therefore
want to do the following in the postinst script:
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
if a2query -q -m webauth || a2query -q -m webauthldap ; then
apache2_reload restart
fi
fi
But there is no -q option currently and a2query prints output to
stdout if the module is enabled and to stderr if it's disabled.
This forces:
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
if a2query -m webauth >/dev/null 2>&1 \
|| a2query -m webauthldap >/dev/null 2>&1 ; then
apache2_reload restart
fi
fi
which is unnecessarily awkward.
-- Package-specific info:
Enabled MPM: event
List of enabled modules:
authz_user (enabled by unknown)
auth_basic (enabled by unknown)
authn_core (enabled by site administrator)
negotiation (enabled by unknown)
authz_groupfile (enabled by unknown)
access_compat (enabled by maintainer script)
webauthldap (enabled by maintainer script)
socache_shmcb (enabled by maintainer script)
authn_file (enabled by unknown)
cgi (enabled by unknown)
setenvif (enabled by unknown)
mpm_event (enabled by site administrator)
reqtimeout (enabled by unknown)
cgid (enabled by maintainer script)
webkdc (enabled by site administrator)
authz_host (enabled by unknown)
ssl (enabled by unknown)
autoindex (enabled by unknown)
dir (enabled by unknown)
alias (enabled by unknown)
status (enabled by unknown)
mime (enabled by unknown)
webauth (enabled by maintainer script)
authz_core (enabled by maintainer script)
env (enabled by unknown)
deflate (enabled by unknown)
filter (enabled by maintainer script)
List of enabled configurations:
localized-error-pages.conf (enabled by maintainer script)
ssl.conf (enabled by site administrator)
other-vhosts-access-log.conf (enabled by maintainer script)
webauth.conf (enabled by site administrator)
serve-cgi-bin.conf (enabled by maintainer script)
webkdc.conf (enabled by site administrator)
charset.conf (enabled by maintainer script)
roundup.conf (enabled by site administrator)
security.conf (enabled by maintainer script)
shibboleth.conf (enabled by site administrator)
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-2-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages apache2 depends on:
ii apache2-bin 2.4.2-2
ii apache2-data 2.4.2-2
ii lsb-base 4.1+Debian7
ii mime-support 3.52-1
ii perl 5.14.2-12
ii procps 1:3.3.3-2
Versions of packages apache2 recommends:
ii ssl-cert 1.0.31
Versions of packages apache2 suggests:
pn apache2-doc <none>
pn apache2-suexec-pristine | apache2-suexec-custom <none>
ii apache2-utils 2.2.22-9
ii chromium [www-browser] 20.0.1132.43~r143823-1
ii elinks [www-browser] 0.12~pre5-8
ii iceweasel [www-browser] 10.0.5esr-2
ii links [www-browser] 2.7-1
ii lynx-cur [www-browser] 2.8.8dev.12-2
ii w3m [www-browser] 0.5.3-8
Versions of packages apache2-bin depends on:
ii libapr1 1.4.6-3
ii libaprutil1 1.4.1-2
ii libaprutil1-dbd-mysql 1.4.1-2
ii libaprutil1-dbd-sqlite3 1.4.1-2
ii libaprutil1-ldap 1.4.1-2
ii libc6 2.13-33
ii libldap-2.4-2 2.4.31-1
ii liblua5.1-0 5.1.5-2
ii libpcre3 1:8.30-5
ii libssl1.0.0 1.0.1c-3
ii libxml2 2.8.0+dfsg1-4
ii perl 5.14.2-12
ii zlib1g 1:1.2.7.dfsg-13
Versions of packages apache2-bin suggests:
pn apache2-doc <none>
pn apache2-suexec-pristine | apache2-suexec-custom <none>
ii chromium [www-browser] 20.0.1132.43~r143823-1
ii elinks [www-browser] 0.12~pre5-8
ii iceweasel [www-browser] 10.0.5esr-2
ii links [www-browser] 2.7-1
ii lynx-cur [www-browser] 2.8.8dev.12-2
ii w3m [www-browser] 0.5.3-8
Versions of packages apache2 is related to:
ii apache2 2.4.2-2
ii apache2-bin 2.4.2-2
-- no debconf information
Reply to: