sysklogd

Jan Dvořák mordae at thirdcms.org
Wed May 23 16:21:31 PDT 2007


Robert Connolly wrote:
> Is there a shell varable 
> for the pid returned after starting a program?
At least I don't know about any. However, you can use this simple trick 
if the deamon does not fork afterwards;

#!/bin/sh

export deamon='/usr/sbin/exampled'
export pidfile='/var/run/exampled.pid'

sh -c 'echo $$ >"${pidfile}"; exec "${daemon}"' &

# EOF

This should do the trick.



More information about the hlfs-dev mailing list