| KYSDK-SYSTIME(8) | System Administration Utilities | KYSDK-SYSTIME(8) |
NAME
kysdk-systime - KYLIN SDK System Time Monitoring Service
SYNOPSIS
kysdk-systime
DESCRIPTION
kysdk-systime is a system time monitoring service in the KYLIN SDK system. This service provides real-time system time broadcasting and monitoring capabilities, detecting system time changes and timezone changes, and broadcasting time information through D-Bus signals.
The service runs as a system daemon that continuously monitors the system clock for changes and broadcasts time updates every minute. It also monitors for system time adjustments and timezone changes, ensuring accurate time information is available to all subscribed applications.
FEATURES
- Real-time Time Broadcasting
- Broadcasts current system time every minute through D-Bus signals
- System Time Change Detection
- Monitors and detects system time adjustments using timerfd
- Timezone Change Monitoring
- Monitors changes to system timezone settings using inotify
- D-Bus Signal Broadcasting
- Provides time information through D-Bus signals for inter-process communication
- Precise Timing
- Uses high-precision timers for accurate time synchronization
D-Bus INTERFACE
The service implements the following D-Bus interface `com.kylin.kysdk.TimeInterface` with these signals:
- TimeSignal
- Emitted every minute with current time information in format: "YYYY/MM/DD HH:MM:SS"
- TimeChangeSignal
- Emitted when system time or timezone changes, providing updated time information
MONITORED EVENTS
- System Time Changes
- Detects manual time adjustments, NTP synchronization, and other time modifications
- Timezone Changes
- Monitors changes to /etc/localtime for timezone updates
- Clock Drift
- Handles clock synchronization and drift correction
THREADING MODEL
The service uses a multi-threaded architecture:
- Main Thread
- Handles D-Bus communication and main event loop
- Time Change Monitor Thread
- Monitors system time changes using timerfd
- Timezone Monitor Thread
- Monitors timezone changes using inotify
- Time Broadcast Thread
- Manages periodic time broadcasting
TIMER SYSTEM
- Periodic Timer
- Runs every 60 seconds for regular time broadcasting
- Single-shot Timer
- Used for immediate time change notifications
- Timer Synchronization
- Automatically resynchronizes when time changes are detected
FILES
- /usr/bin/systime
- Main executable file
- /etc/systemd/system/kysdk-systime.service
- Systemd service configuration file
- /etc/localtime
- Monitored file for timezone changes
SERVICE
The service runs as a systemd service with: - Service name: kysdk-systime.service - D-Bus name: com.kylin.kysdk.TimeServer - Object path: /com/kylin/kysdk/Timer - Interface: com.kylin.kysdk.TimeInterface - Type: D-Bus activated service
DEPENDENCIES
- D-Bus
- For inter-process communication
- GLib
- For main loop integration
- libkytimer
- For timer management functionality
- systemd
- For service management
SIGNAL HANDLING
- SIGTERM, SIGINT
- Graceful shutdown signals
- TFD_TIMER_CANCEL_ON_SET
- Special timer flag for detecting time changes
TIME FORMATS
All time information is broadcast in the following format: YYYY/MM/DD HH:MM:SS - 4-digit year - 2-digit month (01-12) - 2-digit day (01-31) - 2-digit hour (00-23) - 2-digit minute (00-59) - 2-digit second (00-59)
SYNCHRONIZATION
- Automatic Resync
- Automatically resynchronizes timers when time changes are detected
- Mis-sync Handling
- Detects and corrects timing drift or missed notifications
- Timer Management
- Intelligently manages periodic and single-shot timers
AUTHOR
KylinSoft Co., Ltd.
COPYRIGHT
Copyright (C) 2023-2025, KylinSoft Co., Ltd.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
SEE ALSO
dbus-daemon(1), systemd(1), timedatectl(1), ntp(8), tzset(3)
| 2025 | Version 0.1 |