Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Formatting was changed.

...

Code Block
languagetext
[global]
strict locking = no

If this remedy does not help, it is possible to switch Архива to use more rudimentary file format. In Configuration->Archive, set volume format to V1.


Auto Mount Script
 

To ensure that remote mount points are remounted, insert this script in a cron job:

 

Code Block
languagebash
----------------------------------------------------------------------
created check_mount script    [ /usr/local/sbin/check_mounts.sh ]
----------------------------------------------------------------------
#!/bin/sh
# --------------------------------------------------------------------
# purpose: check mounted partitions,
#  log if not mounted + mount and notify admins
# args:  none
# deps:  bash, GNU utils, logger, /proc, /etc/fstab
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# configuration
# --------------------------------------------------------------------
FSTAB_EXCL="(^#|noauto|none|user)"
PROGNAME=$(basename $0)
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# configure destination address for emails (admins)
# --------------------------------------------------------------------
if [ -f /etc/default/suk_scripts ]; then
. /etc/default/suk_scripts;
else
ROOTMAIL="root@`hostname --fqdn`"
fi
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# functions
# --------------------------------------------------------------------
function err_descr() {
case "$?" in
  0) err_rv="OK"
   ;;
  1) err_rv="FAILED"
   ;;
  *) err_rv="$?"
   ;;
esac;
}
function log() {
/usr/bin/logger -i -p kern.warn -t ${PROGNAME} "$@";
}
function log_mail() {
mail -s "$@" ${ROOTMAIL} ; log "$@";
}
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# check mounts
# --------------------------------------------------------------------
if [ ! -f /proc/mounts ]; then
log "WARN: /proc wasn't mounted!"
mount -t proc proc /proc; err_descr
err_descr
log_mail "WARN: mounted /proc (${err_rv})"
fi
egrep /etc/fstab -ve "${FSTAB_EXCL}" | while read i; do i=( ${i} )
# empty ?
case ${#i[0]} in
  0) log_mail "FATAL: I shouldn't have read ${i[@]} !"
     eval ${i[0]:=ERROR} 2>/dev/null
     ;;
esac
# select device
case ${i[0]} in
  /dev*)
   dev=( ${i[0]} ${i[1]} )
   ;;
  *)
   dev=( UNKNOWN UNKNOWN )
   ;;
esac
# munge rootfs
case "${#dev[1]}" in
  1) case "${dev[1]}" in
   /) dev[0]=/dev/root
   ;;
     esac
     ;;
esac
# check mounts
grep /proc/mounts -e ${dev[0]} &> /dev/null
case "$?" in
  1) case ${dev[0]} in
   /dev/root)
    /bin/true
    ;;
   UNKNOWN)
    ;;
   *)
    log "WARN: ${dev[1]} isn't mounted"
    mount ${dev[1]}; err_descr
    log_mail "INFO: mounted ${dev[1]}"
    ;;
     esac
     ;;
esac
done
# --------------------------------------------------------------------
exit $?
----------------------------------------------------------------------
----------------------------------------------------------------------
added check_mounts to cron    [ /etc/cron.d/check_mounts ]
----------------------------------------------------------------------
*/15 * * * * root /usr/local/sbin/check_mounts.sh
----------------------------------------------------------------------