summaryrefslogtreecommitdiff
path: root/README.md
blob: 6614d7a2f9e00b5a8ddce4b29d83c585d4bc5482 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# daemonize
A utility to send shell commands to the background.

### Instant Install
Linux/BSD/\*nix other than OSX
```bash
curl -s https://raw.githubusercontent.com/cflems/daemonize/master/daemonize.c | sudo gcc -xc -o /usr/bin/daemonize -
```
OSX
```bash
curl -s https://raw.githubusercontent.com/cflems/daemonize/master/daemonize.c | sudo gcc -xc -o /usr/local/bin/daemonize -
```

### Usage
```bash
daemonize <command> [-d|--chdir] [-n|--noclose] [-1|--log-stdout <logfile>] [-2|--log-stderr <logfile>]
```
__command__: *(Required)* The command to execute as a daemon.

__--noclose__: *(Optional)* Leaves input and output streams to the current terminal session open. Individual streams are overridden with logging options.

__--chdir__: *(Optional)* Changes directory to / before executing <command>

__--log-stdout <logfile>__: *(Optional)* Reroutes the program's stdout to the given file before daemonizing.

__--log-stderr <logfile>__: *(Optional)* Reroutes the program's stderr to the given file before daemonizing.