in reply to cron with perl

You could probably use something along the lines of apachectl which has features to control an Apache server similar to what you seem to want here.

The general idea is that the daemon process stores its PID in a file which a script can subsequently access and send signals to.

Take a look at perlipc which discusses signals (including a section on handling signals in daemons).

-- Ken

Replies are listed 'Best First'.
Re^2: cron with perl
by aquarium (Curate) on Nov 08, 2010 at 23:37 UTC
    the builtin ipc mechanisms for each platform...it can be done, but is often a buggy/hard road unless very experienced. i would advocate instead the daemon get requests via a tcp/ip socket. there's already plenty of example daemon code out there (which is short and sweet) and you can concentrate on application logic instead of worrying about getting (semaphore/message queue/rpc/other tight coupled) ipc right. an example of this sort of setup is oracle OEM and tomcat manager application. anyhow, just a thought, as it also scales better and you can have the "client" connect from other machine(s).
    the hardest line to type correctly is: stty erase ^H

      Thanks.

      The application indeed doesn't warrant a "buggy/hard road unless very experienced".

      I will have to research the unfamiliar tcp/ip socket route. It occurred to me that this type of functionality would surely be in sufficient demand for something to exist, if only I could find the right terms in which to express the problem.

      Thanks again.

Re^2: cron with perl
by Pstack (Scribe) on Nov 09, 2010 at 01:30 UTC

    Yes, I did pre-investigate perlipc docs, but apart from much being over (or in this case 'under') my head there, I got the impression of it being incorrectly targeted to my purposes of 'higher-level' user-console-interactivity .. ie that most ipc functionality targets 'lower-level' background detection and signal-handling. For instance, I didn't think it enabled me to spawn child processes that escaped the stdout-less environment assigned to cron? However, please correct me if I am wrong there. (My reply above to aquarium may clarify this a bit).

    I will take a look at apachectl. Thanks for the tip.

Re^2: cron with perl
by Pstack (Scribe) on Nov 09, 2010 at 01:37 UTC

    Sorry, something going amiss. Last was in reply to kcott.