Browse code

Merge "Use systemd-tmpfiles to create /var/run/uwsgi"

Jenkins authored on 2017/06/14 15:18:11
Showing 1 changed files
... ...
@@ -238,7 +238,13 @@ function write_uwsgi_config {
238 238
     # create a home for the sockets; note don't use /tmp -- apache has
239 239
     # a private view of it on some platforms.
240 240
     local socket_dir='/var/run/uwsgi'
241
-    sudo install -d -o $STACK_USER -m 755 $socket_dir
241
+
242
+    # /var/run will be empty on ubuntu after reboot, so we can use systemd-temptiles
243
+    # to automatically create $socket_dir.
244
+    sudo mkdir -p /etc/tmpfiles.d/
245
+    echo "d $socket_dir 0755 $STACK_USER root" | sudo tee /etc/tmpfiles.d/uwsgi.conf
246
+    sudo systemd-tmpfiles --create /etc/tmpfiles.d/uwsgi.conf
247
+
242 248
     local socket="$socket_dir/${name}.socket"
243 249
 
244 250
     # always cleanup given that we are using iniset here