Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dsys/funcINSTALL

    r1 r3  
    9191        DATABASE="${basedir}/${defdatabase}"
    9292    fi
     93
     94    updlock="${DATABASE}.lockdir"
     95    trap "rm -rf ${updlock}" 1 2 13 15
     96
     97    #
     98    # A lockfile will not work, because 'root' can write anyway.
     99    # However, 'mkdir' an existing directory will fail even for root
     100    #
     101    until (umask 222; mkdir "${updlock}") 2>/dev/null   # test & set
     102    do
     103       printINFO "Waiting for lock"
     104       sleep 1
     105    done
     106
    93107
    94108    IDATE=`date +"%Y-%m-%d %H:%M:%S"`
     
    223237    fi
    224238
    225     chown ${rcfile_owner}:${rcfile_group} "${DATABASE}" || printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${DATABASE}"
    226     chmod ${rcfile_perm} "${DATABASE}" || printFATAL "Could not chmod ${rcfile_perm} ${DATABASE}"
    227 
     239    chown ${rcfile_owner}:${rcfile_group} "${DATABASE}"
     240    if [ $? -ne 0 ]; then
     241        rm -rf "${instlock}"
     242        printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${DATABASE}"
     243    fi
     244    chmod ${rcfile_perm} "${DATABASE}"
     245    if [ $? -ne 0 ]; then
     246        rm -rf "${instlock}"
     247        printFATAL "Could not chmod ${rcfile_perm} ${DATABASE}"
     248    fi
     249
     250    rm -rf "${updlock}"
    228251}
    229252
Note: See TracChangeset for help on using the changeset viewer.