supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Charlie Brady <charlieb-supervision@budge.apana.org.au>
Cc: supervision@list.skarnet.org
Subject: Re: apache2 run script
Date: Fri, 6 Oct 2006 20:15:38 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610062007300.12679@e-smith.charlieb.ott.istop.com> (raw)
In-Reply-To: <20061006162109.GF7053@home.power>


On Fri, 6 Oct 2006, Alex Efros wrote:

> On Fri, Oct 06, 2006 at 12:01:49PM -0400, Paul Jarc wrote:
>> Alex Efros <powerman@powerman.asdfGroup.com> wrote:
>>> Anyway. Why you dislike `env -i` so much to invent all these alternatives? :)
>>
>> I think the interest is mostly in -i, not env.  Do you have variables
>> in runsv's environment that Apache shouldn't have?
>
> Hmm. No, I don't think -i really needed. In ./run script there about 30
> variables, but most of them bash-related and I don't think some of them may
> affect apache execution.
>
> But... it just ease to use -i when starting apache than think 'is it safe'
> about every from these 30 variables, check apache's documentation about used
> variables, etc.

I'd be surprised if you have 30 variables set. I have only these:

@400000004526ef972d1a97bc SELINUX_INIT=YES
@400000004526ef972d1a9f8c CONSOLE=/dev/console
@400000004526ef972d1aa374 TERM=linux
@400000004526ef972d1aa374 INIT_VERSION=sysvinit-2.85
@400000004526ef972d1aa75c PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
@400000004526ef972d1aab44 RUNLEVEL=7
@400000004526ef972d1aaf2c PWD=/var/service/mysqld
@400000004526ef972d1aaf2c PREVLEVEL=N
@400000004526ef972d1ab314 HOME=/
@400000004526ef972d1ab6fc SHLVL=1
@400000004526ef972d1ab6fc _=/bin/env

Add 'env' to one of your run scripts and you will learn what you have.

My /etc/runit/2 script is this (but with proctitle arg edited for 
brevity):

===
#!/bin/sh

PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

exec </dev/null
exec runsvdir -P /service 'log: ...[snip]...'
===

The environment could be smaller again if I used 'env -' in the 
/etc/runit/2 script.

> Many years ago when I was a newbie sysadmin I have some
> problems with apache started in unclean environment, so I always use -i
> from that time... just for the case. That's called experience. ;-)

That was before you started to use supervision, which was designed in part 
to guarantee a clean, predictable and invariant environment.

'env -' is not harmful, it's just wasted cycles.


  reply	other threads:[~2006-10-07  0:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-01  9:29 Mark
2006-10-05 23:58 ` Alex Efros
2006-10-06  6:12   ` Vincent Danen
2006-10-06 14:27     ` Charlie Brady
2006-10-06 14:30   ` Charlie Brady
2006-10-06 15:37     ` Alex Efros
2006-10-06 15:46       ` Charlie Brady
2006-10-06 15:57         ` Alex Efros
2006-10-06 16:01           ` Paul Jarc
2006-10-06 16:21             ` Alex Efros
2006-10-07  0:15               ` Charlie Brady [this message]
2006-10-07  0:23                 ` Alex Efros
2006-10-07 18:44                 ` Paul Jarc
2006-10-05 23:59 ` Charlie Brady

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0610062007300.12679@e-smith.charlieb.ott.istop.com \
    --to=charlieb-supervision@budge.apana.org.au \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).