KYLIN-LOCATION(8) System Administration Utilities KYLIN-LOCATION(8)

kylin-location - KYLIN SDK Location Information Service

kylin-location

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.

Automatically detects the system's public IP address by querying external services
Uses Baidu Map API to resolve IP addresses to geographic coordinates and location information
Exposes location information through D-Bus for inter-process communication
Returns location information in structured JSON format for easy parsing

The service implements the D-Bus interface `com.kysdk.location` with the following methods:

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

/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

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

Required for executing the service script
For D-Bus communication
For HTTP API requests
For GLib main loop integration
Required for IP address detection and location API queries

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)

Requires active internet connection to function properly
Depends on external services for IP detection (sohu.com) and location resolution (Baidu Map API)
Location accuracy depends on the external API and may vary by region
Public IP address is sent to external services for location resolution

KylinSoft Co., Ltd.

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.

dbus-daemon(1), systemd(1), ip(8), curl(1)

2025 Version 1.0