Writing a custom daemon
In this last section, we'll learn how to write our own daemon in several programming languages using a skeleton that can be used to quickly develop really complex daemons. Due to the lack of space, we cannot add all the possible features a daemon has, but the presented skeletons will have whatever you need to know about daemon creation.
All example code will implement a daemon with the following command line usage:
usage: mydaemon [-h] [-d] [-f] [-l] -h - show this message -d - enable debugging messages -f - do not daemonize -l - log on stderr
The -h
option argument will show the help message, while -d
will enable the debugging messages. The -f
option argument will prevent the daemon from running in the background, and the ...
Get GNU/Linux Rapid Embedded Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.