From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1271 Path: news.gmane.org!not-for-mail From: Charlie Brady Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: apache2 run script Date: Fri, 6 Oct 2006 20:15:38 -0400 (EDT) Message-ID: References: <20061001092939.GA1057@heinlein.local> <20061005235825.GB7053@home.power> <20061006153719.GC7053@home.power> <20061006155724.GE7053@home.power> <20061006162109.GF7053@home.power> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: sea.gmane.org 1160180154 15161 80.91.229.2 (7 Oct 2006 00:15:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 7 Oct 2006 00:15:54 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-1507-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Oct 07 02:15:50 2006 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1GVzqx-0005JX-Ms for gcsg-supervision@gmane.org; Sat, 07 Oct 2006 02:15:43 +0200 Original-Received: (qmail 1432 invoked by uid 76); 7 Oct 2006 00:16:04 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 1426 invoked from network); 7 Oct 2006 00:16:04 -0000 X-Spam-Status: No, hits=-1.4 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: charlieb.ott.istop.com X-X-Sender: charlieb@e-smith.charlieb.ott.istop.com Original-To: Alex Efros In-Reply-To: <20061006162109.GF7053@home.power> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1271 Archived-At: On Fri, 6 Oct 2006, Alex Efros wrote: > On Fri, Oct 06, 2006 at 12:01:49PM -0400, Paul Jarc wrote: >> Alex Efros 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 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.