• 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

daemonize Command Examples in Linux

by Deepika

daemonize is a utility that allows you to run a command as a Unix daemon, which is a background process that is detached from the terminal and runs independently of the user’s session. It is useful for running long-running tasks or services that need to run continuously in the background.

To use daemonize, you will need to specify the command that you want to run as a daemon, as well as any necessary options or arguments. For example:

# daemonize command command_arguments

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

daemonize Command Examples

1. Run a command as a daemon:

# daemonize command command_arguments

2. Write the PID to the specified file:

# daemonize -p path/to/pidfile command command_arguments

3. Use a lock file to ensure that only one instance runs at a time:

# daemonize -l path/to/lockfile command command_arguments

4. Use the specified user account:

# sudo daemonize -u user command command_arguments

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : Unable To Start The Samba Service
  2. CentOS / RHEL 7 : How to modify Network Interface names
  3. enum4linux Command Examples in Linux
  4. soxi: command not found
  5. pwck Command Examples in Linux
  6. CentOS / RHEL 7 : How to configure kdump using GUI
  7. How to enable or disable service on boot with chkconfig
  8. mumble Command Examples in Linux
  9. partx Command Examples in Linux
  10. How to make a LED flash with the Raspberry Pi

You May Also Like

Primary Sidebar

Recent Posts

  • batch: Execute commands at a later time when the system load levels permit
  • bat: Print and concatenate files
  • bastet: Clone of the game Tetris in the terminal
  • bashmarks: Save and jump to commonly used directories using 1 character commands

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright