timezone in OpenBSD 3.6 (SOLUTION FOUND)

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
rstarr
Posts: 16
Joined: Thu Feb 03, 2005 11:10 am

timezone in OpenBSD 3.6 (SOLUTION FOUND)

Post by rstarr »

I'm almost ready to roll my test server over into production. One last thing I can't figure out is the timezone problem I've read posts on this forum as well as rrdtool's mailing list, nothing seemed to help me. Here's my info:

OpenBSD 3.6
Cacti 0.8.6c
Apache 1.3.29
PHP 4.3.10
RRDtool 1.0.48
MySQL 4.0.20

Everything works fine, its just a matter of my graphs being displayed as GMT. I'm GMT-6:00 (CST6CDT).

The log file from cacti is displayed correctly.
The MySQL database is using CST.
My system doesn't seem to care about the TZ environmental variable. (changing it, date, changing it, date doesn't do anything)

--------------------------------------------------------------------
POST TURNAROUND
SOLUTION FOUND
--------------------------------------------------------------------

As I was giving info about my problem, I fixed it. So I thought I would share my solution with everyone.

*** First of all, this solution has to do with the fact that my Apache is chrooted. This solution probably applies to those of you with this configuration. ***

I made a test file called systemtime.php and put it in my cacti web root. (/var/www/cacti)

It looks like this:

Code: Select all

 <?php
$html="
PHP time:   ".date("D M j H:i:s T Y")."<br>
System time: ".exec('date')."<br>";

echo $html;
?>
I brough it up in my web browser and I got this:

Code: Select all

 PHP time: Wed Feb 16 09:40:20 CST 2005
System time:  
This told me it couldn't find a date binary... obviously, since I'm chrooted.

Code: Select all

 cp /bin/date /var/www/bin 
I brough it up in my web browser again and I got this:

Code: Select all

 PHP time: Wed Feb 16 09:44:47 CST 2005
System time: Wed Feb 16 15:44:47 GMT 2005 
Ok, so date doesn't know about my timezone settings, so it defaults to GMT. In OpenBSD thats related to /etc/localtime. Again, outside my chroot.

Code: Select all

 mkdir /var/www/usr/share 
mkdir /var/www/usr/share/zoneinfo 
cp -R /usr/share/zoneinfo/* /var/www/usr/share/zoneinfo/
cd /var/www/etc
# be sure to use relative paths for the following
# link localtime to your timezone in /var/www/usr/share/zoneinfo
ln -sf ../usr/share/zoneinfo/CST6CDT localtime
Now my systemtime.php file reads:

Code: Select all

 PHP time: Wed Feb 16 09:49:17 CST 2005
System time: Wed Feb 16 09:49:17 CST 2005
Next, I checked on cacti, and everything is displayed using the current time zone.

Code: Select all

 rm /var/www/cacti/systemtime.php 
Hope that helps someone...

Just for the record (and the text in docs/README), I have a perfectly working Cacti running in OpenBSD 3.6 with a chrooted Apache. If you need a complete how to then let me know. Either way, it works, so update your README. :)

Oh, props to the Cacti team, developers, and users... this is a great software package.

-Russ
tubbie
Posts: 5
Joined: Sat Feb 26, 2005 6:48 am

Post by tubbie »

THNX for the tip, I'm also trying to get things running on openbsd 3.6. After logon problems (caused by the chrooted behaviour of apache and permissions on /var/www/tmp) and the date problem, i'm still not able to get some nice graphs. :roll: :(

I use:

rrdtool-1.0.48
net-snmp-5.1.2
Apache/1.3.29
php4-mysql-4.3.8
Cacti 0.8.6c

THNX
vtmgr
Posts: 27
Joined: Wed Aug 11, 2004 2:23 pm
Location: Vermont, USA

cacti on Openbsd

Post by vtmgr »

I would appreciate the directions. It would save a lot of time re-inventing the wheel.

Thanks in advance!
Cacti 0.8.6f
CMD
MySQL 4.0.20
Net-SNMP 5.1.1
IIS 6
PHP 5.0.2
RRDtool 1.2.10
Windows 2003 Server
rstarr
Posts: 16
Joined: Thu Feb 03, 2005 11:10 am

Post by rstarr »

Sorry, you confused me.

For one, I just explained it clearly...

Two, you are using IIS and Windows Server 2003... I'm using apache on OpenBSD.

What is it you need help with exactly?

Thanks,

Russ
vtmgr
Posts: 27
Joined: Wed Aug 11, 2004 2:23 pm
Location: Vermont, USA

Post by vtmgr »

Sorry, should have been more specific. I was interested in the details of implementing Cacti on OpenBSD. Your timezone explanations is quite clear.

And yes my production system is Win2k3. This is more along the lines of an experiment with lighter-weight systems.(like a Kiosk)

Thanks!
Cacti 0.8.6f
CMD
MySQL 4.0.20
Net-SNMP 5.1.1
IIS 6
PHP 5.0.2
RRDtool 1.2.10
Windows 2003 Server
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests