Re: spamd logging with wrong timestamp?

2004-11-19 Thread Michael Barnes
On Fri, Nov 19, 2004 at 12:48:07PM +1100, Dimitry Peisakhov wrote:
>   Thanks for the advice Michael. I have a question though.
> Services from init.d start up under root, as far as i know. Root
> currently has no TZ set, but all other services log correctly. If i
> set TZ in the spamd init.d script, that would set TZ for root, wouldnt
> it? (TZ is user-specific, i htink). Do you think this will still
> work? Would it impact any other time-related things?  I still find it
> strange that spamd is the only service that is logging and ignoring
> the system time.

Dimitry,

Environment stuff can be very tricky sometimes.  The settting of an
environment variable sets that variable for that process, and it more
than likely will be inherited by any child processes that are spawned by
that process and any of thier subsequent processes.

In my situation, what I had done is that I set my TZ variable in my
shell, and then I would do something like 'sudo /etc/init.d/httpd
restart' and the sudo command the /etc/init.d/httpd script and the httpd
daemons all inherited my variable and the httpd daemon was logging in my
timezone.

This is why many people do things as root or another daemon user like
oracle by doing 'su - USER' or 'su - USER -c COMMAND'.  Where the '-'
denotes that it will read all of the user's environment variables as if
they had logged in.  I personally don't like sudo because I rarely
remember (or want to remember) root passwords, so I use sudo with my
password.  I also prefer my environment the way I set it up with things
like VISUAL, EDITOR, and PAGER and/or MANPAGER to things that I like,
and are often unapropriate for system accounts.

Another confusing thing with environment variables is that it is
impossible to inject an environment variable into an already running
process.  But it makes sense once you think about it.

Mike

-- 
/-\
| Michael Barnes <[EMAIL PROTECTED]> |
| UNIX Systems Administrator  |
| College of William and Mary |
| Phone: (757) 879-3930   |
\-/


RE: spamd logging with wrong timestamp?

2004-11-19 Thread Dimitry Peisakhov
Thanks for the advice Michael. I have a question though.
Services from init.d start up under root, as far as i know. Root currently
has no TZ set, but all other services log correctly. If i set TZ in the
spamd init.d script, that would set TZ for root, wouldnt it? (TZ is
user-specific, i htink). Do you think this will still work? Would it impact
any other time-related things? 
I still find it strange that spamd is the only service that is logging and
ignoring the system time.

Dimitry

-Original Message-
From: Michael Barnes [mailto:[EMAIL PROTECTED]
Sent: Friday, 19 November 2004 2:14 AM
To: users@spamassassin.apache.org
Subject: Re: spamd logging with wrong timestamp?



I've had servers log with incorrect time before and it was due to the
fact that I was in a different timezone than my server and I set my TZ
environment variable to reflect my timezone and not the timezone that
the server was located.  So, when I restarted the server, it inheireted
my TZ variable and started logging with that time and not the system
time.

If you might think that this is an issue, you could put the correct TZ
environment info in your spamd startup/shutdown script and that way it
will always be correct (or at least consistant).

Mike

On Thu, Nov 18, 2004 at 02:46:22PM +1100, Dimitry Peisakhov wrote:
> Mike, adding that switch to syslog didnt seem to work. I found some
> other posts through google which claim that stopping syslogd and spamd
> and starting them again fixes this up, but it hasnt worked for me.
>
> If anyone else has any ideas, they would be greately appreciated.
> 
> Thanks,
> Regards, Dimitry
> 
> -Original Message-
> From: Mike Kercher [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 18 November 2004 12:04 AM
> To: users@spamassassin.apache.org
> Subject: RE: spamd logging with wrong timestamp?
> 
> 
> Dimitry Peisakhov wrote:
> > Hi guys,
> > 
> >I've recently discovered that my spamd is writing to the logs with
> > the incorrect timestamp. It looks like its using GMT to timestamp
> > instead of the actual time on the box (11hr difference). I fixed this
> > previously by restarting the service, but its not doing the trick
> > now.. Anyone have ideas about this? There doesnt seem to be any
> > switches for spamd to control timestamps or timezone config. 
> > 
> > thanks,
> > Regards,
> > 
> > Dimitry Peisakhov
> > Systems Administrator
> > 
> > HENRY WALKER ELTIN
> > 02 8875 4721
> > [EMAIL PROTECTED]
> 
> I had a similar problem a couple of weeks ago with a machine that had an
> older OS on it.  sendmail was logging the correct timestamp but
MailScanner
> was logging about 2 hours behind.  The way I resolved it was to add the
'-r'
> switch to my syslog initscript.
> 
> Mike

-- 
/-\
| Michael Barnes <[EMAIL PROTECTED]> |
| UNIX Systems Administrator  |
| College of William and Mary |
| Phone: (757) 879-3930   |
\-/


Re: spamd logging with wrong timestamp?

2004-11-18 Thread Michael Barnes

I've had servers log with incorrect time before and it was due to the
fact that I was in a different timezone than my server and I set my TZ
environment variable to reflect my timezone and not the timezone that
the server was located.  So, when I restarted the server, it inheireted
my TZ variable and started logging with that time and not the system
time.

If you might think that this is an issue, you could put the correct TZ
environment info in your spamd startup/shutdown script and that way it
will always be correct (or at least consistant).

Mike

On Thu, Nov 18, 2004 at 02:46:22PM +1100, Dimitry Peisakhov wrote:
> Mike, adding that switch to syslog didnt seem to work. I found some
> other posts through google which claim that stopping syslogd and spamd
> and starting them again fixes this up, but it hasnt worked for me.
>
> If anyone else has any ideas, they would be greately appreciated.
> 
> Thanks,
> Regards, Dimitry
> 
> -Original Message-
> From: Mike Kercher [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 18 November 2004 12:04 AM
> To: users@spamassassin.apache.org
> Subject: RE: spamd logging with wrong timestamp?
> 
> 
> Dimitry Peisakhov wrote:
> > Hi guys,
> > 
> >I've recently discovered that my spamd is writing to the logs with
> > the incorrect timestamp. It looks like its using GMT to timestamp
> > instead of the actual time on the box (11hr difference). I fixed this
> > previously by restarting the service, but its not doing the trick
> > now.. Anyone have ideas about this? There doesnt seem to be any
> > switches for spamd to control timestamps or timezone config. 
> > 
> > thanks,
> > Regards,
> > 
> > Dimitry Peisakhov
> > Systems Administrator
> > 
> > HENRY WALKER ELTIN
> > 02 8875 4721
> > [EMAIL PROTECTED]
> 
> I had a similar problem a couple of weeks ago with a machine that had an
> older OS on it.  sendmail was logging the correct timestamp but MailScanner
> was logging about 2 hours behind.  The way I resolved it was to add the '-r'
> switch to my syslog initscript.
> 
> Mike

-- 
/-\
| Michael Barnes <[EMAIL PROTECTED]> |
| UNIX Systems Administrator  |
| College of William and Mary |
| Phone: (757) 879-3930   |
\-/


RE: spamd logging with wrong timestamp?

2004-11-18 Thread Dimitry Peisakhov
Mike, adding that switch to syslog didnt seem to work. I found some other
posts through google which claim that stopping syslogd and spamd and
starting them again fixes this up, but it hasnt worked for me.

If anyone else has any ideas, they would be greately appreciated.

Thanks,
Regards, Dimitry

-Original Message-
From: Mike Kercher [mailto:[EMAIL PROTECTED]
Sent: Thursday, 18 November 2004 12:04 AM
To: users@spamassassin.apache.org
Subject: RE: spamd logging with wrong timestamp?


Dimitry Peisakhov wrote:
> Hi guys,
> 
>I've recently discovered that my spamd is writing to the logs with
> the incorrect timestamp. It looks like its using GMT to timestamp
> instead of the actual time on the box (11hr difference). I fixed this
> previously by restarting the service, but its not doing the trick
> now.. Anyone have ideas about this? There doesnt seem to be any
> switches for spamd to control timestamps or timezone config. 
> 
> thanks,
> Regards,
> 
> Dimitry Peisakhov
> Systems Administrator
> 
> HENRY WALKER ELTIN
> 02 8875 4721
> [EMAIL PROTECTED]

I had a similar problem a couple of weeks ago with a machine that had an
older OS on it.  sendmail was logging the correct timestamp but MailScanner
was logging about 2 hours behind.  The way I resolved it was to add the '-r'
switch to my syslog initscript.

Mike


RE: spamd logging with wrong timestamp?

2004-11-17 Thread Mike Kercher
Dimitry Peisakhov wrote:
> Hi guys,
> 
>I've recently discovered that my spamd is writing to the logs with
> the incorrect timestamp. It looks like its using GMT to timestamp
> instead of the actual time on the box (11hr difference). I fixed this
> previously by restarting the service, but its not doing the trick
> now.. Anyone have ideas about this? There doesnt seem to be any
> switches for spamd to control timestamps or timezone config. 
> 
> thanks,
> Regards,
> 
> Dimitry Peisakhov
> Systems Administrator
> 
> HENRY WALKER ELTIN
> 02 8875 4721
> [EMAIL PROTECTED]

I had a similar problem a couple of weeks ago with a machine that had an
older OS on it.  sendmail was logging the correct timestamp but MailScanner
was logging about 2 hours behind.  The way I resolved it was to add the '-r'
switch to my syslog initscript.

Mike



spamd logging with wrong timestamp?

2004-11-17 Thread Dimitry Peisakhov
Hi guys,

   I've recently discovered that my spamd is writing to the logs with the
incorrect timestamp. It looks like its using GMT to timestamp instead of the
actual time on the box (11hr difference). I fixed this previously by
restarting the service, but its not doing the trick now.. Anyone have ideas
about this? There doesnt seem to be any switches for spamd to control
timestamps or timezone config.

thanks,
Regards,

Dimitry Peisakhov
Systems Administrator

HENRY WALKER ELTIN
02 8875 4721
[EMAIL PROTECTED]