Author: ngie
Date: Mon May 30 19:59:51 2016
New Revision: 301004
URL: https://svnweb.freebsd.org/changeset/base/301004

Log:
  Fix circular dependency created after r287197 between ldconfig and 
mountcritremote
  
  ldconfig is already required by mountcritremote indirectly, as noted by 
rcorder:
  
  > rcorder: Circular dependency on provision `mountcritremote' in file 
`ldconfig'.
  
  Having mountcritremote REQUIRE ldconfig breaks dependency ordering.
  
  Making the ldconfig hints be conditionally regenerated from mountcritremote 
when
  remote filesystems are mounted is done after this change, similar to cleanvar
  being conditionally called after the change.
  
  Differential Revision: https://reviews.freebsd.org/D6621
  PR: 202726
  Reviewed by: jilles
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/etc/rc.d/ldconfig
  head/etc/rc.d/mountcritremote

Modified: head/etc/rc.d/ldconfig
==============================================================================
--- head/etc/rc.d/ldconfig      Mon May 30 19:32:56 2016        (r301003)
+++ head/etc/rc.d/ldconfig      Mon May 30 19:59:51 2016        (r301004)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: ldconfig
-# REQUIRE: mountcritremote FILESYSTEMS
+# REQUIRE: FILESYSTEMS
 # BEFORE:  DAEMON
 
 . /etc/rc.subr

Modified: head/etc/rc.d/mountcritremote
==============================================================================
--- head/etc/rc.d/mountcritremote       Mon May 30 19:32:56 2016        
(r301003)
+++ head/etc/rc.d/mountcritremote       Mon May 30 19:59:51 2016        
(r301004)
@@ -35,12 +35,15 @@ mountcritremote_precmd()
 
 mountcritremote_start()
 {
+       local mounted_remote_filesystem=false
+
        # Mount nfs filesystems.
        #
        case "`/sbin/mount -d -a -t nfs`" in
        '')
                ;;
        *)
+               mounted_remote_filesystem=true
                echo -n 'Mounting NFS filesystems:'
                mount -a -t nfs
                echo '.'
@@ -64,6 +67,7 @@ mountcritremote_start()
 
                case "`mount -d -a -t ${fstype}`" in
                *mount_${fstype}*)
+                       mounted_remote_filesystem=true
                        echo -n "Mounting ${fsdecr} filesystems:"
                        mount -a -t ${fstype}
                        echo '.'
@@ -71,9 +75,15 @@ mountcritremote_start()
                esac
        done
 
-       # Cleanup /var again just in case it's a network mount.
-       /etc/rc.d/cleanvar quietreload
-       rm -f /var/run/clean_var /var/spool/lock/clean_var
+       if $mounted_remote_filesystem; then
+               # Cleanup /var again just in case it's a network mount.
+               /etc/rc.d/cleanvar quietreload
+               rm -f /var/run/clean_var /var/spool/lock/clean_var
+
+               # Regenerate the ldconfig hints in case there are additional
+               # library paths on remote file systems
+               /etc/rc.d/ldconfig quietstart
+       fi
 }
 
 load_rc_config $name
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to