Home Code Other Software

Table of Contents

Introduction

daemonize runs a command as a Unix daemon. As defined in W. Richard Stevens’ 1990 book, UNIX Network Programming (Addison-Wesley, 1990), a daemon is “a process that executes ‘in the background’ (i.e., without an associated terminal or login shell) either waiting for some event to occur, or waiting to perform some specified task on a periodic basis.” Upon startup, a typical daemon program will:

Most programs that are designed to be run as daemons do that work for themselves. However, you’ll occasionally run across one that does not. When you must run a daemon program that does not properly make itself into a true Unix daemon, you can use daemonize to force it to run as a true daemon.

See the man page for full details.

Notes

Getting daemonize

daemonize is written in C. Given the number of Unix-like operating systems, and the number of releases of each, it is impractical for me to provide binaries of daemonize for every combination of Unix-like operating system and operating system release.

If you’re on a Mac, you can use homebrew to instsall daemonize, like so:

$ brew install daemonize

If you’re on any other Unix-like operating system, you must build daemonize from source code, as described below.

There are two ways to get the source code:

Download a release zip

You can download a release zip file, containing the source, from the downloads page. Just unzip the file to unpack the source directory.

Clone the Git repository

You can also simply clone the git repository, using one of the following commands.

$ git clone git://github.com/bmc/daemonize.git
$ git clone http://github.com/bmc/daemonize.git

Installation

Once you’ve unpacked the source, change your working directory to the daemonize directory. From there, building and installing the code is fairly typical:

$ sh configure
$ make
$ sudo make install

For a detailed report of the available configure options:

$ sh configure --help

Notes

I have personally compiled and tested daemonize on the following platforms:

The accompanying “configure” script was generated with GNU autoconf version 2.69. It should work, as is, for most Unix systems.

Change Log

See the daemonize Change Log for a description of the changes in each version.

Author

Brian Clapper, bmc@clapper.org

Web Page

License

With the exception of the install-sh script and the getopt.c source, this software is released under BSD license. See the license for details.

Copyright

With the exception of the “install-sh” script and the “getopt.c” source, this software is copyright 2003-2011, Brian M. Clapper

Patches

I gladly accept patches from their original authors. Feel free to email patches to me or to fork the GitHub repository and send me a pull request. Along with any patch you send: