Web lists-archives.com

Re: Running lighttpd as different user: /run/lighttpd still gets created with www-data user and group

Hello Sven,

thanks for your immediate reply! I did not have opportunity to see if it works, but I would be very astonished if it wouldn't! It seems like a perfect fit. Interesting, I did not not about this part of systemd before.

Thanks again and best regards,

Am Sa, 22. Dez 2018, um 16:29, schrieb Sven Joachim:
> On 2018-12-22 15:10 +0100, Manuel Wagesreither wrote:
> > I'm running an minbase installation of Debian Stretch and have
> > configured lighttpd to run as a different, non-www-data user. However,
> > when booting, lighttpd does not start successfully, as /run/lighttpd
> > is still owned by www-data. Only when I'm chowning it to the different
> > user, lighttpd can be started successfully.
> >
> > The system is booting from a readonly image. /run does exist there, but it not populated with a lighttpd directory.
> > The readonly image gets created using debootstrap. After
> > debootstrapping, a few shell scripts run which change lighttpd to run
> > as a different user.
> >
> > In detail, the shell scripts are
> > * replacing occurences of www-data by the new username in /etc/lighttpd/lighttpd.conf and /etc/init.d/lighttpd, and
> > * chownign the webroot, /var/log/lighttpd, /var/cache/lighttpd/compress, /var/cache/lighttpd/uploads
> >
> > At which point does /run/lighttpd get created,
> If you use systemd as init, the directory is created early by
> systemd-tmpfiles(8) as part of sysinit.target.
> > and how can I control the owning user and group of this directory?
> Copy /usr/lib/tmpfiles.d/lighttpd.tmpfile.conf to /etc/tmpfiles.d and
> replace the user and group there.  See tmpfiles.d(5).
> Cheers,
>        Sven