| 1 |
This files describes the mechanism used to enable or not lighttpd conf file |
| 2 |
on configure. |
| 3 |
|
| 4 |
Rationale |
| 5 |
========= |
| 6 |
When a package is removed, its links in conf-enabled must be deleted. Not doing |
| 7 |
so will usually result in the use of removed data, and might cause httpd start |
| 8 |
failure. |
| 9 |
Note that in the case of javascript-common, we could have decided to disable |
| 10 |
/javascript on purge rather that on removal, but that would have made package |
| 11 |
usage inconsistent with common practice. |
| 12 |
|
| 13 |
The problem is that the user might disable the module by just deleting the link, |
| 14 |
for example by using lighttpd-disable-mod command. |
| 15 |
We must not recreate that link if that's the case. A missing link should be |
| 16 |
considered as local user configuration choice. |
| 17 |
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474913#33 |
| 18 |
|
| 19 |
A basic solution might be not to recreate it on updates testing "$2" is empty |
| 20 |
in postinst. |
| 21 |
But then if the package is uninstalled and not purged the information is lost. |
| 22 |
The complete solution consists in storing inside the configuration, meaning in |
| 23 |
/etc, the fact during uninstall, that the link was aleady removed. |
| 24 |
|
| 25 |
Implementation |
| 26 |
============== |
| 27 |
prerm remove|upgrade: If conf-enabled link was removed, create a file |
| 28 |
/etc/javascript-common/lighttpd_disabled_by_user |
| 29 |
|
| 30 |
postinst configure: Enable on fresh installs and old upgrades. On other |
| 31 |
upgrades, check file lighttpd_disabled_by_user to enable or not. |
| 32 |
|
| 33 |
That file is not a conffile, we don't want the user to be bugged during |
| 34 |
upgrades about a change he did not make. |