Re: Questions about launchd
Re: Questions about launchd
- Subject: Re: Questions about launchd
- From: Dave Zarzycki <email@hidden>
- Date: Fri, 24 Aug 2007 07:47:01 -0700
On Aug 22, 2007, at 6:38 PM, Michal Taurich wrote:
Hello,
my name is Michal and I got contact to you from Peter Borg, creator
of Lingon (launchd GUI interface). I am forwarding you my e-mail to
him. It is not so much about Lingon it is basicaly about launchd.
Any help in my cases will be appriciated. Thanks in advance.
Best Regards
Michal
Hello Peter,
first of all I would like to thank you for creating such amazing
tool like
Lingon. It helps me very much. But I would like to ask you about one
thing I
clearly not understand. I am using for monitoring software called
RMA (
RMA 1.23 for Mac OS X 10.4 (i686) -
http://www.hostmonitor.biz/download/rma123_darwin88i32.zip). This is
just an
agent for Mac OS X. I created launchd plist with your Lingon. I
tried to create
"Keep an application/script always running" but when I look into
Console it
creates some error (exactly "launchd: RMA Host Monitor Script: 9
more failures
without living at least 60 seconds will cause job removal ... will
restart in 10
seconds). Unfortunately I am not able to find/log any significant
error anywhere
(Console, sterr output even if I enable Debug option). So where can
I find exactly
why the script / command failed? I also understand this is not problem
of Lingon but mostly launchd itself. I successfully create the plist
(and keep it running)
only with "run a job at startup". But maybe you understand I want to
be sure the RMA agent is
running and if there will be any unexpected failure the plist is
strictly
written only "at startup" so that means during the cycle, the
launchd didn't
check if the script is running or not. So is there any way how to
monitor if the script is running
other than just look into launchctl and see it in list? Because I
had several cases when
script was listed in launchctl but was not active (means script was
not running).Or must I create
another bash script which will check if the process is running ? The
RMA Agent is started with
following command line: ./rma -d ~/RMA/rma.ini (-d is daemon,
rma.ini is
configuration file)
It sounds like the fundamental problem is that the script or something
that the script runs is daemonizing itself. Try this. Run the script
by hand. Does it give you a shell prompt after a brief amount of time,
or do you need to control-C the script to get your shell prompt back?
...and second thing. I used launchd also for moving some files to
another
computer. You are using path called "Queue Directories". That means
if anything
is placed into this directory (not sure about subdirectories, please
confirm),
the script is launched. Unfortunately (I am not sure if it is also
launchd
"feature" or not) if I am placing some big file (like pictures in
print
resolution, but in this case just imagine DVD ISO image), the
launchd (or
Lingon) isn't checking if the file is open or not. In my opinion it
just
checking HFS+ header and if some file is added (means record for
that file is
created - but not content) the script is launched which case in my
example
"unable to copy because too much characters" error. I did it in my
script with
checking "lsof" if the file is used or not. Isn't there any other
way directly
in launchd or Lingon ?
Unfortunately, there are no facilities in the OS for knowing whether a
file is open or not.
What needs to be done is this:
1) Create the file somewhere else
2) Once the file is in a sane state, move it to the queue directory
Good luck,
davez
_______________________________________________
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