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

2008-07-07 Thread Charles Plessy
Le Sun, Jul 06, 2008 at 11:05:27AM -0700, Russ Allbery a écrit :
 Stefan Fritsch [EMAIL PROTECTED] writes:
  On Saturday 05 July 2008, Charles Plessy wrote:
 
   - if yes add a link to a configuration file in /etc/apache2/conf.d
 
  You can add that file or the link unconditionally.
 
 That would really upset me if I were a systems administrator.  Most of my
 Apache configurations have multiple virtual hosts, and having some package
 randomly add itself to the namespace of every virtual host I run, possibly
 taking over pages that were currently serving some other purpose, would be
 extremely annoying.
 
 I'd want at least a debconf prompt before something added itself to the
 global Apache configuration.

Well, it definitely makes sense, but it makes me wonder if my goal is
achievable. The frontend I package is as useful on purely local systems
(a laptop for instance) as on servers (indeed if you search for `emboss
explorer' you will find sites running it). So if the package does things
automatically, it can annoy system administrators who run it on a
dedicated web server. But if the package pulls apache2 and installs its
configuration automatically, end users will benefit of it as just
another graphical interface, with the only peculiarity that it needs a
browser to be used.

How can this conflict of interest be solved? EMBOSS explorer is a nice
interface, and I really would like to provide to end users with no
command-line interactions with the system. How about making it available
only for localhost by default?

Have a nice day,

-- 
Charles


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-07 Thread Mike Hommey
On Mon, Jul 07, 2008 at 10:51:47PM +0900, Charles Plessy [EMAIL PROTECTED] 
wrote:
 Le Sun, Jul 06, 2008 at 11:05:27AM -0700, Russ Allbery a écrit :
  Stefan Fritsch [EMAIL PROTECTED] writes:
   On Saturday 05 July 2008, Charles Plessy wrote:
  
- if yes add a link to a configuration file in /etc/apache2/conf.d
  
   You can add that file or the link unconditionally.
  
  That would really upset me if I were a systems administrator.  Most of my
  Apache configurations have multiple virtual hosts, and having some package
  randomly add itself to the namespace of every virtual host I run, possibly
  taking over pages that were currently serving some other purpose, would be
  extremely annoying.
  
  I'd want at least a debconf prompt before something added itself to the
  global Apache configuration.
 
 Well, it definitely makes sense, but it makes me wonder if my goal is
 achievable. The frontend I package is as useful on purely local systems
 (a laptop for instance) as on servers (indeed if you search for `emboss
 explorer' you will find sites running it). So if the package does things
 automatically, it can annoy system administrators who run it on a
 dedicated web server. But if the package pulls apache2 and installs its
 configuration automatically, end users will benefit of it as just
 another graphical interface, with the only peculiarity that it needs a
 browser to be used.
 
 How can this conflict of interest be solved? EMBOSS explorer is a nice
 interface, and I really would like to provide to end users with no
 command-line interactions with the system. How about making it available
 only for localhost by default?

Why not have your package create its own apache instance, with its own
config and its own port ?

[ Unfortunately, apache will also be running by itself, because we still
lack something to handle that. Same applies with gnome-user-share ]

Mike


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-07 Thread Charles Plessy
Le Mon, Jul 07, 2008 at 04:05:54PM +0200, Mike Hommey a écrit :
 
 Why not have your package create its own apache instance, with its own
 config and its own port ?

Probably because I have no clue on how doing this cleanly ;)

But why not? An in that case, why not something lighter than Apache…

Have a nice day,

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


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-07 Thread Stefan Fritsch
On Sunday 06 July 2008, Russ Allbery wrote:
 Stefan Fritsch [EMAIL PROTECTED] writes:
  On Saturday 05 July 2008, Charles Plessy wrote:
   - if yes add a link to a configuration file in
  /etc/apache2/conf.d
 
  You can add that file or the link unconditionally.

 That would really upset me if I were a systems administrator.  Most
 of my Apache configurations have multiple virtual hosts, and having
 some package randomly add itself to the namespace of every virtual
 host I run, possibly taking over pages that were currently serving
 some other purpose, would be extremely annoying.

I don't think it is ideal, but it seems to be quite common. At least 
17 packages do it this way. Therefore an administrator cannot assume 
that packages won't add apache config files anyway.

More experienced administrators will have no problems changing the 
include directive to something 
like include /etc/apache2/conf.d-enabled and create symlinks to the 
files in conf.d that they want enabled globally. And people with many 
virtual hosts are more likely to be experienced administrators than 
those with only one.

Of course it would be a good idea to discuss this and create a 
standard policy, but this will not happen for lenny, obviously.

Cheers,
Stefan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-06 Thread Charles Plessy
Le Sun, Jul 06, 2008 at 11:02:50AM +0200, Stefan Fritsch a écrit :
 On Saturday 05 July 2008, Charles Plessy wrote:
   - restart apache.
 
 A reload should be enough. Don't restart apache if it is not necessary 
 (as it aborts active connections and may require the admin to enter 
 ssl key passphrases, etc.).

Thanks a lot for the answer. Would something like:

if [ -x /etc/init.d/apache2 ]; then
if which invoke-rc.d /dev/null 21; then
invoke-rc.d apache2 reload
else
/etc/init.d/apache2 reload
fi
fi

be acceptable?


 It would be nice 
 though, if the restart was only done when necessary (on new installs 
 and on upgrades if the config file changed).

Hmmm, I am not sure to know how to test if the config was changed...

Have a nice day,

-- 
Charles Plessy
http://charles.plessy.org
Wakō, Saitama, Japan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-04 Thread Charles Plessy
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


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]