• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

daemon: command not found

by Deepika

In Linux, the daemon command is used to start a program as a daemon process, which is a background process that is detached from the terminal and runs independently of the user’s session. Daemon processes are typically used for long-running tasks or services that need to run continuously in the background.

For example, to run a command as a daemon, you could use the following command:

# daemon --name="name" command

This will start the command as a daemon process. The daemon command will fork the process and then exit, leaving the daemon process running in the background.

It is important to note that the daemon command is not a built-in shell command, but rather a separate utility that is typically installed as part of the daemon package. This package is usually available in the default repositories of most Linux distributions and can be installed using the package manager.

If you encounter the below error while running the command daemon:

daemon: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install daemon
Ubuntu apt-get install daemon
Kali Linux apt-get install daemon
OS X brew install daemon
Raspbian apt-get install daemon

daemon Command Examples

1. Run a command as a daemon:

# daemon --name="name" command

2. Run a command as a daemon which will restart if the command crashes:

# daemon --name="name" --respawn command

3. Run a command as a daemon which will restart if it crashes, with two attempts every 10 seconds:

# daemon --name="name" --respawn --attempts=2 --delay=10 command

4. Run a command as a daemon, writing logs to a specific file:

# daemon --name="name" --errlog=path/to/file.log command

5. Kill a daemon (SIGTERM):

# daemon --name="name" --stop

6. List daemons:

# daemon --list

Filed Under: Linux

Some more articles you might also be interested in …

  1. grub-bios-setup: command not found
  2. ttyrec – Record Terminal Session in Linux
  3. mdadm Command Examples in Linux
  4. CentOS/RHEL : Unmounting a Windows Share Fails – “device is busy”
  5. libreoffice Command Examples in Linux
  6. CentOS / RHEL 5, 6 : how to disable NetworkManager
  7. RHEL/CentOS 6,7 : How to caculate the size of hugepage used by a specific process/application
  8. Understanding Ksplice Effective Kernel Version
  9. CentOS / RHEL : How to restrict SSH login by time of day
  10. CentOS / RHEL : How to assemble a software RAID in Rescue mode

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright