[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ntpsec as server questions




On 12/5/23 11:37, Max Nikulin wrote:

On 05/12/2023 05:14, Pocket wrote:
For gene..................................................................
[...]
zone=EST5EDT
zoneinfo=/usr/share/zoneinfo
localtime=/etc/localtime
timezone=/etc/timezone
profile=/etc/profile.d
if [ -e "$zoneinfo"/"$zone" ];then
     ln -sf "$zoneinfo"/"$zone" "$localtime"
else
     printf "%s\n" "Invalid zone: $zoneinfo/$zone"
     exit 1
fi
printf "%s\n" "$zone" > "$timezone"
printf "%s\n" "TZ=$zone;export TZ" > "$profile"/timezone.sh

To set /etc/localtime and /etc/timezone I would recommend the command that has been repeated several times in this thread:

     dpkg-reconfigure tzdata


That does not work. Cannot set EST5EDT.  you have to do that manually.

You also can not select any of the POSIX time zones which indecently EST5EDT is one of those


And I would recommend against setting the TZ environment variable unless it is really necessary. If somebody needs it then it is better to do it in /etc/environment.d as well. KDE has its own GUI to set user-specific timezone, but I am unsure if selected value will be applied in the case of console or ssh login.


I don't use KDE, I am using LXDE and systems without desktops.

Comment that part out of the shell script.


I script all my setups, so I can apply them to all the systems I have.

For example:

openssh-server.sh

bind.sh

nginx.sh

nfs-client.sh

nfs-server.sh

The scripts install the debian packages required and then setup the configuration.



I am surprised that POSIX EST5EDT timezone has irregularities at least as it is implemented in GNU libc. I believed that it specifies just standard and summer time.

LANG=C.UTF-8 TZ=EST5EDT date -d 'TZ="Z" 1940-01-01 00:00'
Sun Dec 31 19:00:00 EST 1939

LANG=C.UTF-8 TZ=EST5EDT date -d 'TZ="Z" 1943-01-01 00:00'
Thu Dec 31 20:00:00 EWT 1942

However since these rules are specific to US, I would prefer IANA identifiers like America/New_York.


Which is why I use it.

/usr/share/zoneinfo/posix/EST5EDT is a symlilnk to /usr/share/zoneinfo/EST5EDT



https://naggum.no/lugm-time.html
Erik Naggum. A Long, Painful History of Time. 1999
8.2 Timezone Representation

David Olsen of Digital Equipment Corporation has laid down a tremendous
amount of work in collecting the timezones of the world and their
daylight saving time boundaries. Contrary to the Unix System V approach
from New Jersey (insert appropriate booing for best effect), which
codifies a daylight saving time regime only for the current year, and
apply it to all years, David Olsen's approach is to maintain tables of
all the timezone changes.



--
It's not easy to be me


Reply to: