in reply to How do I get status from daemon

All the ways you mention are possible. The choice depends on how much other communication you need, and on the operating circumstances.

A daemon usually sets up what its STDERR is to be (no controlling terminal), often a log file opened to append. You could write to STDERR on that assumption.

Daemons often create a file named for their pid to aid in signaling. You could system {"/bin/touch /tmp/mydaemon/$$"}; whenever the config is read, then the curious can stat that for reassurance.

A socket or pipe is fine if you have other uses for it, but is overkill for the message you want.

After Compline,
Zaxo

Replies are listed 'Best First'.
touch? Blech!
by Fletch (Bishop) on Nov 06, 2001 at 20:11 UTC
    { local *PID; open( PID, ">/tmp/mydaemon/$$" ) or warn "pid file: $!\n" }

    Or use utime if you want to diddle the modification time of an existing file rather than clobbering it. No need to start up an external touch (not to mention an external sh since you used one argument to system :).