From owner-freebsd-questions@FreeBSD.ORG Sun Oct 5 19:41:55 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 603BE16A4B3 for ; Sun, 5 Oct 2003 19:41:55 -0700 (PDT) Received: from stan.kibserv.org (te-64-146-110-100.transedge.com [64.146.110.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE6A943F75 for ; Sun, 5 Oct 2003 19:41:53 -0700 (PDT) (envelope-from freebsd@kibserv.org) Received: (qmail 7230 invoked by uid 89); 6 Oct 2003 02:41:52 -0000 Received: from unknown (HELO ?64.146.110.102?) (freebsd@kibserv.org@64.146.110.102) by stan.kibserv.org with SMTP; 6 Oct 2003 02:41:52 -0000 From: Mailing Lists Catcher To: Chuck Swiger In-Reply-To: <3F805CA8.7010408@mac.com> References: <1065316286.850.30.camel@butters> <3F805CA8.7010408@mac.com> Content-Type: text/plain Organization: MGM Communications LLC & kibserv Message-Id: <1065408107.22042.9.camel@butters> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 05 Oct 2003 22:41:48 -0400 Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: seperating user timezones from system timezones X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd@kibserv.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2003 02:41:55 -0000 On Sun, 2003-10-05 at 14:02, Chuck Swiger wrote: > Mailing Lists Catcher wrote: > > How to I allow users access to their own timezone without affecting the > > system processes? > > > > All of my systems regardless of location have always been set to UTC so > > logs and cron are in sync across timezones. > > Hmm. Unix has understood the notion of 'local time' versus UTC and most > programs do the right thing even if you set the timezone for the entire > system-- things like ntpd will syncronize via UTC even if TZ was set in their > environment. > > If you want to run syslogd and cron in UTC, I believe you could do so by > setting something like this in /etc/rc.conf: > > cron_program='/usr/bin/env TZ=UTC /usr/sbin/cron' > syslogd_program='/usr/bin/env TZ=UTC /usr/sbin/syslogd' > This I will try. > > Recently I have had need to allow users to set their own timezone in the > > .cshrc using: > > sentenv TZ America/Detroit > > or > > sentenv TZ America/Denver > > or whatever applies. > > Of course, you meant 'setenv' and not 'sentenv'. > yes...typo on my part. I did use setenv in the file....anything else wouldnt have any affect. > > But what I am finding out is that as long as the user is logged in it > > sets the environment for the entire system affecting log timestamps as > > well as cron events. > > Unless you set TZ in /etc/profile, it should not have a universal effect. Are > you sure you didn't kill and restart syslogd as root with TZ configured to a > non-UTC timezone? Apparently it only affects my log files. A bit of testing proved that it does not seem to affect cron or syslog. Root user has no TZ set as root doesn't use X or any calendar or time based applications. But it is clear that log entries are timestamped by the user who is logged in at the time. But from what I can see only logs created by actions of that user get the users local timezone in the log file. So I guess my only problem is a few strangly timestamped entries in my log file. My system doesnt generate much in the way of logs on its own so its uncertain if a user logged in really affects a log entry not generated by a user action. If not then I guess I can live with a few log anomalies. But Bad SU to Root messages would be nice to have in UTC and not the user's TZ that tried the SU. I would hate to have to lookup the TZ of the user each time I needed to know want a bad SU happened. > > Maybe try setting TZ only if the shell is interactive, by adding the setenv > after the line "if ($?prompt) then"...? I will also give this a try Thanks Jason Cribbins