supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* chpst -e question
@ 2005-04-08 18:23 Vincent Danen
  2005-04-08 18:32 ` Charlie Brady
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Danen @ 2005-04-08 18:23 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

Ok, I have a question.  I'm trying to convert my djbdns run scripts 
from tcpserver to tcpsvd and ran into a bit of a problem.

If I use chpst -e ./env and run my runscript as "sh -x run", it's 
showing nothing where $IP is.  I tried with envdir and I get the same 
behaviour, which is wierd.  So I figured that maybe it's not something 
that'll work if I do it through sh, but axfrdns doesn't even want to 
start (presumably because it doesn't have an IP address to work with).

So I'm fiddling and find that if I do:

chpst -e ./env env

I can see the values of IP and ROOT in the env output, but if I do 
something like:

chpst -e ./env echo $IP

I get nothing.  If I replace that with 'printf "%s" $IP' I still get 
nothing.

What gives?  Am I doing something wrong?  I'm thinking I must be 
because I even checked another machine that's not using runit/ipsvd, 
and I get the same behaviour.  The problem is that tcpserver or tcpsvd 
shows up in the process list so I can't even see what commandline it's 
"resolving" to without using sh -x, but I don't know if that's causing 
some problems as well.

Any ideas?

-- 
Annvix - Secure Linux Server: http://annvix.org/
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: chpst -e question
  2005-04-08 18:23 chpst -e question Vincent Danen
@ 2005-04-08 18:32 ` Charlie Brady
  2005-04-09  4:09   ` Vincent Danen
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Brady @ 2005-04-08 18:32 UTC (permalink / raw)
  Cc: <supervision@list.skarnet.org><supervision@list.skarnet.org>


On Fri, 8 Apr 2005, Vincent Danen wrote:

> So I'm fiddling and find that if I do:
>
> chpst -e ./env env
>
> I can see the values of IP and ROOT in the env output, but if I do something 
> like:
>
> chpst -e ./env echo $IP
>
> I get nothing.

The shell will substitute "$IP" with the value of the shell variable IP 
before chpst is run. So your command above is equivalent to:

chpst -e ./env echo

Try:

chpst -e ./env sh -c 'echo $IP'

---
Charlie


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: chpst -e question
  2005-04-08 18:32 ` Charlie Brady
@ 2005-04-09  4:09   ` Vincent Danen
  0 siblings, 0 replies; 3+ messages in thread
From: Vincent Danen @ 2005-04-09  4:09 UTC (permalink / raw)
  Cc: <supervision@list.skarnet.org><supervision@list.skarnet.org>

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]


On Apr 08, 2005, at 12:32, Charlie Brady wrote:

>> So I'm fiddling and find that if I do:
>>
>> chpst -e ./env env
>>
>> I can see the values of IP and ROOT in the env output, but if I do 
>> something like:
>>
>> chpst -e ./env echo $IP
>>
>> I get nothing.
>
> The shell will substitute "$IP" with the value of the shell variable 
> IP before chpst is run. So your command above is equivalent to:
>
> chpst -e ./env echo
>
> Try:
>
> chpst -e ./env sh -c 'echo $IP'

dOh!

Perfect, thanks for the enlightenment, Charlie.

-- 
Annvix - Secure Linux Server: http://annvix.org/
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-04-09  4:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08 18:23 chpst -e question Vincent Danen
2005-04-08 18:32 ` Charlie Brady
2005-04-09  4:09   ` Vincent Danen

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).