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

Bug#741350: a2enconf confusion - .conf extension?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



On 14/03/14 18:53, Jean-Michel Vourgère wrote:
> Hello Daniel
> 
> Just a few hints:
> 
> On Friday 14 March 2014 08:35:55 Daniel Pocock wrote:
>> a) if my postinst or postrm calls apache2_invoke from inside a
>> function, then it fails badly
>> 
>> b) some of my postinst and postrm code is based on examples I saw
>> in other packages, they test -x /usr/sbin/apache2 and it turns
>> out this is not a great idea as if somebody does
>> 
>> dpkg --remove apache2 loganalyzer dpkg --purge loganalyzer
>> 
>> then at the moment the loganalyzer postrm runs with the "purge" 
>> argument, there is no /usr/sbin/apache2 and so it does not remove
>> the symlink
>> 
>> Also, the check for /usr/share/apache2/apache2-maintscript-helper
>> would also fail if apache2 had been removed - it is OK for the
>> postrm to just proceed without calling apache2_invoke at all if
>> it is no longer there or should the postm complain?
> 
> Please have another look at the wiki: "apache2_invoke disconf" must
> be called both at purge *and* at simple removal. So that should
> take care of your question b.
> 
> Actually, source apache2-maintscript-helper is using the scripts
> arguments - like "postrm purge" - in oder to know what it should
> do. So it must be called from the script top level, and not from a
> function where that environment changed.
> 
> If you really need to call the helpers from a function, I guess you
> need if [ -e /usr/share/apache2/apache2-maintscript-helper ] ;
> then . /usr/share/apache2/apache2-maintscript-helper fi at top
> level, where $1 == 'configure' or whatever. Then you should be able
> to call apache2_invoke from a function, providing you wrap it in a
> [ -e /usr/share/apache2/apache2-maintscript-helper ] too of course.
> I did not test that.
> 
> Regarding your question b again, if you try dh_apache2, you'll see
> that deconfiguration is done at prerm time too, so that
> simultaneous removal of apache and your package should work, no
> matter the order in wich it occurs. And the bonus: If there's a bug
> in (pre|post)(inst|rm), you have someone else to blame, isn't that
> nice? ;-)
> 
> -- Nirgal
> 

Almost - while that sounds good (making the helper script do
everything), I am also trying to ensure my package is suitable for
wheezy-backports so I've used slightly more verbose scripting as shown
in the bottom of the wiki page:

https://wiki.debian.org/Apache/PackagingFor24#Making_web_applications_compatible_to_both.2C_Apache_2.2_and_2.4



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBCAAGBQJTJLztAAoJEOm1uwJp1aqD3xUQAL5On8OURB3tk01NShKPbhQO
f5SqbOSZvNF/5JQudW74rKPiMLhh/jJZvg7Cximdk5qNrcunR9/9fifbQPAedkdT
MGoolV9izFcfaTPpd3CguERaKRCReiR5OAUWOBOgwBNit3vH2L4weXndSGLsI8AJ
2m+XVMeh/tyuRsfJ8twqT1b8BuZyIyX7h1+JoWZvPiMMLGjIczd3pf1foHiWmAFr
0Qk3I9v6ZuzyuPuEk7X4+T7ytmDNikpTpvEYGHp1UWaX3zalWNICbdXXejK4ZUyW
+JgHW37eV3SWWHmTUlgkb8xl60BSI4UyP8dgG0Z/sjocAD1zbejJaK8l2Ru6Vi1j
A0bYzq8kunjnIWE3/BHEl8yRTuNB34FNKAG0vSn2vDbJk9U7EPdbf8YTFHho1Wwk
yD1jJy1CLCKvjWqCu9JXg9fT5s85Sjv0YXe9F2APu5HKrhNnOBrC/MNirAdWITdA
Y+Ay5nqdpwXWlgmjmkficDx76G7VXN1T19xnyIqhLYBMdhPfed2UWHG6+n6vA5/B
yNoqDVq8NjhjxUmwqhHVEG14irl8QL0EMwvSkqBJr5CrjFfGPzXCxaVvjYBXDTh6
ilmHScqz+PSE5oUV8AxAawnVkwu6CSH68DMqAY4nVyCY3Kv1LdiBKNbRVHOCngH6
8WXN2YVrDZGSfXtVwfut
=VFSy
-----END PGP SIGNATURE-----


Reply to: