Hi all,
I seem to remember a long time ago, a small guide to creating a daemon, wich
included such topics as detaching stdin/out/err from the starting tty,
chdiring to root so as not to prevent unmounting /home etc.
Does this ring a bell with anyone?
Gary
On Monday 03 September 2001 2:46 pm, [EMAIL PROTECTED] wrote:
> i did not understand the part about working with samll scripts but you
> could do somehting like this ... not tested
> #!perl
> while(1) {
> if ( -s $flag_file_location ) {
> system($command_to_execute) or warn "Cannot execute command\n";
> sleep 5;
> }
> }
>
> the above solution is really a crappy solution to your problems ... i can
> already feel the cringes of some of the ppl on this list right now .. but
> it is a start without going into forks and execs ... the perl cookbook has
> an entire chapter dedicated to your solution and is a good starting point
> ...
>
> another alternative (not pure perl) is to have a script like above without
> the while loop and put it into a cron ...
>
> On Mon, Sep 03, 2001 at 02:45:54PM +0200, peter grotz shaped the electrons
to read:
> > hi all,
> > I need a program to run like a daemon. it should do:
> > look in a directory for some flag-files, if some exist the daemon
> > should start other programs, then the daemon should sleep for let?s say
> > 5 seconds and begin again...
> > how must I create such a daemon and how can I stop him working with a
> > small script.
> > excuse me for this newbie-questions....
> > thanks
> >
> > --
> > peter grotz
> >
> > rehberger architekten
> > schertlinstr 23
> > 86 159 augsburg
> >
> > tel 0821 25980-29
> > fax 0821 25980-20
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]