summaryrefslogtreecommitdiff
path: root/cmd/commands.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-05-13 11:28:15 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-05-13 11:28:15 -0600
commit4df56c77e380cdfec5e23862f7faa8bd843022e6 (patch)
tree09fdf02b4ffc915b520a5249e91e839b0ea997e2 /cmd/commands.go
parentcee5589b9856de299ea6960d60541d851498b7c3 (diff)
cmd: Add pidfile support (closes #3235)
Diffstat (limited to 'cmd/commands.go')
-rw-r--r--cmd/commands.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/commands.go b/cmd/commands.go
index e02f6a0..5a40b1d 100644
--- a/cmd/commands.go
+++ b/cmd/commands.go
@@ -74,7 +74,7 @@ func init() {
RegisterCommand(Command{
Name: "start",
Func: cmdStart,
- Usage: "[--config <path> [--adapter <name>]] [--watch]",
+ Usage: "[--config <path> [--adapter <name>]] [--watch] [--pidfile <file>]",
Short: "Starts the Caddy process in the background and then returns",
Long: `
Starts the Caddy process, optionally bootstrapped with an initial config file.
@@ -87,6 +87,7 @@ using 'caddy run' instead to keep it in the foreground.`,
fs := flag.NewFlagSet("start", flag.ExitOnError)
fs.String("config", "", "Configuration file")
fs.String("adapter", "", "Name of config adapter to apply")
+ fs.String("pidfile", "", "Path of file to which to write process ID")
fs.Bool("watch", false, "Reload changed config file automatically")
return fs
}(),
@@ -95,7 +96,7 @@ using 'caddy run' instead to keep it in the foreground.`,
RegisterCommand(Command{
Name: "run",
Func: cmdRun,
- Usage: "[--config <path> [--adapter <name>]] [--environ] [--watch]",
+ Usage: "[--config <path> [--adapter <name>]] [--environ] [--resume] [--watch] [--pidfile <fil>]",
Short: `Starts the Caddy process and blocks indefinitely`,
Long: `
Starts the Caddy process, optionally bootstrapped with an initial config file,
@@ -132,6 +133,7 @@ development environment.`,
fs.Bool("environ", false, "Print environment")
fs.Bool("resume", false, "Use saved config, if any (and prefer over --config file)")
fs.Bool("watch", false, "Watch config file for changes and reload it automatically")
+ fs.String("pidfile", "", "Path of file to which to write process ID")
fs.String("pingback", "", "Echo confirmation bytes to this address on success")
return fs
}(),