• Wincent
    Open
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search

Running a shell script as a daemonEdit

Created 9/14/2015, updated 5/18/2017

The quick and dirty way:

$ (./script.sh &) &

Via: http://stackoverflow.com/a/3430969/2103996

Note: This "double-background" trick doesn’t really daemonize the script, because it’s not disconnecting standard in, standard out or standard error, nor is it making use of setsid to create a new process group.

  • shell
  • wiki
Site
  • About
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search
External
  • GitHub
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
Colophon

Made by Greg Hurrell using React, Relay and GraphQL (with help from Git, Redis and Neovim).