Operating System - HP-UX
1828270 Members
3204 Online
109975 Solutions
New Discussion

TIMEZONE RESET WITHOUT RESTART

 
Amit Dixit_2
Regular Advisor

TIMEZONE RESET WITHOUT RESTART

Hi,
How can I reset the time zone on my HP-UX
server without restarting the server

Thanks,
Amit
13 REPLIES 13
Michael Tully
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

It is possible to change the timezone for the next user when they login, but system wide, I don't think it is possible. The best way it to run the set_parms script, set things properly and then reboot.
Anyone for a Mutiny ?
Bharat Katkar
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

I have assigned points to 68 of 314 responses to my questions.
Look at the thread below:
http://forums1.itrc.hp.com/service/forums/helptips.do?admit=716493758+1085211538437+28353475#33
Regards,
You need to know a lot to actually know how little you know
Bharat Katkar
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

# set_parms timezone
And then you have reboot the server.
Regards,
You need to know a lot to actually know how little you know
Muthukumar_5
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

hai,

Is it good to use the TZ environment value and tztab for this.

I hope we can adjust this TZ variable to get the required zone.

I have tried out as like,
Default : TZ=PST8PDT

Changed as TZ=PST4PDT

But the notification of TIMEZONE is PDT. But the time is synchronized?? is it so. The files time values are changed according to the change.

If I reverse it to default,files (ll) dates are as like default. We can synchronize that environment variable for this.

Regards,
Muthukumar.



Easy to suggest when don't know about the problem!
Amit Dixit_2
Regular Advisor

Re: TIMEZONE RESET WITHOUT RESTART

Hi Muthu,
I dont know what you were explaining
but if you set the value of TZ and
export it it doesnt take system wide
effect but limited to that term session
only.

If you can set the TZ without resseting
the machine please let me know.

Thanks,
Amit
Muthukumar_5
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

Hai,

Yes. The effect is only at that term only.

But, we have another way from this as,

Try to make use only one user currently in the system.

echo "TZ=;export $tz" >> /.profile

It will be updated. If you do the change in the current shell,it will be also updated. After that all users login will use that TZ value. So the time zone will be used.

I have tested. It is working.

Regards,
Muthukumar.



If we add a environment

If you can set the TZ without resseting
the machine please let me know.
Easy to suggest when don't know about the problem!
Amit Dixit_2
Regular Advisor

Re: TIMEZONE RESET WITHOUT RESTART

Hi Muthu,
Did that but a strange problem now I can
run CDE using exceed from a particular
login

Amit
Bill Hassell
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

For simple logins from remote systems, or a login from the console, the TZ value for timezone can be changed at any time. You can even customize TZ for each user in case they are located in a different country. TZ is set in /etc/profile by running the script called /etc/TIMEZONE. This affects not only every login, but also set the TZ value for automatic startup processes when the system boots up. To see how TZ works, try this:

TZ=EST5EDT date
TZ=PST8PST date

These are temporary changes for TZ. date interprets the HP-UX internal time (which is GMT) based on the value for TZ and the table called /usr/bin/tztab.

Since you are using eXceed and CDE, things are a bit more complicated. Xwindows tries to bypass 'normal' Unix logins by not running /etc/profile and $HOME/.profile for a terminal login. So changes made to /etc/TIMEZONE will have no effect on the next login. To fix this particular problem, you must restart CDE so the entire Xwindows subsystem will inherit the new TZ value.

Also, if you are running some sort of database or other program that was started at bootup, there is no way to change TZ for that program as it is in RAM. You'll need to restart the program(s).


Bill Hassell, sysadmin
Muthukumar_5
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

hai,

The /.profile will give the changes to that root only. If we want to control all users,we can put that in /etc/profile.

Do the change of TZ setting and export of that varible in system wide profile (/etc/profile)

I hope it will do time reset without restart.

Regards,
Muthukumar.

Easy to suggest when don't know about the problem!
Bill Hassell
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

As mentioned, putting /etc/TIMEZONE will change the time displayed by date as well as programs that perform system calls to obtain the current time. However, this is a passive file, so programs that are already running will be unaffected. Those programs must be restarted so they will inherit the new TZ value.


Bill Hassell, sysadmin
Victor Fridyev
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

I'd like to add my one penny. IMHO, Bill Hassel described the situation most correctly. I'd like only to mention that the biggest problem is data bases, particularly Oracle. This guy even after restart returns old TZ for client queries.

Reboot the computer, and that's all.

Good luck
Entities are not to be multiplied beyond necessity - RTFM
Amit Dixit_2
Regular Advisor

Re: TIMEZONE RESET WITHOUT RESTART

Hi Bill,
My problem is I am having an application
which pick up time from the weblogic
server.

So I have to shutdown and restart the
weblogic server.

Is there any way I can get rid of this
process.

And when I set a new timezone, It should
get reflected without restart.

Thanks,
Amit
Bill Hassell
Honored Contributor

Re: TIMEZONE RESET WITHOUT RESTART

> My problem is I am having an application which pick up time from the weblogic server.

weblogic was started incorrectly (it has obtained the wrong TZ value and can't be changed as the value is in the program's memory)

> Is there any way I can get rid of this process.

Which process? Weblogic? Sure, just kill it. If your application gets the time from Weblogic, rewrite the application.

> And when I set a new timezone, It should get reflected without restart.

Well it does but only if the applications and logins change their TZ. In other owrds, there is no way to modify the running programs. They must be restarted to inherit the new TZ value.


Bill Hassell, sysadmin