[Unit]
Description=Sensor Daemon
-Requires=sensord.socket
[Service]
-User=sensor
-Group=input
-Type=notify
-SmackProcessLabel=System
-ExecStart=/usr/bin/sensord
-MemoryMax=20M
-Nice=-5
+Type=simple
[Install]
WantedBy=multi-user.target
Description=Sensor socket
[Socket]
-SocketUser=sensor
-SocketGroup=input
ListenStream=/run/.sensord.socket
SocketMode=0777
PassCredentials=yes
%{_unitdir}/sensord.socket
%{_unitdir}/multi-user.target.wants/sensord.service
%{_unitdir}/sockets.target.wants/sensord.socket
+%{_libdir}/hal/libhal-backend-service-sensord.so
%config %{_sysconfdir}/sensord/auto_rotation.conf
%license LICENSE.APLv2
%files devel
%manifest packaging/sensord.manifest
-%exclude %{_includedir}/sensor/sensor_hal.h
%{_includedir}/sensor/*.h
%{_libdir}/libsensor.so
%{_libdir}/pkgconfig/sensor.pc
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(sensord CXX)
-SET(DEPENDENTS "glib-2.0 gio-2.0 dlog libsystemd cynara-client cynara-creds-socket cynara-session vconf hal-api-sensor hal-api-common")
+SET(DEPENDENTS
+ glib-2.0
+ gio-2.0
+ dlog
+ libsystemd
+ cynara-client
+ cynara-creds-socket
+ cynara-session
+ vconf
+ hal-api-sensor
+ hal-api-common
+)
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(SERVER_PKGS REQUIRED ${DEPENDENTS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SERVER_PKGS_LDFLAGS} ${CMAKE_DL_LIBS} "sensord-shared")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+SET(LIBRARY_NAME "hal-backend-service-sensord")
+ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SERVER_SRCS})
+TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${SERVER_PKGS_LDFLAGS} ${CMAKE_DL_LIBS} "sensord-shared")
+INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/hal COMPONENT RuntimeLibraries)
#include <glib-unix.h>
+#include <hal/hal-common.h>
#include <sensor_log.h>
#include "server.h"
return 0;
}
+
+static int sensord_init(void *data)
+{
+ _I("Started");
+
+ server::run();
+
+ return 0;
+}
+
+static int sensord_exit(void *data)
+{
+ server::stop();
+
+ _I("Stopped");
+
+ return 0;
+}
+
+__attribute__((visibility("default")))
+hal_backend_service hal_backend_service_sensord_data = {
+ .module = HAL_MODULE_SENSORD,
+ .name = "hal-backend-service-sensord-data",
+ .early_init = NULL,
+ .init = sensord_init,
+ .exit = sensord_exit,
+ .late_exit = NULL,
+};