- if [ ! -f /var/lock/subsys/timezone ]; then
- if [ -f "$ZONE_FILE" ]; then
- rm -f /etc/localtime
-
- if [ -n "$ZONE_INFO_AREA" ]; then
- MESSAGE="`nls 'Setting time zone information (%s, %s)' "$ZONE_INFO_AREA" "$TIME_ZONE"`"
- else
- MESSAGE="`nls 'Setting time zone information (%s)' "$TIME_ZONE"`"
- fi
- run_cmd "$MESSAGE" cp -afc $ZONE_FILE /etc/localtime
- RETVAL=$?
- fi
-
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/timezone
+ if [ -f /var/lock/subsys/timezone ]; then
+ msg_already_running timezone
+ return
+ fi
+
+ if [ -f "$ZONE_FILE" ]; then
+ rm -f /etc/localtime
+
+ MESSAGE=$(nls 'Setting time zone information (%s)' "$TIMEZONE")
+
+ run_cmd "$MESSAGE" cp -af "$ZONE_FILE" /etc/localtime
+ RETVAL=$?
+ restorecon /etc/localtime >/dev/null 2>&1
+ else
+ show "Missing %s file" "$ZONE_FILE"
+ fail
+ RETVAL=2