Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
mlocate.7626
mlocate.cron
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mlocate.cron of Package mlocate.7626
#! /bin/sh set -e # ensure we have proper umask bnc#941296 umask 0022 # check if we are already running (lockfile) LOCKFILE="/run/lock/mlocate.daily.lock" if [ -e "${LOCKFILE}" ]; then echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb." exit 1 fi touch "${LOCKFILE}" # trap the lockfile only if we really run the updatedb trap "rm -f ${LOCKFILE}" EXIT # source the user specified variables if [ -f /etc/sysconfig/locate ] ; then . /etc/sysconfig/locate # Compat code for including variables from findutils-locate # where the values were store in /etc/sysconfig/locate if [ -n "${UPDATEDB_PRUNEFS}" ] ; then UPDATEDB_PRUNEFS="--add-prunefs=\"${UPDATEDB_PRUNEFS}\"" fi if [ -n "${UPDATEDB_PRUNEPATHS}" ] ; then UPDATEDB_PRUNEPATHS="--add-prunepaths=\"${UPDATEDB_PRUNEPATHS}\"" fi fi # check if user said he want the db generated if [ -z "${RUN_UPDATEDB}" ] || [ "${RUN_UPDATEDB}" != "yes" ] ; then exit 0 fi # check the config file NODEVS="" if [ ! -f /etc/updatedb.conf ]; then NODEVS="-f $(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }')" fi # alter the priority of the updatedb process if [ -x /usr/bin/renice ]; then /usr/bin/renice +${NICE:-19} -p $$ > /dev/null 2>&1 fi if [ -x /usr/bin/ionice ] && /usr/bin/ionice -c3 true 2>/dev/null; then /usr/bin/ionice -c${IONICE_CLASS:-2} -n${IONICE_PRIORITY:-7} -p $$ > /dev/null 2>&1 fi # run the updatedb if possible if [ -x /usr/bin/updatedb ]; then if [ -z "${RUN_UPDATEDB_AS}" ] ; then RUN_UPDATEDB_AS=root fi # change the perms to the var directory to our desired user chown -R "${RUN_UPDATEDB_AS}":root /var/lib/mlocate # change the user and run the updatedb under it /usr/bin/su "${RUN_UPDATEDB_AS}" -c "umask 0022; /usr/bin/updatedb ${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS}" else echo >&2 "Warning: \"/usr/bin/updatedb\" is not executable, unable to run updatedb." exit 1 fi
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor