Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanhood/daemon_examples
https://github.com/jonathanhood/daemon_examples
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jonathanhood/daemon_examples
- Owner: jonathanhood
- Created: 2015-03-24T01:25:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-30T18:17:14.000Z (almost 10 years ago)
- Last Synced: 2024-03-18T06:51:50.722Z (10 months ago)
- Language: Shell
- Size: 121 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
daemon-examples
===============Several small implementations of a unix daemon in various languages. They
each follow the process of:1. Forking to create a subprocess
2. Calling setsid to accomplish various items
1. Create a new session
2. Become leader of the new process group
3. Remove any controlling tty
3. Forking again to avoid acquiring a tty again
4. Redirecting stdout, stderr to a log file
5. Setting stdin to /dev/null
6. Writing a pidfile
7. Closing all open non-std file descriptors (if necessary)
8. Running some "useful" codeMissing Pieces
==============1. None of the implementations here cd to /, which is recommened to avoid
daemon execution inside a mounted volume.
2. Setting umask appropriately
3. Changing to an appropriate user for the daemon to run as