ftp.nice.ch/pub/next/tools/hack/TimeShift.README

This is the README for TimeShift.I.bs.tar.gz [Download] [Browse] [Up]

A number of people have complained on the net about how much of a
pain it is to keep resetting the date and time when alternately
booting between NS and toy operating systems.

My preferred advice (only partly facetious) is:
	"Then stop booting the toy OS."

I realize that this is not a workable solution for some people.
So I'm providing this software to ease the pain of those who 
chronically suffer from Windows.

This software works by intercepting calls to reboot and halt.  When
/usr/etc/reboot or /usr/etc/halt are executed, a copy of timeshift
is run instead.  The fake reboot and halt code first determines
how many seconds separate the local timezone from GMT, then the
system clock is adjusted by adding that many seconds to the clock.
Upon making this time adjustment, the file (/usr/etc/shifted.time)
is created so that this change can be undone the next time that NS 
is booted.  After setting the time and creating the stamp file, the 
real copy of reboot or halt is called to bring down the system as 
requested.

Upon bootup (in either /etc/rc.local or /etc/rc) the script
'/etc/rc.timeshift' is run.  This script checks for '/usr/etc/shifted.time'
and if present, runs '/usr/etc/timeshift' to reverse the process.
timeshift reads the stamp file, and adjusts the system clock by
subtracting the stored time difference from the clock.  It then
removes the stamp file.

Because /usr/etc/reboot, and /usr/etc/halt are such critical OS
components, care has been taken to prevent timeshift from modifying
anything if the real halt or reboot will not be syncing the filesystem
on the way down.  When reboot -q, reboot -n, or halt -n are called
the real versions are executed directly without modifying the clock.
If this were not done, then rebooting the system from single user
mode after fixing corrupt file systems would not be possible.

An installer package in binary form is provided.  During installation
it will offer to add a login hook to /etc/rc.  If you select 
'Do Nothing' in the attentioan panel, then no change will be made,
and you will have to manually add an hook to call /etc/rc.timeshift
to either rc or rc.local.  Though timeshift will work from either
location, the call from rc is recommeded.  When placed in the rc
file the time will be shifted before syslogd and other system
daemons are run.  This means that messages they write to
/usr/adm/messages will show the correct time.  If called from
rc.local, most daemons will be started while the clock is still in
DOS time.

I have included the source code to the timeshift executable as part
of the distribution.  I do not recommend making changes to this
code.  I provided the source, because I believe that people should
have access to any critical pieces of code that are installed and
run as root on their systems.  I, myself, would be leery of this
package if sources were not made available.  So, if you modify the
source and you encounter problems with it, then you are on your
own.  I will respond to feedback and suggestions for improving the
package.  I will not support modified copies of this code!

If something heinous happens to your system and the timeshift 
executable becomes corrupted, then reboot and halt will no longer
operate normally.
In this situation you should do the following:  
1.      boot into single user mode.  
2.      fsck -p to preen your drives.  
3.	cd /usr/etc 
4.      rm timeshift 
5.      mv halt.real halt
6.	mv reboot.real reboot

The changes to your rc.timeshift will only try to run at boot when
/usr/etc/shifted.time and /usr/etc/timeshift both exist.  You can
then reinstall timeshift from the installer package.

Deleting timshift via the Installer.app will remove timeshift, and
rename halt.real and reboot.real.  It will also remove /etc/rc.timeshift.
It will not modify /etc/rc or /etc/rc.local but since that code
will now no longer try to run rc.timeshift you will still be able
to boot normally until you decide to remove

timeshift will reset the clock for all normal reboot and shutdown
vectors:
	shutdown called from the shell.
	halt or reboot called from the shell.
	'Turn it off' button in the Power off panel.
	'Power off' button in the logout panel.
	'Reboot' or 'Power' buttons on the login panel.

Note that the time will not be shifted after a crash, or by any
other ungraceful shutdown vecter (like restart via the Cmd-NumLock
monitor).  This means that if you boot MS/Windows before rebooting
to repair filesystems, etc, then time will be off in DOS.

This code is provided as shareware but is not in the public domain.
It can be distributed, unmodified, in both source and binary form.

If you find this software useful, and use it, please send a payment
of $10.  My current address is:
	James E. Quick
	13 Nonantum Place #2
	Newton, MA 02158

If you are on the net, you can always verify my current address
via 'whois quick.com'

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.