From 1f2edd45b03a3e9d86d7c77847612c969b60b86f Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 19 Feb 2016 13:08:02 +0000 Subject: Ensure services don't start before /var is mounted I hit a strange issue after upgrading git.baserock.org where the wrong cgit.css stylesheet was being served. Restarting the lighttpd-git service fixed it. I suspect this might be to do with the service starting before the /var subvolume is mounted. I can't exactly prove it but this change seems sensible in any case. Change-Id: I535305da9ba6135851a38fd3d04c50876de99e21 --- units/git-daemon.service | 5 +++++ units/lighttpd-git.service | 5 +++++ units/lighttpd-morph-cache.service | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/units/git-daemon.service b/units/git-daemon.service index 330169c..fe61257 100644 --- a/units/git-daemon.service +++ b/units/git-daemon.service @@ -1,6 +1,11 @@ [Install] WantedBy=multi-user.target +# If there's a shared /var subvolume, it must be mounted before this +# unit runs. +Requires=local-fs.target +After=local-fs.target + [Unit] Description=Git Daemon for Trove After=network.target diff --git a/units/lighttpd-git.service b/units/lighttpd-git.service index 94c67a4..69dcc34 100644 --- a/units/lighttpd-git.service +++ b/units/lighttpd-git.service @@ -1,6 +1,11 @@ [Install] WantedBy=multi-user.target +# If there's a shared /var subvolume, it must be mounted before this +# unit runs. +Requires=local-fs.target +After=local-fs.target + [Unit] Description=Lighttpd Web Server After=network.target diff --git a/units/lighttpd-morph-cache.service b/units/lighttpd-morph-cache.service index c7f76e9..6e2a17a 100644 --- a/units/lighttpd-morph-cache.service +++ b/units/lighttpd-morph-cache.service @@ -1,6 +1,11 @@ [Install] WantedBy=multi-user.target +# If there's a shared /var subvolume, it must be mounted before this +# unit runs. +Requires=local-fs.target +After=local-fs.target + [Unit] Description=Lighttpd Web Server After=network.target -- cgit v1.2.1