update README

This commit is contained in:
AJ ONeal 2019-07-10 01:48:55 -06:00
parent b74d9f4332
commit f9631d852a
1 changed files with 54 additions and 48 deletions

102
README.md
View File

@ -9,59 +9,65 @@ Because debugging launchctl, systemd, etc absolutely sucks!
## Features ## Features
- Unprivileged (User Mode) Services - Unprivileged (User Mode) Services
- [x] Linux (`sytemctl --user`) - [x] Linux (`sytemctl --user`)
- [x] MacOS (`launchctl`) - [x] MacOS (`launchctl`)
- [x] Windows (`HKEY_CURRENT_USER/.../Run`) - [x] Windows (`HKEY_CURRENT_USER/.../Run`)
- Privileged (System) Services - Privileged (System) Services
- [x] Linux (`sudo sytemctl`) - [x] Linux (`sudo sytemctl`)
- [x] MacOS (`sudo launchctl`) - [x] MacOS (`sudo launchctl`)
- [ ] Windows (_not yet implemented_) - [ ] Windows (_not yet implemented_)
# Table of Contents # Table of Contents
- Usage - Usage
- Install - Install
- Examples - Examples
- compiled programs - compiled programs
- scripts - scripts
- bash - bash
- node - node
- python - python
- ruby - ruby
- Logging - Logging
- Debugging - Debugging
- Windows - Windows
- Building - Building
- Why - Why
- Legal - Legal
# Usage # Usage
The basic pattern of usage, and what that might look like: The basic pattern of usage:
``` ```
serviceman add [options] [interpreter] <service> -- [service options] serviceman add [options] [interpreter] <service> -- [service options]
serviceman start <service>
serviceman stop <service>
serviceman version
```
And what that might look like:
```
# Here the service is named "foo" implicitly
# '--bar /baz' is passed as arguments to foo.exe
serviceman add foo.exe -- --bar /baz
``` ```
``` ```
serviceman add foo.exe # Here the service is named "foo-app" explicitly
# 'node' will be found in the path
# './index.js' will be resolved to a full path
serviceman add --name "foo-app" node ./index.js
``` ```
``` You can also view the help:
serviceman add --title "Foo App" node ./foo.js -- --bar
```
You can also view the help and the version:
``` ```
serviceman add --help serviceman add --help
``` ```
```
serviceman version
```
# Install # Install
There are a number of pre-built binaries. There are a number of pre-built binaries.
@ -336,9 +342,9 @@ By default it's one of these:
You set it with one of these: You set it with one of these:
- `--logdir <path>` (cli) - `--logdir <path>` (cli)
- `"logdir": "<path>"` (json) - `"logdir": "<path>"` (json)
- `Logdir: "<path>"` (go) - `Logdir: "<path>"` (go)
If anything about the logging sucks, tell me... unless they're your logs If anything about the logging sucks, tell me... unless they're your logs
(which they probably are), in which case _you_ should fix them. (which they probably are), in which case _you_ should fix them.
@ -373,9 +379,9 @@ Where `conf.json` looks something like
```json ```json
{ {
"title": "Demo", "title": "Demo",
"exec": "/Users/me/go-demo/demo", "exec": "/Users/me/go-demo/demo",
"argv": ["--foo", "bar", "--baz", "qux"] "argv": ["--foo", "bar", "--baz", "qux"]
} }
``` ```
@ -389,10 +395,10 @@ names and relative paths.
```json ```json
{ {
"title": "Demo", "title": "Demo",
"interpreter": "node.exe", "interpreter": "node.exe",
"exec": "./bin/demo.js", "exec": "./bin/demo.js",
"argv": ["--foo", "bar", "--baz", "qux"] "argv": ["--foo", "bar", "--baz", "qux"]
} }
``` ```
@ -400,12 +406,12 @@ That's equivalent to this:
```json ```json
{ {
"title": "Demo", "title": "Demo",
"name": "demo", "name": "demo",
"exec": "node.exe", "exec": "node.exe",
"argv": ["./bin/demo.js", "--foo", "bar", "--baz", "qux"] "argv": ["./bin/demo.js", "--foo", "bar", "--baz", "qux"]
} }
``` ```