Hi,

Quoting Alexandru Mihail (2023-09-16 16:40:38)
> > I asked in #debian-systemd and the fix could be as simple as setting the
> > following in the .service file:
> > 
> > EnvironmentFile=-/etc/default/mini-httpd
> > 
> > Can you confirm?
> I will test this and get back to you as soon as I can confirm the fix.
> Documentation on /etc/default/mini-httpd options is rather scarce, do
> you mind posting a minimal /etc/default/mini-httpd file with which I
> could confirm the fix (a path or port setting perhaps)? It would speed
> up my work here as the package does not provide a default one.

here is my /etc/default/mini-httpd:

START=1
DAEMON_OPTS="-h 127.0.0.1 -p 80 -u nobody -dd /mnt/cache -i 
/var/run/mini-httpd.pid -T UTF-8"

I successfully tested the following patch to the .service file:

@@ -5,7 +5,8 @@
 [Service]
 Type=forking
 PIDFile=/run/mini_httpd.pid
-ExecStart=/usr/sbin/mini_httpd -C /etc/mini-httpd.conf
+EnvironmentFile=-/etc/default/mini-httpd
+ExecStart=/usr/sbin/mini_httpd -C /etc/mini-httpd.conf $DAEMON_OPTS -i 
/run/mini_httpd.pid
 
 [Install]
 WantedBy=multi-user.target

The EnvironmentFile uses "=-" to support a non-existant
/etc/default/mini-httpd. The ExecStart line also adds a -i option to make sure
that neither /etc/mini-httpd.conf nor $DAEMON_OPTS can set -i to something that
is different from the path in PIDFile.

What do you think?

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to