vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Jordan Catalano wrote: > Hi > > How can we change the TIMEZONE on the fly, without any System > reboot... > > thanks > Simple answer: "You can't" More complex answer: "You can change TIMEZONE (by which I assme you mean the value specified in /etc/default/init) as much as you like but the init process will only read that file once when it initially starts up (effectively, when the machine is booted). The timezone value read by init is inherited by all processes started by init (and their children, even unto the umpteenth generation) unless they are told otherwise. Since TZ is simply an environment variable threre's nothing to stop you changing it on a per-user basis (put a value for TZ in the user's .profile or .login) or on a per-process basis *for new starts of processes* (ie you can't change the TZ for an already-running process). For example: $ echo $TZ GB $ TZ=Australia/Queensland date Wednesday April 14 21:35:37 EST 2004 $ TZ=US/Eastern date Wednesday April 14 07:35:40 EDT 2004 $ So theoretically you could kill off things (such as cron) for which you wanted to change the timezone (you *would* have to kill them though) and restart each one with an explicitly-specified TZ. Experience tells that This Way Lies Madness, though - don't even think about it. -- Tony |
| ||||
| In comp.unix.solaris Jordan Catalano <cypherpunks@sicap.ch> wrote: > Hi > How can we change the TIMEZONE on the fly, > without any System reboot... The timezone is a per-process environment variable. For each process that you care about, you can either ask it to change it's timezone (if it supports such a concept), or you could restart it with the TZ environment set to what you want. Such things that you might want to restart that way could be... cron syslog inetd sshd applications (apache, oracle, ...) Restarting inetd often has other problems unless you purge the environment of everything you don't need. -- 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. > |
| Thread Tools | |
| Display Modes | |
|
|