Operating System - HP-UX
1753404 Members
7010 Online
108793 Solutions
New Discussion юеВ

HPUX: Changing timezone manually or automatically

 
SOLVED
Go to solution
Leonard C.
Frequent Advisor

HPUX: Changing timezone manually or automatically

Dear all,
What are the deferences between the following options?

1) Changing Timezone with "set_parms timezone" (reboot is required)

2) Changing timezone parameters in /etc/TIMEZONE and /etc/defaults/tz (without rebooting machine)

Does HP-UX recommend to reboot server after changing timezone?

What are the risks of changing timezone without reboot?

Is there any experience to change timezone manually and keeping system alive on Oracle RAC ?

7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: HPUX: Changing timezone manually or automatically

>2) Changing timezone parameters in /etc/TIMEZONE and /etc/defaults/tz (without rebooting machine)

If you don't reboot, nothing changes in regards to existing processes.

>Does HP-UX recommend to reboot server after changing timezone?

Changing timezones for who? Individual users don't need to reboot. System processes may need to reboot.

>What are the risks of changing timezone without reboot?

Nothing changes until that reboot, unless processes are restarted.
Leonard C.
Frequent Advisor

Re: HPUX: Changing timezone manually or automatically

Hi,
Is it a normal process to reboot operational servers twice a year (DST changing) to change timezone?
Matti_Kurkela
Honored Contributor

Re: HPUX: Changing timezone manually or automatically

Only if your country does not have a standard timezone rule in place. For example, the rule for European Union is to switch to DST at 01:00 UTC on the last Sunday of March, and back to Standard at 01:00 UTC on the last Sunday of October.

If such a rule is in place and can be expressed with the DST rule system of your OS (and most Unixes are pretty flexible in this regard!), then you can set this once when installing the OS. The system will then follow the rule automatically, with no need to reboot the system.

The DST rule can include historical information too: a good DST rule set for your country includes rules for known past DST transitions too. This allows your Unix system to calculate things like "the number of seconds elapsed since 21.6.1980, 14:00 local time" correctly, even if the authorities have changed the DST rules between then and now. Such calculations might be needed for e.g. astronomical purposes.

A reboot is necessary only when the rule is changed. Even then, it is not necessary to reboot _at_ the DST transition time: you can just update the DST rule file at any time, and as long as you reboot the system at any time between the rule file change and the new DST transition time, you can be sure that all the processes will be using the updated rules.

Some countries don't have a fixed rule for DST transition. Instead, the authorities of that country will decide the DST transition dates & times separately for each year.

Fortunately, this decision is usually made several months before it actually takes effect, so I understand the sysadmins in these countries simply wait for the decision to be made public, add the dates to their DST rule files, and then schedule a reboot at the next convenient maintenance break time _before_ the actual DST transition rolls around.

In HP-UX, the DST rule file is /usr/lib/tztab. It's a text file and it includes plenty of comments in it. It even has its own man page (man tztab), describing the file format.

HP provides tztab patches for the supported HP-UX versions, but you can also update the tztab file manually if necessary. The tztab patches will not automatically overwrite a modified tztab file, so if you modify your tztab and then later wish to resume using the HP-provided version, you should read the special instructions in the tztab patch notes.

The latest tztab patch for HP-UX 11.11 is currently PHCO_39172. PHCO_39173 is the equivalent patch for 11.23, and PHCO_39174 for 11.31. The tztab patch never requires a reboot for installing the patch, but if your country's DST rules have changed, you should check your timezone settings and restart all your time-sensitive processes (applications, databases, cron daemon, sendmail etc. etc.) or reboot the system at some convenient time.

MK
MK
Leonard C.
Frequent Advisor

Re: HPUX: Changing timezone manually or automatically

Hi Matti,
Suppose that HP-UX does not support out DST changes.
So we have 2 options. Changing timezone or upgrade tztab for automatic changes.
So, as you mentioned , in both case we need restart. correct?
Matti_Kurkela
Honored Contributor
Solution

Re: HPUX: Changing timezone manually or automatically

A reboot is not strictly *necessary* for changing the timezone/DST settings. It's just the overwhelmingly easiest and surest way to make all time-sensitive processes use the new settings.

If you choose not to reboot, you must restart each time-sensitive process individually, using a session that already uses the new settings (i.e. change the settings, logout & login, confirm that the new settings are in use, then proceed with restarting the necessary processes).

You'll have to restart things like syslogd (to avoid incorrect timestamps in your system logs) and crond (to avoid scheduled tasks running at wrong times). You will need to really understand your system to know what things need restarting in *your* environment.

Changing the timezone of an Oracle database is yet another can of worms. A database has its own internal timezone settings, and may or may not follow the system time zone:

http://www.dbasupport.com/oracle/ora9i/TimeZone.shtml

Changing the timezone to implement DST is not the optimal solution because it means you will eventually need to change it *again* when it's time to return to Standard time. Also, you must do it roughly *at the time the DST change happens* (usually, within the correct weekend).

If you can set up a DST rule to handle the actual transitions automatically, you'll only need to do it once, and the system will handle the actual transitions automatically after that. Also, when you change the rule file, you can schedule the reboot/applications restart any way *you* like, at any time between "now" and the time the next DST transition is supposed to happen.

To summarize: a reboot or a major application+daemon restart sequence is in order, no matter how you choose. What you can choose is, whether you want to a) do it once at the time of your choosing, and then let the system handle all subsequent DST/Standard time transitions automatically (unless & until the rules are changed again), or b) keep doing it again and again twice a year, at government-mandated days.

MK
MK
Dennis Handly
Acclaimed Contributor

Re: HPUX: Changing timezone manually or automatically

>Is it a normal process to reboot operational servers twice a year (DST changing) to change timezone?

No. A proper timezone includes automatic adjustment for DST changes.

>Changing timezone or upgrade tztab for automatic changes.

Why would you want to do the former? As MK says, if you know the future rules for automatic changes, I would suggest that. And if you meet the criteria, I would suggest you ask HP to create your TZ rule. Australia is big enough to be supported and have patches.

If you change tztab(4) manually, there is Clay's dst.pl script to check it.
mvpel
Trusted Contributor

Re: HPUX: Changing timezone manually or automatically

Remember, the time zone is just a DISPLAY filter. The actual time on the server should always be the UTC seconds since January 1, 1970.

If you go changing the actual date on the system for daylight savings time, you're going run the risk of fouling things up when something that occurred after another thing has an earlier timestamp in the system.

HP has patches for all of the various Australian time zone and DST changes from Tasmania to West Australia. PHCO_37722 from February 2008 is the latest one for Australian DST changes.

http://www11.itrc.hp.com/service/patch/patchDetail.do?patchid=PHCO_37722

See /usr/lib/tztab for details.