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

Factorised code for adding a file in /etc/apache2/conf.d/ and restarting apache ?



Dear Mentors and Apache maintainers,

In the course of making a package (emboss-explorer) FHS-compliant, I
moved its files from /var/www to /usr/share. I would like
http://localhost/mypackage to work after package installation just as
before when the package was installing its files in the default document
root of apache2 (and maybe other webservers). For the moment I will only
support apache2 because of my lack of knowledge of other systems, but of
course suggestions on how to achieve this with other httpd-cgi servers
are appreciated.

After insallation, the package must:

 - Check if apache2 is there,
 - if yes add a link to a configuration file in /etc/apache2/conf.d
 - restart apache.

Of course, I can cut-and-paste from the postinst script of other
packages already implementing this, but before doing so I was wondering
if there were some factorised code somewhere that I could call instead.

(I am also wondering if I have to ask the user wether he agrees to
restart apache...)

In the worst case, I can just document in README.Debian that the link
has to be created and apache restarted, but as the package I am working
on is a www interface to a command-line program, I would prefer that it
does not require command-line intervention, since its public is partly
composed of persons who are not comfortable with command-line.

PS: would the DPKG triggers be a good mechanism to deal with this apache
restarting tasks?

Have a nice day,

-- 
Charles Plessy
Debian-Med packaging team,
Tsurumi, Kanagawa, Japan


Reply to: