• 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
Re: launchd i/o redirection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launchd i/o redirection


  • Subject: Re: launchd i/o redirection
  • From: Dave Zarzycki <email@hidden>
  • Date: Mon, 3 Apr 2006 12:06:27 -0700

launchd really revolves around daemons and background scripts.

I'll probably add stdin support in the future, but for now you'll just have to wrap dnscache in a shell script:

#!/bin/sh

exec dnscache < seed

As to pipes, again, please wrap in a shell script. I'm not sure how we want to make pipes and launchd jobs jive in the future. Weeee...

davez


On Apr 3, 2006, at 10:39 AM, Keith Shaw wrote:

hello,

my apologies if this is not the correct form to post questions about launchd.

let me start by saying that i believe launchd is the greatest thing since sliced bread, and it's proved quite useful.

the only thing i haven't figured out is how to perform redirection. i understand i can specify an output file for stdout and stderr, but what if i want to pipe the output into another program? i've attempted to use the "|", "<", and ">" in the program arguments, but that hasn't work either.

i currently have two issues:

1)	what do i do if a program expects data from stdin?
	ie:  dnscache < seed

2)	how do i redirect stdout/stderr to another program for logging?
	ie:  port selfupdate | logger -i -p local0.notice -t port

for #2 i've thought about named pipes, but those always feel like "dirty hacks." i suppose i could add items like #2 to one of my periodic files, but i'd like them to be standalone launchd.plists, and it seems like there should be some way to do i/o redirection with a launchd controlled item. am i missing something?

any suggestions or pointers would be great!

keith.

_______________________________________________
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

_______________________________________________ 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
References: 
 >launchd i/o redirection (From: Keith Shaw <email@hidden>)

  • Prev by Date: launchd i/o redirection
  • Next by Date: PowerPC assembly jump table
  • Previous by thread: launchd i/o redirection
  • Next by thread: PowerPC assembly jump table
  • Index(es):
    • Date
    • Thread