mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
dist/init/linux-sysvinit: process @weingart's feedback (#1008)
* dist/init/linux-sysvinit: use kill -0 to test process status * dist/init/linux-sysvinit: use service (as root) instead of /etc/init.d/
This commit is contained in:
parent
e081d8b5c2
commit
dbd76f7a57
2 changed files with 4 additions and 5 deletions
2
dist/init/linux-sysvinit/README.md
vendored
2
dist/init/linux-sysvinit/README.md
vendored
|
@ -8,4 +8,4 @@ Usage
|
|||
* Save the SysVinit config file in `/etc/init.d/caddy`.
|
||||
* Ensure that the folder `/etc/caddy` exists and that the subfolder `ssl` is owned by `www-data`.
|
||||
* Create a Caddyfile in `/etc/caddy/Caddyfile`
|
||||
* Now you can use `sudo /etc/init.d/caddy start|stop|restart|reload|status`.
|
||||
* Now you can use `service caddy start|stop|restart|reload|status` as `root`.
|
||||
|
|
7
dist/init/linux-sysvinit/caddy
vendored
7
dist/init/linux-sysvinit/caddy
vendored
|
@ -53,11 +53,10 @@ reload() {
|
|||
|
||||
status() {
|
||||
if [ -f $PIDFILE ]; then
|
||||
PID=`cat $PIDFILE`
|
||||
if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then
|
||||
echo "$NAME process is dead, but pidfile exists"
|
||||
else
|
||||
if kill -0 $(cat "$PIDFILE"); then
|
||||
echo "$NAME is running"
|
||||
else
|
||||
echo "$NAME process is dead, but pidfile exists"
|
||||
fi
|
||||
else
|
||||
echo "$NAME is not running"
|
||||
|
|
Loading…
Reference in a new issue