| KYLIN-LOCATION(8) | System Administration Utilities | KYLIN-LOCATION(8) |
NAME
kylin-location - KYLIN SDK Location Information Service
SYNOPSIS
kylin-location
DESCRIPTION
kylin-location is a location information service in the KYLIN SDK system. This service provides geographic location information by determining the system's public IP address and querying location databases to obtain geographic coordinates and location details.
The service is implemented as a Python daemon that runs in the background and exposes its functionality through a D-Bus interface with the service name `com.kysdk.location`. It uses the Baidu Map API to resolve IP addresses to geographic locations.
FEATURES
- IP Address Detection
- Automatically detects the system's public IP address by querying external services
- Geographic Location Resolution
- Uses Baidu Map API to resolve IP addresses to geographic coordinates and location information
- D-Bus Integration
- Exposes location information through D-Bus for inter-process communication
- JSON Format Response
- Returns location information in structured JSON format for easy parsing
D-BUS INTERFACE
The service implements the D-Bus interface `com.kysdk.location` with the following methods:
- getAddress()
- Returns geographic location information as a JSON string. The method: -
Detects the system's public IP address - Queries the Baidu Map IP location
API - Returns location data including coordinates, address details, and
accuracy information - Returns error messages if the API query fails
The returned JSON structure contains: - status: API response status (0 for success) - address: Formatted address string - content: Detailed location information including:
- point: Geographic coordinates (x/y or lat/lng)
- address_detail: Detailed address components
- accuracy: Location accuracy information
FILES
- /usr/bin/kylin-location
- Python script implementing the location service
- /usr/bin/kylin-location
- Service executable (symbolic link or wrapper)
- /etc/systemd/system/dbus_location.service
- Systemd service configuration file
- /var/log/location.log
- Log file for service operations and debugging information
SERVICE
The service runs as a systemd service with the following characteristics: - Service name: dbus_location.service - D-Bus name: com.kysdk.location - Object path: /com/kysdk/location - Type: D-Bus activated service - Restart policy: Always restarts automatically
DEPENDENCIES
- Python 3
- Required for executing the service script
- python-dbus
- For D-Bus communication
- python-requests
- For HTTP API requests
- python-gi
- For GLib main loop integration
- Internet connectivity
- Required for IP address detection and location API queries
API INTEGRATION
The service uses the Baidu Map IP Location API: - Endpoint: http://api.map.baidu.com/location/ip - API Key: Preconfigured in the service (4DPAeozisfSCUgSLuC14Ux4iXjeEYNGa) - Coordinate system: BD09LL (Baidu coordinate system)
LIMITATIONS
- Internet Requirement
- Requires active internet connection to function properly
- External Service Dependency
- Depends on external services for IP detection (sohu.com) and location resolution (Baidu Map API)
- Accuracy
- Location accuracy depends on the external API and may vary by region
- Privacy
- Public IP address is sent to external services for location resolution
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
| 2025 | Version 1.0 |