• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
pipes, scripts, and launchd
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pipes, scripts, and launchd


  • Subject: pipes, scripts, and launchd
  • From: Perry Smith <email@hidden>
  • Date: Fri, 28 Dec 2007 10:44:14 -0600

I may be making too big a deal of all this but I can't figure out how to do something like:

postgres <args> | rotatelogs <args>

from launchd. If I put that command in a simple bash shell script, I *believe* it will not work. The signal will go to bash and bash will not pass it along to the children.

I could trap the signal and pass it along myself... but, $! gives the pid for the last process in the pipe (rotatelogs). That is not what I need to signal. I need the signal passed to postgres. And, in fact, it would be nice if the signal did NOT pass to rotatelogs. I'd like for it to stop when its input closes and not before then.

I'm going to look in to using ksh and maybe using co-processes with ksh. bash does not seem to have that concept. But, it just seems like it should not be this hard to do.

Anyone have any suggestions of how to do this?

Thank you,
pedz

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: pipes, scripts, and launchd
      • From: Dave Zarzycki <email@hidden>
  • Prev by Date: Re: DTrace and C++ function
  • Next by Date: "Hidden" Users
  • Previous by thread: Re: Configure and multiple OS X archs
  • Next by thread: Re: pipes, scripts, and launchd
  • Index(es):
    • Date
    • Thread