1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/sh
set -e
lib_log="${DPKG_ROOT:-}/var/lib/wtmpdb/wtmp.db"
new_log="${DPKG_ROOT:-}/var/log/wtmp.db"
# Effect the conversion from storing the live log in the state directory to
# storing it in its proper place, the logs directory. Also set up the symlink
# where tmpfiles.d is not available.
if [ "$1" = "configure" ]
then
if [ -s "$lib_log" ] && [ ! -h "$lib_log" ] && [ ! -s "$new_log" ]
then
mv -f "$lib_log" "$new_log"
fi
# The unhandled case is records in both locations. For this we need
# a 'wtmpdb merge' operation called in wtmpdb.postinst but no such
# operation yet exists.
if [ ! -f "$lib_log" ]
then
mkdir -p "$(dirname "$lib_log")"
ln -sf ../../log/wtmp.db "$lib_log"
fi
fi
#DEBHELPER#
|