Skip to content

Commit d0db62a

Browse files
committed
Use systemd-tmpfiles to create /var/run/uwsgi
On ubuntu contents of /var/run do not persist between reboots. Devstack uses /var/run/uwsgi as home for wsgi sockets. This means that after rebooting the machine services, that rely on uwsgi would fail to start. Currently it affects keystone.service and placement-api.service. This patch changes delegates directory creation to systemd-tmpfiles, which would run on startup. Change-Id: I27d168cea93698739ef08ac76c828695a49176c7 Closes-Bug: #1692767
1 parent 9b2a2fa commit d0db62a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/apache

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ function write_uwsgi_config {
229229
# create a home for the sockets; note don't use /tmp -- apache has
230230
# a private view of it on some platforms.
231231
local socket_dir='/var/run/uwsgi'
232-
sudo install -d -o $STACK_USER -m 755 $socket_dir
232+
233+
# /var/run will be empty on ubuntu after reboot, so we can use systemd-temptiles
234+
# to automatically create $socket_dir.
235+
sudo mkdir -p /etc/tmpfiles.d/
236+
echo "d $socket_dir 0755 $STACK_USER root" | sudo tee /etc/tmpfiles.d/uwsgi.conf
237+
sudo systemd-tmpfiles --create /etc/tmpfiles.d/uwsgi.conf
238+
233239
local socket="$socket_dir/${name}.socket"
234240

235241
# always cleanup given that we are using iniset here

0 commit comments

Comments
 (0)