chiark / gitweb /
mount: pull in quota services from local mountpoints with usr/grpquota options
authorAndrey Borzenkov <arvidjaar@gmail.com>
Fri, 18 Mar 2011 16:12:58 +0000 (19:12 +0300)
committerAndrey Borzenkov <arvidjaar@gmail.com>
Fri, 18 Mar 2011 16:12:58 +0000 (19:12 +0300)
Makefile.am
src/mount.c
src/special.h
units/quotacheck.service.in
units/quotaon.service

index 371cc562e92bcb60776166f3bff0af6e85d8205c..8df636f39c840258d9b9a84f01f560beb2b3fbd7 100644 (file)
@@ -1327,10 +1327,6 @@ install-data-hook:
                $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
                $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
                $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
-       ( cd $(DESTDIR)$(pkgsysconfdir)/system/local-fs.target.wants && \
-               rm -f quotaon.service quotacheck.service && \
-               $(LN_S) $(systemunitdir)/quotacheck.service quotacheck.service && \
-               $(LN_S) $(systemunitdir)/quotaon.service quotaon.service )
        ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
                rm -f remote-fs.target && \
                $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
index 39525b66509964e12cc8080772434bab1363aaf0..99867172c9816e85c5b1469f4397a7d1cfe16fe8 100644 (file)
@@ -413,9 +413,22 @@ static int mount_add_default_dependencies(Mount *m) {
 
         if (m->meta.manager->running_as == MANAGER_SYSTEM &&
             !path_equal(m->where, "/")) {
+                MountParameters *p;
 
-                if ((r = unit_add_dependency_by_name(UNIT(m), UNIT_BEFORE, SPECIAL_QUOTACHECK_SERVICE, NULL, true)) < 0)
-                        return r;
+                if (m->from_fragment)
+                        p = &m->parameters_fragment;
+                else if (m->from_etc_fstab)
+                        p = &m->parameters_etc_fstab;
+                else
+                        p = NULL;
+
+                if (!p ||
+                    (!mount_test_option(p->options, "_netdev") &&
+                    !(p->fstype && fstype_is_network(p->fstype)) &&
+                    (mount_test_option(p->options, "usrquota") || mount_test_option(p->options, "grpquota"))))
+                        if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTACHECK_SERVICE, NULL, true)) < 0 ||
+                            (r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_WANTS, SPECIAL_QUOTAON_SERVICE, NULL, true)) < 0)
+                                return r;
 
                 if ((r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
                         return r;
index 6a75e2cf7d5fc78a28631231a30dcb061b149dd8..6cedf18c035e5959ed3523cfcd4bf787084955ba 100644 (file)
@@ -62,6 +62,7 @@
 /* Magic early boot services */
 #define SPECIAL_FSCK_SERVICE "fsck@.service"
 #define SPECIAL_QUOTACHECK_SERVICE "quotacheck.service"
+#define SPECIAL_QUOTAON_SERVICE "quotaon.service"
 #define SPECIAL_REMOUNT_ROOTFS_SERVICE "remount-rootfs.service"
 
 /* Services systemd relies on */
index d46a33564927f6e80287501969fc405702a11367..ed1ddc55896cf7f85381452aec0c23e61cd15ece 100644 (file)
@@ -18,6 +18,3 @@ RemainAfterExit=yes
 ExecStart=@rootlibexecdir@/systemd-quotacheck
 StandardOutput=syslog
 TimeoutSec=0
-
-[Install]
-WantedBy=local-fs.target
index ddb51284d9c19231aa4394cb2d4b1f6391d49cce..2c7b36b4fef611887dd64a3064038aa4d035a7c1 100644 (file)
@@ -17,6 +17,3 @@ Type=oneshot
 RemainAfterExit=yes
 ExecStart=/sbin/quotaon -aug
 StandardOutput=syslog
-
-[Install]
-WantedBy=local-fs.target