tags:

views:

18

answers:

0

I am trying to daemonize a perl process example test to syslog.

1) in the perl script it already log into rotate log file but I would like to log the daemonize for case of when things goes wrong before log get create 2) currently I am doing sudo /usr/sbin/daemonize -u User -a -e /home/users/me/log/log.log /home/users/me/test

It already working but the issue is that the log file will get big and the only way to handle the log file is if daemonize is stop.

So I am trying to log into syslog so I am doing

sudo /usr/sbin/daemonize -u User -a -e /dev/stderr /home/users/me/test | logger

this will have permission error when write to stderr. If I don't run as User it get log fine but for security reason I have to run my daemonize as User.

I am stuck any help is appreciate

my test sub main{ my $i = 0; for($i=0; $i < 10 ; $i++){ print "this is a test " . $i . " \n"; } }

main(@ARG);

Note I also tried the 2>&1 but does not work