FreeBSD Bugzilla – Attachment 237027 Details for
Bug 255106
www/caddy: rc.d/caddy requires admin API for stopping
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
caddy shutdown improvement
caddy.patch (text/plain), 1.53 KB, created by
Mark Felder
on 2022-10-02 20:06:57 UTC
(
hide
)
Description:
caddy shutdown improvement
Filename:
MIME Type:
Creator:
Mark Felder
Created:
2022-10-02 20:06:57 UTC
Size:
1.53 KB
patch
obsolete
>diff --git a/www/caddy/Makefile b/www/caddy/Makefile >index 996886ebdf..d11e5fcc36 100644 >--- a/www/caddy/Makefile >+++ b/www/caddy/Makefile >@@ -1,7 +1,7 @@ > PORTNAME= caddy > DISTVERSIONPREFIX= v > DISTVERSION= 2.6.1 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES= www > DIST_SUBDIR= caddy > >diff --git a/www/caddy/files/caddy.in b/www/caddy/files/caddy.in >index 85251ab1c0..04d08add04 100644 >--- a/www/caddy/files/caddy.in >+++ b/www/caddy/files/caddy.in >@@ -61,7 +61,7 @@ required_files="${caddy_config} ${caddy_command}" > > start_precmd="caddy_precmd" > start_cmd="caddy_start" >-stop_precmd="caddy_prestop" >+stop_cmd="caddy_stop" > > # Extra Commands > extra_commands="configtest reload" >@@ -103,25 +103,18 @@ caddy_start() > fi > } > >-caddy_prestop() >+caddy_stop() > { >- local result >+ if [ -e ${pidfile} ]; then >+ _PID=$(pgrep -F ${pidfile}) >+ echo -n "Stopping caddy... " > >- echo -n "Stopping caddy... " >- >- result="$(caddy_execute stop 2>&1)" >- if [ ${?} -eq 0 ]; then >- echo "done" >- exit 0 >+ timeout -k 5s 2s /usr/bin/su -m "${caddy_user}" -c "${caddy_command} stop 2>&1" >/dev/null >+ kill $sig_stop ${_PID} >+ wait_for_pids ${_PID} > else >- if echo "${result}" | grep -q "connection refused"; then >- echo "admin interface unavailable; using pidfile" >- return 0 >- else >- echo "Error: Unable to stop caddy" >- echo "Check the caddy log: ${caddy_logfile}" >- return 1 >- fi >+ echo "${name} is not running." >+ return 1 > fi > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255106
: 237027 |
247686