git: a3fbcaec5398 - main - www/apache24: make the start script service jails ready

From: Alexander Leidinger <netchild_at_FreeBSD.org>
Date: Fri, 29 Aug 2025 08:07:49 UTC
The branch main has been updated by netchild:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a3fbcaec539824a635d1bd53a2508fafae06ec6a

commit a3fbcaec539824a635d1bd53a2508fafae06ec6a
Author:     Alexander Leidinger <netchild@FreeBSD.org>
AuthorDate: 2025-08-29 07:44:59 +0000
Commit:     Alexander Leidinger <netchild@FreeBSD.org>
CommitDate: 2025-08-29 08:07:34 +0000

    www/apache24: make the start script service jails ready
    
    The setup I've chosen is to allow ipv4/ipv6 access. It does not allow
    to use sysv IPC in a jail. If you want to use this possibility, the
    config would need to be changed to "net_basic sysvipc" instead.
    More advanced use cases may need different service jail options.
    The config can be overridden in rc.conf.
    
    See also:
      https://docs.freebsd.org/en/books/handbook/jails/#service-jails
      https://docs.freebsd.org/en/articles/rc-scripting/#rcng-service-jails
    
    Some notes:
     - There are special apache24_limits_* stuff which is different from
       the name_limits stuff as part of the rc framework.
     - The limits part in the precmd will probably not work in a service
       jail, as the start command will be executed in a jail and the precmd
       outside the jail.
     - While the patch is taking the profiles into account, it may fail when
       the jail is started, as the name of the service jail is derived from
       the name of the rc script (assuming "profiles" means different
       instances of apache are started for each profile).
       The tomcat/oauth2-proxy/openhab ports use a way to have different
       instances of the software running in parallel which is based upon the
       name of the rc script (via links to the original rc script). That way
       works well with service jails.
    
    Approved by:    maintainer timeout
    PR:             279494
---
 www/apache24/Makefile          | 1 +
 www/apache24/files/apache24.in | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/www/apache24/Makefile b/www/apache24/Makefile
index d356e4acadd4..ab878e5db287 100644
--- a/www/apache24/Makefile
+++ b/www/apache24/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	apache24
 PORTVERSION=	2.4.65
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	APACHE_HTTPD
 DISTNAME=	httpd-${PORTVERSION}
diff --git a/www/apache24/files/apache24.in b/www/apache24/files/apache24.in
index 0b9c4bd55ba6..d9ced6f55d73 100644
--- a/www/apache24/files/apache24.in
+++ b/www/apache24/files/apache24.in
@@ -43,6 +43,8 @@ pidfile="${_pidprefix}.pid"
 required_files=%%PREFIX%%/etc/apache24/httpd.conf
 envvars="%%PREFIX%%/sbin/envvars"
 
+: ${apache24_svcj_options:="net_basic"}
+
 [ -z "$apache24_enable" ]       && apache24_enable="NO"
 [ -z "$apache24limits_enable" ] && apache24limits_enable="NO"
 [ -z "$apache24limits_args" ]   && apache24limits_args="-e -C daemon"
@@ -83,6 +85,7 @@ if [ -n "$2" ]; then
 		eval command="\${apache24_${profile}_command:-${command}}"
 		eval pidfile="\${apache24_${profile}_pidfile:-${pidfile}}"
 		eval apache24_envvars="\${apache24_${profile}_envvars:-${envvars}}"
+		eval apache24_svcj_options="\${apache24_${profile}_svcj_options:-${apache24_svcj_options}}"
 		apache24_flags="-f ${apache24_configfile} -c \"PidFile ${pidfile}\" ${apache24_flags}"
 	else
 		echo "$0: extra argument ignored"