- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: TimeZone
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 04:49 PM
07-10-2003 04:49 PM
TimeZone
Need some advice on timezone.I always no good at the time.
I have a server which use timezone JST-9.
when I login to my server using my id and issue date , I have as below :
jpamin:/home/malayboy >date
Fri Jul 11 09:31:08 JST 2003
jpamin:/home/malayboy >env|grep TZ
TZ=JST-9
But when I logon to root here what I got :
# date
Thu Jul 10 20:33:11 EDT 2003
# env|grep TZ
#
(which TZ are not set).
# export TZ=JST-9
# env|grep TZ
#
(which are still nothing)...
SENARIOS:
I create a ftp job between two servers running at 2:00am from jpamin to jphafiz using root account.
jphafiz timezone TZ=JSP-9.
Problem : now the job are "hanky panky"..goes crazy..
any document or help or some heavenly light are appreciate...
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 04:53 PM
07-10-2003 04:53 PM
Re: TimeZone
# more /etc/TIMEZONE
TZ=JST-9
export TZ
TIMEZONE: END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 05:22 PM
07-10-2003 05:22 PM
Re: TimeZone
so when you login and the /etc/TIMEZONE file exists it executes that and sets what ever is in that file, but for some reasons it seems by loging as other users it is working but not with root.
And i know the problem lies in exporting the variables by root. Can you try to export something else say..
#export HELLO=23
and display
#echo $HELLO
i think there is the problem as root even this wouldn't be working...can you pls check and also check the permissons of /etc, /etc/profile and /etc/TIMEZONE file.
Thanks
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 05:32 PM
07-10-2003 05:32 PM
Re: TimeZone
That's an interesting problem!!
I assume from what you said the main issue is the problem setting the correct timezone for root??
I'd look through the /etc/profile, root's .profile and your own .profile to see if there's any references to TZ.
As you're probably aware TZ is set at login by /etc/profile sourcing the TZ variable in /etc/TIMEZONE. This can then be overridden by users setting their own TZ variable in their .profile.
Cheers
Con
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 05:45 PM
07-10-2003 05:45 PM
Re: TimeZone
I manually put below :
export TZ=JST-9
in the jpadmin root .profile but still date command give me EDT as the time zone.
# date
Thu Jul 10 21:32:56 EDT 2003
Here are the permission on the file :
# ll profile
-r--r--r-- 1 root bin 2689 Aug 9 2001 profile
# pwd
/etc
# ll TIMEZONE
-r--r--r-- 1 bin bin 19 Apr 9 2001 TIMEZONE
# ll|grep etc
dr-xr-xr-x 28 root bin 6144 Jul 8 04:12 etc
any document which I could look.
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 05:53 PM
07-10-2003 05:53 PM
Re: TimeZone
#export HELLO=23
and display
#echo $HELLO
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 05:58 PM
07-10-2003 05:58 PM
Re: TimeZone
Really appreciate your response.But here are the testing .
# export OK=mB
# echo $OK
mB
#
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 05:59 PM
07-10-2003 05:59 PM
Re: TimeZone
You could also look at /usr/lib/tztab file.
Is JST defined in here?
Can you set the TZ for root using another timezone defined in tztab??
Cheers
Con
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 06:24 PM
07-10-2003 06:24 PM
Re: TimeZone
# export TZ=JST-9
# echo $TZ
should work...i wonder why its playing..
Or one more option you might give a try is set the time zone again again using
/sbin/set_parms timezone
and reboot the machine and see how is goes..
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 06:50 PM
07-10-2003 06:50 PM
Re: TimeZone
Yap below work:
#export TZ=JST-9
# echo $TZ
JSP-9
but env|grep TZ
nothing showed...
my brain are melting now ...
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 06:53 PM
07-10-2003 06:53 PM
Re: TimeZone
The question is whether /etc/profile and then .profile are actually run during login. Start with some echo statements in /etc/profile and .profile to see if root actually does a login.
As far as the ftp job at 2am, I suspect that this is a cron job...VERY IMPORTANT: cron never performs a login so the environment for a cron job is very small. From the man page for crontab
"cron supplies a default environment for every shell, defining:
HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh
Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry."
In other words, TZ must be set (along with any other parameters you need) inside your script or program.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 07:11 PM
07-10-2003 07:11 PM
Re: TimeZone
You should NOT allow ftp on either box to the root user.
Its a major security hazard, especially if there is a remote or public connection between the machines.
Most scripted ftp scenarios have the root password hard coded in the script. Also very bad.
Install secure shell on both machines and follow Chris Vail's guide to exchanging public keys. Then you can use the scp command to transfer files.
Secure shell
http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA
This of course does not earn points or solve your problem. As to that, here are some interesting docs.
http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/939/KCParms/KCparam.TimeZone.html&searchterms=Timezone%7cTZ&queryid=20030710-210606
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/TKP-90202/TKP-90202_top.html&con=/hpux/onlinedocs/TKP-90202/00/01/166-con.html&toc=/hpux/onlinedocs/TKP-90202/00/01/166-toc.html&searchterms=Timezone%7cTZ&queryid=20030710-210606
Still, what about clock drift. That can still drive you up a proverbial wall. Well, Dr. David Mills invented a solution. ntp
Here is some HP doc on that plus links to Dr. Mills' work.
Configuration
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90685/B2355-90685_top.html&con=/hpux/onlinedocs/B2355-90685/00/00/63-con.html&toc=/hpux/onlinedocs/B2355-90685/00/00/63-toc.html&searchterms=configuration%7cntp&queryid=20030710-210811
Advanced topics
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90685/B2355-90685_top.html&con=/hpux/onlinedocs/B2355-90685/00/00/65-con.html&toc=/hpux/onlinedocs/B2355-90685/00/00/65-toc.html&searchterms=configuration%7cntp&queryid=20030710-210811
Troubleshooting
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90685/B2355-90685_top.html&con=/hpux/onlinedocs/B2355-90685/00/00/65-con.html&toc=/hpux/onlinedocs/B2355-90685/00/00/65-toc.html&searchterms=configuration%7cntp&queryid=20030710-210811
Dr. Mills stuff
http://www.ntp.org/documentation.html
Time Servers
http://www.tymserve.com/success_tva.html
Here is a think outside the box answer. Set both servers to Greenwich Mean Time, do ntp and
pick close time servers.
Now this post is a mouthful isn't it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 07:23 PM
07-10-2003 07:23 PM
Re: TimeZone
Thanks for the response.Appreciate everybody response although every are busy I'm sure.
To answer to your question :
Q) Are you using Xwindows (as in CDE)?
A) No , I'm running Reflection and telnet to the box.No CDE
Q) Are you using /sbin/sh for root?
No.
A) # echo $SHELL
Q) How do you login as an ordinary user versus root? Is it through a telnet connection or rlogin or remsh or ssh? Or do you login by borrowing a terminal emulator from the server (such as dtterm, xterm or hpterm)?
A) All the same using telnet via reflection.
There are new finding :
if I logon as root, from su:
if I do :
# export TZ=JSP-9
# date
Thu Jul 10 22:59:17 EDT 2003
# echo $SHELL
/usr/bin/ksh
I still got that.
But if I changed the
to sh.
The above are correct.
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2003 07:43 PM
07-10-2003 07:43 PM
Re: TimeZone
From your description, it's a problem caused by your shell. Please check what shell your are use:
#ps|grep $$|awk '{print $4}'
sh
#badcommand
/sbin/sh: badcommand : not found
For root, the default shell must be /sbin/sh, that's exist in /etc/passwd, last field!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2003 03:23 AM
07-11-2003 03:23 AM
Re: TimeZone
To find out your current shell, just type:
echo $0
The fact that echo $SHELL does not produce anything indicates an abnormal login procedure. To see the shell that a current user is supposed to use:
grep ^$(whoami): /etc/passwd | cut -f7 -d:
Using su without the - is a bad security risk since su'ing to root can allow a hacker to compromise root's environment.
Bill Hassell, sysadmin