O'Reilly logo

GNU/Linux Rapid Embedded Programming by Rodolfo Giometti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required