#!/bin/sh set -e lib_log="${DPKG_ROOT:-}/var/lib/wtmpdb/wtmp.db" new_log="${DPKG_ROOT:-}/var/log/wtmp.db" if [ "$1" = "configure" ] then # Effect the conversion from storing the live log in the state directory to # storing it in its proper place, the logs directory. 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 old and new locations. For this we # would need a 'wtmpdb merge' operation called in wtmpdb.postinst but no # such operation yet exists and arguably we should not second guess what # had happened in that scenario. In this case the log in the old location # will be left untouched. # Set up the symlink in case tmpfiles.d is not serviced on this system. if [ ! -f "$lib_log" ] then mkdir -p "$(dirname "$lib_log")" ln -sf ../../log/wtmp.db "$lib_log" fi fi #DEBHELPER#