--- functions.old 2012-08-24 16:45:39.000000000 +0400 +++ functions.old 2018-04-03 00:38:49.000000000 +0300 @@ -222,14 +222,38 @@ Copy $verbose $force -m644 "/etc/$f" "etc/$f" done + timedatectl_file="/etc/localtime" + if [ -f "${timedatectl_file}" ] + then + # for new systems with systemd + # alterator must be taught to make /etc/localtime a symlink, see the bug https://bugzilla.altlinux.org/show_bug.cgi?id=32346 + if [ -L "${timedatectl_file}" ] + then + if [ -w ./etc ] + then + test -f ".${timedatectl_file}" || ln -s "${timedatectl_file}" ".${timedatectl_file}" + # set $timedatectl_file as an empty variable to avoid copying it as a file in the next loop + # if /etc/localtime is not a symlink, e.g. it is a system with sysvinit, then this file will simply be copied in the next loop, otherwise it won't be copied in it + timedatectl_file="" + else + if [ ! -d ./etc ] && [ -w ./ ]; then + mkdir ./etc + test -f ".${timedatectl_file}" || ln -s "${timedatectl_file}" ".${timedatectl_file}" + timedatectl_file="" + fi + fi + fi + fi + # optional config files - for f in /etc/localtime /var/nis/NIS_COLD_START; do + for f in "${timedatectl_file}" /var/nis/NIS_COLD_START; do if [ -f "$f" ]; then Copy $verbose $force -m644 "$f" ".$f" else rm $verbose -f ".$f" fi done + # NIS/NIS+ d=`nisdomainname`