Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8538773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:12:03+00:00 2026-06-11T11:12:03+00:00

I am writing a perl script to parse, for example, /var/log/syslog . The perl

  • 0

I am writing a perl script to parse, for example, /var/log/syslog.

The perl script triggers further subsequent tasks when particular events in the log appear. The log is parsed following the advice of this post:

Command line: monitor log file and add data to database

Which what I believe is the use of a pipe.

Now I’d like this script to forever run in the background.

This sounds like a daemon to me, and the daemon program referenced in the following question seems ideal:

How can I run a Perl script as a system daemon in linux?

But from this post, it seems clear that daemon’s have no open file handles. So how can I have a daemon, or a perl script that becomes a daemon, that monitors a logfile?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:12:04+00:00Added an answer on June 11, 2026 at 11:12 am

    It sounds like what you want is a daemon. In that case the advise given in the second post you reference is the best practice. However, you do have other options like daemontools, which removes the fork complexity.

    Daemons are allowed to have filehandles, but you should close STDIN, STDOUT, and STDERRR because you shouldn’t really use them anymore. A lot of this has to do with the way fork works in *nix systems. Just open the pipe filehandle after your second fork, and you shouldn’t have any issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing a Perl script to parse a config file. The syntax is
I am writing a perl script to parse tab delimited data from standard input.
I'm writing a perl script and I would really like to get the amount
I'm writing a perl script that will access a MySQL database to determine whether
I am writing a Perl script (in Windows) that is using File::Find to index
I'm writing a Perl script that reads data from the infamous /dev/input/event* and I
I am writing a script in perl where I use forking and I need
I'm writing a script using Perl and Net::FTP, which is trying to upload a
I'm writing a shell script that before running needs to check that system Perl
I am writing a script that executes a command remotely via SSH using perl.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.