Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 48 lines (35 sloc) 1.615 kB
b11deb4 initial import
Nate Wiger authored
1 launch-daemon
2 =============
3 This is a simple ANSI C Linux program that daemonizes naughty programs. I have found
4 that many scripts and web languages do not properly daemonize, and instead hang onto
5 controlling terminals or files. This can cause them to terminate strangely when you
6 exit the controlling shell.
7
8 This fixes that by redirecting I/O and terminals appropriately, as well as setting
9 the controlling process group to the scheduler. By default, output is redirected to /dev/null.
10 When launch-daemon successfully launches the new process, it will print the new PID to
11 stdout.
12
13 Compilation
14 -----------
15 Type:
16
17 make
18
19 Yay!
20
21 Usage
22 -----
23 Standard usage is:
24
25 launch-daemon [options] program [arguments ...]
26
27 Simple example:
28
29 launch-daemon -s log/resque_output.log rake start_resque_workers >resque.pid
30
31 The redirects any output (either stdout or stderr) via -s, and saves the PID into the
32 resque.pid file.
33
34 Options
35 -------
36
37 -h # display usage
38 -v # print version
39 -s stderrfile # redirect output to file (default: /dev/null)
40 -p port # bind and listen on the specified port (not normally needed)
41 -c # run command ala sh -c; detach but do not daemonize
42 -R /chroot # chroot to the specified path before forking (security)
43 -L /ld/lib/path # set LD_LIBRARY_PATH for programs that need it
44 -E exename # set the program name (overrides shell)
45 -u user # switch to the specified user before forking
46 -- # end of argument parsing
47
Something went wrong with that request. Please try again.