From e7b88b1b1a9a89f3e7cc36ea321e789d0365e4d8 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 1 Dec 2009 10:34:11 -0800 Subject: Avoid updating files on boot If file is already correct, no need to write it. --- scripts/rl-system.init | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/rl-system.init b/scripts/rl-system.init index 0eaf6a65..b2012211 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -87,7 +87,7 @@ add_new_serial_if () { ## Update the version information update_version_info () { if [ -f ${vyatta_sysconfdir}/version.master ]; then - cp ${vyatta_sysconfdir}/version.master ${vyatta_sysconfdir}/version + cp -u ${vyatta_sysconfdir}/version.master ${vyatta_sysconfdir}/version fi } @@ -96,7 +96,7 @@ clear_or_override_config_files () for conf in snmp/snmpd.conf snmp/snmptrapd.conf keepalived/keepalived.conf \ ipvsadm.rules default/ipvsadm resolv.conf do - if [ -f /etc/$conf ] ; then + if [ -s /etc/$conf ] ; then empty /etc/$conf fi done @@ -172,7 +172,10 @@ setup_ntp_config_file () { # restore PAM back to virgin state (no radius other services) pam_reset () { - DEBIAN_FRONTEND=noninteractive pam-auth-update --force --remove radius + if grep -q radius /etc/pam.d/common-auth + then DEBIAN_FRONTEND=noninteractive \ + pam-auth-update --force --remove radius + fi } start () { -- cgit v1.2.3