daemonize command not found

In this troubleshooting guide we learn how to fix daemonize command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

daemonize: command not found

or when using sudo you get the following error message

sudo: daemonize: command not found

Solutions to daemonize: command not found

How To Fix daemonize: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu daemonize is provided by daemonize package.

daemonize is:

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:

  • Close all open file descriptors (especially standard input, standard output and standard error)
  • Change its working directory to the root filesystem, to ensure that it doesn’t tie up another filesystem and prevent it from being unmounted
  • Reset its umask value
  • Run in the background (i.e., fork)
  • Disassociate from its process group (usually a shell), to insulate itself from signals (such as HUP) sent to the process group
  • Ignore all terminal I/O signals
  • Disassociate from the control terminal (and take steps not to reacquire one)
  • Handle any SIGCLD signals

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.

To fix this problem, we can install more using the command below.

sudo apt-get -y install daemonize

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install daemonize.

sudo apt -y install daemonize

Or if you have aptitude installed you can use the following command.

sudo aptitude install daemonize

Summary

In this tutorial we learn how to fix daemonize command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.