Wrong system time and Lotus/Domino

February 18, 2008 at 2:54 pm Leave a comment

Domino appears to very sensitive when started with wrong date, therefore it is worth considering the following precautions on a server hosting domino messaging system.

1.Make sure ntp service starts before domino. Look at the sequence in /etc/init.d/rcX.d directory

Incorrect:
lrwxrwxrwx 1 root root 9 Feb 18 10:24 S10domino -> ../domino
lrwxrwxrwx 1 root root 8 Feb 18 10:25 S12xntpd -> ../xntpd

or:
lrwxrwxrwx 1 root root 9 Feb 18 10:24 S12domino -> ../domino
lrwxrwxrwx 1 root root 8 Feb 18 10:25 S12xntpd -> ../xntpd

(with the same priority numbers (12) domino still will start ahead of xntpd as the startup sequence will be determined alphabetically in this case (d before x).

Correct:
lrwxrwxrwx 1 root root 8 Feb 18 10:25 S08xntpd -> ../xntpd
lrwxrwxrwx 1 root root 9 Feb 18 10:24 S12domino -> ../domino

2. SuSE Enterprise Server has a configuration parameter that should force ntp to adjust time in one step during boot. Enable the following in /etc/ssyconfig/ntp:
NTPD_INITIAL_NTPDATE=”AUTO-2″

3. Additionally you may consider putting fail-safe check into start-up scripts for ntp and domino to prevent mail server starting in cases when there is possibility NTP is not functioning correctly (either due to network problems or misconfiguration). This fail-safe measure will favour not starting domino over risking starting it with incorrect date.

This is how it should work:

In case of NTP failure:

  • NTP starts before Domino and in case it fails to fetch time from external time sources it will create file /var/log/xntp which would indicate ntp failure.
  • Domino startup script will check for existence of /var/log/xntp, print current time both for hardware clock and system and asks user to confirm desired action.
  • At this point user can override default action if satisfied that the time is correct. After 60 seconds startup will proceed with the default setting which is not to initialize domino services.

In case NTP working correctly

  • NTP sets the correct time and as a result /var/log/xntp file will not be created
  • Domino startup does not detect /var/log/xntp file and the default action in this scenario is to proceed with domino startup. User still will have 60 second to override default action.

The following should be added to ‘start’ section of domino initialization script (/etc/init.d/Domino):

CONFIRM=”y”
if [ -e /var/log/xntp ]; then
echo “NTP server failed to contact external time source.”
echo “Domino startup will be skipped in order to prevent it running with incorrect date”
echo “Your current System time is:”
date
echo “Your current Hardware Clock time is:”
sudo /sbin/hwclock –show
echo “Please verify the System Time and Hardware Clock show correct date”
CONFIRM=”n”
fi
while true
do

echo -n “Please confirm you want to start Domino at this time (y or n) :”
echo ” ”
echo -n “Boot process will continue in 60 seconds. Current default value is set to: $CONFIRM”
echo ” ”
read -t 60 CONFIRM
case $CONFIRM in
y|Y|YES|yes|Yes) break ;;
n|N|no|NO|No)
echo Aborting – you entered $CONFIRM
exit
;;
*) echo Please enter only y or n
esac
done
echo “You entered $CONFIRM. Continuing …”

Changes in ‘start’ section of /etc/init.d/xntpd script (modifications marked red):

start)
NTPDATE_FROM=$(initial_ntpdate)
if [ -n "$NTPDATE_FROM" -a -x $NTPDATE_BIN ]; then
ntpd_is_running || {
echo -n "Try to get initial date and time via NTP from $NTPDATE_FROM"
# -b: Set time on runlevel change, otherwise let
# ntpdate decide whether to slew or step.
test $link = $base \
&& FORCE_STEP="" \
|| FORCE_STEP="-b"
# -u: Use an unprivileged port for outgoing packets,
# may be we have to synchronise with hosts beyond
# a firewall.
if [ -s /var/log/xntp ]; then
rm /var/log/xntp
fi

# Securelinx End
$NTPDATE_BIN -su $FORCE_STEP $NTPDATE_FROM \
&& echo $rc_done \
|| echo $rc_failed 2>&1 |tee /var/log/xntp
# error here is reported but not propagated.
}
fi

echo -n “Starting network time protocol daemon (NTPD)”
test “${XNTPD_RUN_CHROOTED}” = “yes” && prepare_chroot
startproc $NTPD_BIN -p ${NTPD_PID} $XNTPD_OPTIONS
rc_status -v
;;
The problem described here is probably not encountered too often, but as our experience suggests – it happens.

Advertisements

Entry filed under: SuSE. Tags: , , , .

Daylight saving time

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Categories


%d bloggers like this: