From f8b7a57a8305e8397d07fe5e04283dba75d34812 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sun, 10 Mar 2013 09:45:58 -0700 Subject: [PATCH] rc.d/ldconfig: Add a mechanism to include files added by dports. Add a mechanism to include files added by dports which contain the names of directories to include in the base ldconfig script. This will eliminate the need for each port to install its own boot script which does nothing but ldconfig a given directory. Obtained-from: FreeBSD --- etc/defaults/rc.conf | 2 ++ etc/mtree/BSD.local.dist | 2 ++ etc/rc.d/ldconfig | 5 +++++ share/man/man5/rc.conf.5 | 8 ++++++++ 4 files changed, 17 insertions(+) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index af6aca5..45e3132 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -380,6 +380,8 @@ clear_tmp_enable="NO" # Clear /tmp at startup. ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks ldconfig_paths="/usr/lib /usr/lib/compat /usr/pkg/lib /usr/local/lib" # shared library search paths +ldconfig_local_dirs="/usr/local/libdata/ldconfig" + # Local directories with ldconfig configuration files. kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure update_motd="YES" # update version info in /etc/motd (or NO) start_vinum="NO" # set to YES to start vinum diff --git a/etc/mtree/BSD.local.dist b/etc/mtree/BSD.local.dist index 2deffe5..7eb021f 100644 --- a/etc/mtree/BSD.local.dist +++ b/etc/mtree/BSD.local.dist @@ -23,6 +23,8 @@ .. .. libdata + ldconfig + .. .. libexec .. diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig index 4d74b64..5564efb 100644 --- a/etc/rc.d/ldconfig +++ b/etc/rc.d/ldconfig @@ -23,6 +23,11 @@ ldconfig_start() checkyesno ldconfig_insecure && _ins="-i" if [ -x "${ldconfig_command}" ]; then _LDC="" + for i in ${ldconfig_local_dirs}; do + if [ -d "${i}" ]; then + ldconfig_paths="${ldconfig_paths} `find ${i} -type f`" + fi + done for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do if [ -r "${i}" ]; then _LDC="${_LDC} ${i}" diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index ab9a38c..1af915d 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -2232,6 +2232,14 @@ which are writable by anyone except root. Set this variable to .Dq Li YES to disable that security check during system startup. +.It Va ldconfig_local_dirs +.Pq Vt str +Set to the list of local +.Xr ldconfig 8 +directories. +The names of all files in the directories listed will be +passed as arguments to +.Xr ldconfig 8 . .It Va kern_securelevel .Pq Vt int The kernel security level to set at startup. -- 1.8.1.3