Hi,
mini_httpd is quite picky about the availability of paths to the log and
pid files. If those folders do not exist, e.g. because they point to an
after the system boot empty tmpfs, mini_httpd (as such ACF) will crash.
The patch below ensures the folders are available. Please, consider
integrating it.
Regards, Tiger
--- /etc/init.d/mini_httpd.orig
+++ /etc/init.d/mini_httpd
@@ -6,0 +7 @@
+logfile=/var/log/mini_httpd/${SVCNAME}.log
@@ -14,0 +16,2 @@
+ mkdir -p "$(echo $pidfile | sed 's|/[^/]*$||')"
+ mkdir -p "$(echo $logfile | sed 's|/[^/]*$||')"
@@ -17 +20 @@
- ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l
/var/log/mini_httpd/${SVCNAME}.log}
+ ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l $logfile}
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---
On Sat, 24 Mar 2012 21:45:31 +0100
Der Tiger <der.tiger.alpine@arcor.de> wrote:
> Hi,> > mini_httpd is quite picky about the availability of paths to the log> and pid files. If those folders do not exist, e.g. because they point> to an after the system boot empty tmpfs, mini_httpd (as such ACF)> will crash.
Hi, thanks for the feedback.
> > The patch below ensures the folders are available. Please, consider> integrating it.
I get this error when tryin apply it:
fatal: cannot convert from ISO-8859-15 to UTF-8
> > Regards, Tiger> > --- /etc/init.d/mini_httpd.orig> +++ /etc/init.d/mini_httpd> @@ -6,0 +7 @@> +logfile=/var/log/mini_httpd/${SVCNAME}.log> @@ -14,0 +16,2 @@> + mkdir -p "$(echo $pidfile | sed 's|/[^/]*$||')"> + mkdir -p "$(echo $logfile | sed 's|/[^/]*$||')"
openrc has a tool for this. checkpath.
how about something like:
checkpath -d ${pidfile%/*}
checkpath -d ${logfile%/*}
For documentation:
apk add openrc-doc
man runscript
We should add how to create dirs for pidfiles to the wiki. And no, we
cannot expect the package create subdirs under /var/run (or /run)
because /var/run could be a tmpfs mount.
> @@ -17 +20 @@> - ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l> /var/log/mini_httpd/${SVCNAME}.log}> + ${MINI_HTTPD_OPTS:--C /etc/${SVCNAME}.conf -l $logfile}> > > > ---> Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org> Help: alpine-devel+help@lists.alpinelinux.org> --->
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---