9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] jet-lagged fossil
@ 2004-09-20 19:34 Christian Grothaus
  2004-09-20 19:39 ` jmk
  2004-09-21  8:55 ` [9fans] " Christian Grothaus
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Grothaus @ 2004-09-20 19:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Dear 9fans,

two days ago, I installed Plan 9 on a laptop, choosing fossil
as the file system (I plan to use it without Venti).
After setting up, I made an archival and an "ordinary" snapshot,
set snaptime and verified that automatic snapshots are taken.

Then, as an inhabitant of middle Europe, I wanted to set the
timezone appropriately.
Copying /adm/timezone/CET to /adm/timezone/local doesn't work:
The first line in /adm/timezone/CET is "CET 3600 CEST 7200".
But during daylight saving time, the timezone is not set to
GMT + 7200 but to GMT + 0. I think the problem is the four letter
string "CEST". If it is replaced by, say, "CDT", then the
timezone is being set correctly.
(Actually, to set the timezone, I always use a file "MET", which
also was part of earlier distributions, and which is identical
to CET except that the first line is "MET 3600 MDT 7200".
Why was this file dropped from the distribution?)

The problem is now, that after changing the timezone in that way,
fossil no longer takes snapshots automatically.

If I change the timezone back to US_Eastern, then it works again.
Is there something wrong with my timezone setting? Or is there
a way to "reset" fossil?

Thanks,

Christian


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] jet-lagged fossil
  2004-09-20 19:34 [9fans] jet-lagged fossil Christian Grothaus
@ 2004-09-20 19:39 ` jmk
  2004-09-21  8:55 ` [9fans] " Christian Grothaus
  1 sibling, 0 replies; 3+ messages in thread
From: jmk @ 2004-09-20 19:39 UTC (permalink / raw)
  To: christian.grothaus, 9fans

It has been mentioned before that 4-letter strings don't work for
timezones. If someone has the fix already I'll be happy to take it,
otherwise I'll take a look in a little while.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] Re: jet-lagged fossil
  2004-09-20 19:34 [9fans] jet-lagged fossil Christian Grothaus
  2004-09-20 19:39 ` jmk
@ 2004-09-21  8:55 ` Christian Grothaus
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Grothaus @ 2004-09-21  8:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I should have looked in the archives more thoroughly:
The problem with automatic snapshots has been reported before,
and a possible workaround is setting the timezone to 'GMT 0'.

I found out that it also works in any timezone, when the
real time clock is set to GMT and timesync is run without
the 'L' flag.
(Then, of course, Windows doesn't get the time correctly, but
never mind. I prefer this solution at the moment.)

But I really don't understand at the moment, why it doesn't
work. Here is the beginning of the snapEvent() function
in /sys/src/cmd/fossil/fs.c:

-----------------------------------------------------------
static void
snapEvent(void *v)
{
	Snap *s;
	u32int now, min;
	Tm tm;
	int need;

	s = v;

	now = time(0)/60;
	vtLock(s->lk);

	/*
	 * Snapshots happen every snapMinutes minutes.
	 * If we miss a snapshot (for example, because we
	 * were down), we wait for the next one.
	 */
	if(s->snapMinutes != ~0 && s->snapMinutes != 0
	&& now%s->snapMinutes==0 && now != s->lastSnap){
		if(!fsSnapshot(s->fs, nil, nil, 0))
			fprint(2, "fsSnapshot snap: %R\n");
		s->lastSnap = now;
	}
        .
        .
        .
-----------------------------------------------------------

So the setting of the timezone should have no influence on
periodic non-archival snapshots, since the time is computed
with time()?!

Christian


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-21  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-20 19:34 [9fans] jet-lagged fossil Christian Grothaus
2004-09-20 19:39 ` jmk
2004-09-21  8:55 ` [9fans] " Christian Grothaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).