SOURCES: prelink.cron (NEW), prelink.sysconfig (NEW) - copied from...
glen
glen at pld-linux.org
Fri Jan 6 14:09:01 CET 2006
Author: glen Date: Fri Jan 6 13:09:00 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- copied from prelink-0.3.6-2.src.rpm
---- Files affected:
SOURCES:
prelink.cron (NONE -> 1.1) (NEW), prelink.sysconfig (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/prelink.cron
diff -u /dev/null SOURCES/prelink.cron:1.1
--- /dev/null Fri Jan 6 14:09:00 2006
+++ SOURCES/prelink.cron Fri Jan 6 14:08:55 2006
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+. /etc/sysconfig/prelink
+
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+ if [ -f /etc/prelink.cache ]; then
+ echo /usr/sbin/prelink -uav > /var/log/prelink.log
+ /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1 \
+ || echo Prelink failed with return value $? >> /var/log/prelink.log
+ rm -f /etc/prelink.cache
+ # Restart init if needed
+ [ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+ fi
+ exit 0
+fi
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+ # If cache does not exist or is from older prelink versions or
+ # if we were asked to explicitely, force full prelinking
+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+ PRELINK_OPTS="$PRELINK_OPTS -f"
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.{full,quick}
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+ = /var/lib/misc/prelink.full ]; then
+ # If no more than PRELINK_NONRPM_CHECK_INTERVAL days elapsed from last prelink
+ # (be it full or quick) and no packages have been upgraded via rpm since then,
+ # don't do anything.
+ [ "`find /var/lib/misc/prelink.quick -mtime -${PRELINK_NONRPM_CHECK_INTERVAL:-7} 2>/dev/null`" \
+ -a -f /var/lib/rpm/Packages \
+ -a /var/lib/rpm/Packages -ot /var/lib/misc/prelink.quick ] && exit 0
+ date > /var/lib/misc/prelink.quick
+ # If prelink without -q has been run in the last
+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+ PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.{full,quick}
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log
+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1 \
+ || echo Prelink failed with return value $? >> /var/log/prelink.log
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0
================================================================
Index: SOURCES/prelink.sysconfig
diff -u /dev/null SOURCES/prelink.sysconfig:1.1
--- /dev/null Fri Jan 6 14:09:00 2006
+++ SOURCES/prelink.sysconfig Fri Jan 6 14:08:55 2006
@@ -0,0 +1,37 @@
+# Set this to no to disable prelinking altogether
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=yes
+
+# Options to pass to prelink
+# -m Try to conserve virtual memory by allowing overlapping
+# assigned virtual memory slots for libraries which
+# never appear together in one binary
+# -R Randomize virtual memory slot assignments for libraries.
+# This makes it slightly harder for various buffer overflow
+# attacks, since library addresses will be different on each
+# host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode. Comment it out if it should be run
+# in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
+
+# How often should prelink run (in days) even if
+# no packages have been upgraded via rpm.
+# If $PRELINK_FULL_TIME_INTERVAL days have not elapsed
+# yet since last normal mode prelinking, last
+# quick mode prelinking happened less than
+# $PRELINK_NONRPM_CHECK_INTERVAL days ago
+# and no packages have been upgraded by rpm
+# since last quick mode prelinking, prelink
+# will not do anything.
+# Change to
+# PRELINK_NONRPM_CHECK_INTERVAL=0
+# if you want to disable the rpm database timestamp
+# check (especially if you don't use rpm/up2date/yum/apt-rpm
+# exclusively to upgrade system libraries and/or binaries).
+PRELINK_NONRPM_CHECK_INTERVAL=7
================================================================
More information about the pld-cvs-commit
mailing list