This library provides a small library for developing applications that can run as daemon. It is aimed at being small, portable and does not have any external dependencies.
The library is written to create small daemonized "bridge" applications that bridge information from one server to another server. As such, its implementation is heavily opinionated and might not work for other use cases.
The features of this library are:
- allow applications to run both in foreground as in daemon mode;
- provide basal logging functionality that just works(tm);
- provide simple support for dealing with operating system signals, such as, SIGHUP, SIGUSR1 and so on;
- allow for a polling based approach (using
poll(3)
) to wait for events of multiple sources; - provide simple task scheduling, for example, to handle automatic reconnects to disconnected servers.
See example/test_complete.c
for a comprehensive example on how udaemon works.
This project uses CMake. To compile it, do:
$ cd build
$ cmake -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make
Once complete, among the various build files are libudaemon.a
and
test_complete
. The latter can be used to test the working of libudaemon.
After compilation a simple make install
will install everything to the path
provided by the CMAKE_INSTALL_PREFIX
definition. If omitted, the files are
installed under /usr/local
.
libudaemon is licensed under Apache License 2.0.
libudaemon is written by Jan Willem Janssen j dot w dot janssen at lxtreme dot nl
.
(C) Copyright 2020, Jan Willem Janssen.