summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/lighttpd/files')
-rw-r--r--www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch74
-rw-r--r--www-servers/lighttpd/files/lighttpd.initd-r179
-rw-r--r--www-servers/lighttpd/files/lighttpd.service-r215
3 files changed, 15 insertions, 153 deletions
diff --git a/www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch b/www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch
deleted file mode 100644
index d7bd72973b94..000000000000
--- a/www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-https://bugs.gentoo.org/931305
-https://github.com/lighttpd/lighttpd1.4/commit/524614455554163ec78b27b89ff52bbf7fe96958
-
-From 524614455554163ec78b27b89ff52bbf7fe96958 Mon Sep 17 00:00:00 2001
-From: Glenn Strauss <gstrauss@gluelogic.com>
-Date: Wed, 24 Apr 2024 03:07:37 -0400
-Subject: [PATCH] [core] special value for Linux POLLRDHUP on SPARC (fixes
- #3251)
-
-x-ref:
- "[1.4.76] buildroot compile error with bootlin-sparc{64-g,-uc}libc"
- https://redmine.lighttpd.net/issues/3251
---- a/src/fdevent.h
-+++ b/src/fdevent.h
-@@ -40,6 +40,8 @@ struct fdnode_st {
- #if (defined(__sun) && defined(__SVR4)) /* Solaris */ \
- || defined(__FreeBSD__)
- #define FDEVENT_RDHUP 0x4000
-+#elif (defined(__linux__) && (defined(__sparc__) || defined(__sparc)))
-+#define FDEVENT_RDHUP 0x2800 /*(0x2000 EPOLLRDHUP | 0x0800 POLLRDHUP)*/
- #else
- #define FDEVENT_RDHUP 0x2000
- #endif
---- a/src/fdevent_impl.c
-+++ b/src/fdevent_impl.c
-@@ -338,6 +338,11 @@ fdevent_linux_sysepoll_event_set (fdevents *ev, fdnode *fdn, int events)
- struct epoll_event ep;
- #ifndef EPOLLRDHUP
- events &= ~FDEVENT_RDHUP;
-+ #elif (defined(__linux__) && (defined(__sparc__) || defined(__sparc)))
-+ if (events & FDEVENT_RDHUP) {
-+ events &= ~FDEVENT_RDHUP;
-+ events |= EPOLLRDHUP;
-+ }
- #endif
- ep.events = events | EPOLLERR | EPOLLHUP;
- ep.data.ptr = fdn;
-@@ -376,7 +381,11 @@ fdevent_linux_sysepoll_init (fdevents *ev)
- ck_static_assert(EPOLLERR == FDEVENT_ERR);
- ck_static_assert(EPOLLHUP == FDEVENT_HUP);
- #ifdef EPOLLRDHUP
-+ #if (defined(__linux__) && (defined(__sparc__) || defined(__sparc)))
-+ ck_static_assert(EPOLLRDHUP & FDEVENT_RDHUP);
-+ #else
- ck_static_assert(EPOLLRDHUP == FDEVENT_RDHUP);
-+ #endif
- #endif
-
- ev->type = FDEVENT_HANDLER_LINUX_SYSEPOLL;
-@@ -770,6 +779,11 @@ fdevent_poll_event_set (fdevents *ev, fdnode *fdn, int events)
-
- #ifndef POLLRDHUP
- events &= ~FDEVENT_RDHUP;
-+ #elif (defined(__linux__) && (defined(__sparc__) || defined(__sparc)))
-+ if (events & FDEVENT_RDHUP) {
-+ events &= ~FDEVENT_RDHUP;
-+ events |= POLLRDHUP;
-+ }
- #endif
-
- if (k >= 0) {
-@@ -854,7 +868,11 @@ fdevent_poll_init (fdevents *ev)
- ck_static_assert(POLLHUP == FDEVENT_HUP);
- ck_static_assert(POLLNVAL == FDEVENT_NVAL);
- #ifdef POLLRDHUP
-+ #if (defined(__linux__) && (defined(__sparc__) || defined(__sparc)))
-+ ck_static_assert(POLLRDHUP & FDEVENT_RDHUP);
-+ #else
- ck_static_assert(POLLRDHUP == FDEVENT_RDHUP);
-+ #endif
- #endif
-
- ev->type = FDEVENT_HANDLER_POLL;
-
diff --git a/www-servers/lighttpd/files/lighttpd.initd-r1 b/www-servers/lighttpd/files/lighttpd.initd-r1
deleted file mode 100644
index f355a5c7232d..000000000000
--- a/www-servers/lighttpd/files/lighttpd.initd-r1
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-extra_started_commands="reload graceful"
-
-LIGHTTPD_PID="$($(which lighttpd) -pf ${LIGHTTPD_CONF} | grep server.pid-file | cut -d '=' -f 2 | tr -d \\\" | tr -d [:space:])"
-
-depend() {
- need net
- use mysql logger spawn-fcgi ldap slapd netmount dns
- after famd
- after sshd
-}
-
-checkconfig() {
- if [ ! -f "${LIGHTTPD_CONF}" ] ; then
- ewarn "${LIGHTTPD_CONF} does not exist."
- return 1
- fi
-
- if [ -z "${LIGHTTPD_PID}" ] ; then
- eerror "server.pid-file variable in ${LIGHTTPD_CONF}"
- eerror "is not set. Please set this variable properly"
- eerror "and try again"
- return 1
- fi
- /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null
-}
-
-start() {
- checkconfig || return 1
- # Glean lighttpd's credentials from the configuration file
- # Fixes bug 454366
- LIGHTTPD_USER="$(awk '/^server.username/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
- LIGHTTPD_GROUP="$(awk '/^server.groupname/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
- checkpath -d -q -m 0750 -o "${LIGHTTPD_USER}":"${LIGHTTPD_GROUP}" /run/lighttpd/
-
- ebegin "Starting lighttpd"
- start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \
- --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}"
- eend $?
-}
-
-stop() {
- local rv=0
- ebegin "Stopping lighttpd"
- start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}"
- eend $?
-}
-
-reload() {
- if ! service_started "${SVCNAME}" ; then
- eerror "${SVCNAME} isn't running"
- return 1
- fi
- checkconfig || return 1
-
- ebegin "Re-opening lighttpd log files"
- start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \
- --signal HUP
- eend $?
-}
-
-graceful() {
- if ! service_started "${SVCNAME}" ; then
- eerror "${SVCNAME} isn't running"
- return 1
- fi
- checkconfig || return 1
-
- ebegin "Gracefully stopping lighttpd"
- start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \
- --signal INT
- if eend $? ; then
- rm -f "${LIGHTTPD_PID}"
- start
- fi
-}
diff --git a/www-servers/lighttpd/files/lighttpd.service-r2 b/www-servers/lighttpd/files/lighttpd.service-r2
new file mode 100644
index 000000000000..09fd87d2dfda
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.service-r2
@@ -0,0 +1,15 @@
+[Unit]
+Description=Lighttpd Daemon
+After=syslog.target network-online.target
+
+[Service]
+Type=simple
+PIDFile=/run/lighttpd.pid
+ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
+ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
+ExecReload=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
+ExecReload=/bin/kill -USR1 $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target