Dimitri
Dimitri

Reputation: 8280

Socket bind failed while configuring apache and renderd

I am trying to build a custom map server tile server by following this tutorial on switch2osm.

Instead of using ubuntu as described in the tutorial, I am using docker for everything (postgis, apache, etc)

I am trying to build an image where apache and renderd are configured (I followed the instructions found here)

Here is my Dockerfile :

FROM httpd:2.4

RUN apt-get update && \
  apt-get install -y libapache2-mod-tile renderd

 RUN a2enmod tile
 RUN a2enconf renderd

 CMD ["renderd", "-f", "&&", "httpd-foreground"]

I keep having this error after building and creating the container :

renderd[1]: Initialising unix server socket on /run/renderd/renderd.sock
socket bind failed for: /run/renderd/renderd.sock

I know that's a user right issue but I dont see how to fix it.

Please can anyone help me solves this issue ?

Upvotes: 2

Views: 476

Answers (2)

Johannes
Johannes

Reputation: 1

This worked for me

$ sudo mkdir /etc/systemd/system/renderd.service.d/
$ sudo nano /etc/systemd/system/renderd.service.d/custom.conf

[Service]
User=osm
RuntimeDirectory=renderd 

Upvotes: 0

rogers hellman
rogers hellman

Reputation: 31

I saw the same problem. I've partially resolved it by changing the owner of /run/renderd via sudo chown -R osm:osm /run/renderd

Then restarting the renderd process.

I've further tried (and failed) to make this permanent by modifying the file: /etc/systemd/system/multi-user.target.wants/renderd.service and specify the user there as well

[Service] ExecStart=/usr/bin/renderd -f User=osm

I do believe the above 'fix' has worked in the past, but doesn't seem to work now on Ubuntu 22.04

An addition to Roger Hellman's answer:

To make this permanent on Ubuntu 22.04 change the owner _renderd of /run/renderd to osm in the file /usr/lib/tmpfiles.d/renderd.conf.

Upvotes: 3

Related Questions