Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
Daemon clean up itself when get killed

I'm try to create a daemon application by following the example :

Creating a daemon in Linux

In the example, there is no operations about the daemon stop.

Therefore, I'm curious about :

  1. How to send stop signal to the daemon ? Or just kill PID directly ?
  2. If the daemon only can stop on killed, should the daemon itself do the cleaning up operations on killed ? Just like close file descriptors, saving parameters, etc.

Thanks in advance.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

should the daemon itself do the cleaning up operations on killed ? Just like close file descriptors, saving parameters, etc.

Closing file descriptors is pointless -- they'll be automatically closed by the kernel when the process exits.

For "saving parameters", it depends on what you mean by "parameters". If you mean the command-line arguments, then no: when the daemon is restarted, it will get a fresh copy of these.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!