Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
93c330c4
Commit
93c330c4
authored
Nov 10, 2015
by
AJ ONeal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --pidfile string option
As per
https://github.com/mholt/caddy/issues/317
parent
76ec785e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
main.go
main.go
+11
-2
No files found.
main.go
View file @
93c330c4
...
...
@@ -18,9 +18,10 @@ import (
var
(
conf
string
cpu
string
version
bool
revoke
string
logfile
string
pidfile
string
revoke
string
version
bool
)
const
(
...
...
@@ -36,6 +37,7 @@ func init() {
flag
.
StringVar
(
&
caddy
.
Root
,
"root"
,
caddy
.
DefaultRoot
,
"Root path to default site"
)
flag
.
StringVar
(
&
caddy
.
Host
,
"host"
,
caddy
.
DefaultHost
,
"Default host"
)
flag
.
StringVar
(
&
caddy
.
Port
,
"port"
,
caddy
.
DefaultPort
,
"Default port"
)
flag
.
StringVar
(
&
pidfile
,
"pidfile"
,
""
,
"Path to write pid file"
)
flag
.
BoolVar
(
&
version
,
"version"
,
false
,
"Show version"
)
// TODO: Boulder dev URL is: http://192.168.99.100:4000
// TODO: Staging API URL is: https://acme-staging.api.letsencrypt.org
...
...
@@ -81,6 +83,13 @@ func main() {
fmt
.
Printf
(
"Revoked certificate for %s
\n
"
,
revoke
)
os
.
Exit
(
0
)
}
if
pidfile
!=
""
{
pid
:=
[]
byte
(
strconv
.
Itoa
(
os
.
Getpid
())
+
"
\n
"
)
err
:=
ioutil
.
WriteFile
(
pidfile
,
pid
,
0644
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
}
// Set CPU cap
err
:=
setCPU
(
cpu
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment