Book Image

BeagleBone Essentials

By : Rodolfo Giometti
Book Image

BeagleBone Essentials

By: Rodolfo Giometti

Overview of this book

Table of Contents (18 chapters)
BeagleBone Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Writing a custom daemon


As seen earlier, our BeagleBone Black has a lot of ready-to-use software, and a lot of readily available daemons that are useful for a lot of different tasks. However, we are developers, and if we have to develop some controlling or monitoring systems, it's quite normal that we should need a custom daemon to do our custom job.

In this last section, we'll see how to write our own daemon in several programming languages using a daemon skeleton that can be used to develop really complex daemons. Due to a lack of space, I cannot add all the possible features a daemon has, but the presented skeletons will have whatever you need to know about the daemon's creation.

All the example codes 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 the -d option...