This is a discussion on changing the timezone on a live system within the comp.unix.solaris forums, part of the Solaris Operating System category; --> Anyone know how to change the timezone settings on a live system w/o rebooting? Anything I could possibly force ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Anyone know how to change the timezone settings on a live system w/o rebooting? Anything I could possibly force through mdb etc.. Thanks. -- Rodrick R. Brown Senior IT Consultant http://www.rodrickbrown.com rodrick.brown[<@>]gmail.com When in 1986 Apple bought a Cray X-MP and announced that they would use it to design the next Apple Macintosh, Seymour Cray replied, "This is very interesting because I am using an Apple Macintosh to design the Cray-2 supercomputer." |
| |||
| Rodrick Brown wrote: > Anyone know how to change the timezone settings on a live system w/o > rebooting? > Anything I could possibly force through mdb etc.. > > Thanks. > Even if it's possible, I suspect it would be much easier to reboot. The timezone is set in the TZ environment variable for each process. As far as I know, there is no way to reset those environment variables without stopping and restarting every process. You may be able to solve your problem by stopping and restarting a few processes where the timezone really matters. |
| |||
| In article <mAs%f.28015$cY3.2863@news-wrt-01.rdc-nyc.rr.com>, "Rodrick Brown" <rodrick.brown@gmail.com> wrote: > Anyone know how to change the timezone settings on a live system w/o > rebooting? > Anything I could possibly force through mdb etc.. > > Thanks. Very dangerous - consider init, which is started at boot, and everything it starts. How do you convince it that the TZ has changed without stopping and restarting it? Reboot is your only option. Not doing so will cause grief with daemons, etc. -- Ken Real address krgray*at*verizon*dot*net |
| |||
| Ken Gray <see-sig-for-address@nowhere.invalid> wrote: > In article <mAs%f.28015$cY3.2863@news-wrt-01.rdc-nyc.rr.com>, > "Rodrick Brown" <rodrick.brown@gmail.com> wrote: >> Anyone know how to change the timezone settings on a live system w/o >> rebooting? >> Anything I could possibly force through mdb etc.. > Very dangerous - consider init, which is started at boot, and everything > it starts. How do you convince it that the TZ has changed without > stopping and restarting it? Reboot is your only option. Not doing so > will cause grief with daemons, etc. True, but init may not be that big a deal. By restarting and setting cron, inetd, ssh, and any running apps (oracle, apache, etc.) I'd have 99% of the stuff done. I don't expect much other than the console login session to get started by init under pre-solaris 10. -- Darren Dunham ddunham@taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. > |
| |||
| "Richard B. Gilbert" <rgilbert88@comcast.net> writes: >The timezone is set in the TZ environment variable for each process. As >far as I know, there is no way to reset those environment variables >without stopping and restarting every process. One possible trick is to set $TZ to "localtime" and use "zic -l". >You may be able to solve your problem by stopping and restarting a few >processes where the timezone really matters. That is the only possible solution. Casper |
| |||
| Darren Dunham <ddunham@redwood.taos.com> writes: >True, but init may not be that big a deal. By restarting and setting >cron, inetd, ssh, and any running apps (oracle, apache, etc.) I'd have >99% of the stuff done. I don't expect much other than the console login >session to get started by init under pre-solaris 10. Don't forget syslogd. Perhaps we need to reload "TZ" in the standard SMF scripts. But the "TZ=localtime" trick works for an ordinary restart where TZ is unchanged. (TZ is not reloaded even if the TZ file changes) Casper |
| ||||
| On Thu, 13 Apr 2006 13:43:46 GMT, Rodrick Brown wrote: > Anyone know how to change the timezone settings on a live system w/o > rebooting? > Anything I could possibly force through mdb etc.. [...] You may try and change the timezone of a live process this way: example of a live process: $ perl -MPOSIX -le 'while(1) {print strftime("%c",localtime); sleep 1}' Fri Apr 14 13:22:11 2006 Fri Apr 14 13:22:12 2006 Fri Apr 14 13:22:13 2006 Fri Apr 14 13:22:14 2006 ~$ pgrep -x perl 2350 ~$ gdb /usr/local/bin/perl (gdb) attach 2350 (gdb) call putenv("TZ=GMT+10") $1 = 0 (gdb) detach Detaching from program: /usr/local/bin/perl LWP 1 (gdb) quit ~$ kill -ALRM 2350 Fri Apr 14 02:22:40 2006 Fri Apr 14 02:22:41 2006 Fri Apr 14 02:22:42 2006 Fri Apr 14 02:22:43 2006 Fri Apr 14 02:22:44 2006 Fri Apr 14 02:22:45 2006 I had to send a SIGALRM to the process or the sleep(1) would never return, you won't need that with every process, it worked seemlessly with xclock. This is not guaranteed to work with every process. And that stops the process for some time. You can make that time short if you use of a gdb script. -- Stephane |
| Thread Tools | |
| Display Modes | |
|
|