Revert changes for supporting unified-system-plugin package 83/324883/1
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 28 May 2025 08:11:59 +0000 (17:11 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 28 May 2025 08:11:59 +0000 (17:11 +0900)
Since the 'run multiple services in one process' feature will be
implemented with united-service, previous implementations should be
removed.

This reverts commits below(old to new):
 * 658b9c42d61510d92c5c6204408d4ac63e6fe10e
 * cf796d0d87e7c077d1dc3c5d63b869e0c23c30d8
 * f83f717450de4f6d8b3921e2433d1cc78e88fca5
 * 01391b9fa57721a1d596c83c4e4ba076d03e4d5d

Change-Id: I9c1bf26a4900e27031c0681641049f9146469278
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
packaging/sensord.spec
src/server/CMakeLists.txt
src/server/main.cpp

index 6253bdf8a15e19ec967d365411840da799b6ffc1..87c5c3c8a781067b80b36e827e1b943d7f4413f4 100644 (file)
@@ -1,5 +1,3 @@
-%define enable_unified_system_service 0
-
 Name:       sensord
 Summary:    Sensor daemon
 Version:    4.0.54
@@ -73,10 +71,7 @@ Sensor functional testing
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
-%cmake . -DMAJORVER=${MAJORVER} \
-         -DFULLVER=%{version} \
-         -DCMAKE_HAL_LIBDIR_PREFIX=%{_hal_libdir} \
-         -DENABLE_UNIFIED_SYSTEM_SERVICE=%{enable_unified_system_service}
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DCMAKE_HAL_LIBDIR_PREFIX=%{_hal_libdir}
 make %{?_smp_mflags}
 
 %install
@@ -84,15 +79,14 @@ make %{?_smp_mflags}
 
 mkdir -p %{buildroot}%{_unitdir}
 
+install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
+install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
+
 mkdir -p %{buildroot}%{_sysconfdir}/sensord
 install -m 644 conf/auto_rotation.conf   %{buildroot}/etc/sensord/auto_rotation.conf
 
-%if %{enable_unified_system_service} != 1
-install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
-install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
 %install_service multi-user.target.wants sensord.service
 %install_service sockets.target.wants sensord.socket
-%endif
 
 ln -s libsensor.so.%{version} %{buildroot}/%{_libdir}/libsensor.so.2
 ln -s libsensor.so.%{version} %{buildroot}/%{_libdir}/libsensor.so.1
@@ -112,15 +106,11 @@ echo "You need to reinstall %{name}-dummy to keep using the APIs after uninstall
 %{_libdir}/libsensord-shared.so
 %{_libdir}/sensor/fusion/libsensor-fusion.so
 %{_libdir}/sensor/physical/libsensor-physical.so
-%if %{enable_unified_system_service}
-%{_libdir}/system/plugin/libunified-system-service-sensord.so
-%else
 %{_bindir}/sensord
 %{_unitdir}/sensord.service
 %{_unitdir}/sensord.socket
 %{_unitdir}/multi-user.target.wants/sensord.service
 %{_unitdir}/sockets.target.wants/sensord.socket
-%endif
 %config %{_sysconfdir}/sensord/auto_rotation.conf
 %license LICENSE.APLv2
 
@@ -139,9 +129,6 @@ rm -f %{_unitdir}/sensord.service
 rm -f %{_unitdir}/sensord.socket
 rm -f %{_unitdir}/multi-user.target.wants/sensord.service
 rm -f %{_unitdir}/sockets.target.wants/sensord.socket
-%if %{enable_unified_system_service}
-rm -f %{_libdir}/system/plugin/libunified-system-service-sensord.so
-%endif
 /sbin/ldconfig
 
 
index 9191430c4f4de5920178eda068720790319d33a5..4b38e0598167177df840690d0229a09ac7d7688d 100644 (file)
@@ -1,18 +1,7 @@
 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})
@@ -36,15 +25,7 @@ INCLUDE_DIRECTORIES(
 )
 
 FILE(GLOB SERVER_SRCS *.cpp)
-
-if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
-SET(LIBRARY_NAME "unified-system-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}/system/plugin COMPONENT RuntimeLibraries)
-else()
 ADD_EXECUTABLE(${PROJECT_NAME} ${SENSOR_SRCS} ${SERVER_SRCS})
 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})
-endif()
index d69b184acea308ae9984abc9083782d9b5085c92..c4ec0488a0fad5fea0e60eef4e0b1bfc04dcc4e8 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <glib-unix.h>
 
-#include <unified-system-service-common.h>
 #include <sensor_log.h>
 #include "server.h"
 
@@ -38,6 +37,16 @@ static void handle_signal_std(int signum)
        raise(SIGTERM);
 }
 
+static gboolean handle_signal(gpointer data)
+{
+       long signum = (long) data;
+       _W("Received SIGNAL(%ld : %s)", signum, strsignal(signum));
+
+       server::stop();
+
+       return G_SOURCE_REMOVE;
+}
+
 static void on_new_failed(void)
 {
        static unsigned fail_count = 0;
@@ -50,36 +59,6 @@ static void on_new_failed(void)
        }
 }
 
-static int sensord_init(void *data)
-{
-       _I("start sensord");
-
-       std::set_new_handler(on_new_failed);
-
-       server::run();
-
-       return 0;
-}
-
-static int sensord_exit(void *data)
-{
-       server::stop();
-
-       _I("sensord stopped");
-
-       return 0;
-}
-
-static gboolean handle_signal(gpointer data)
-{
-       long signum = (long) data;
-       _W("Received SIGNAL(%ld : %s)", signum, strsignal(signum));
-
-       sensord_exit(NULL);
-
-       return G_SOURCE_REMOVE;
-}
-
 int main(int argc, char *argv[])
 {
        _I("Started");
@@ -95,18 +74,11 @@ int main(int argc, char *argv[])
        std::signal(SIGCHLD, SIG_IGN);
        std::signal(SIGPIPE, SIG_IGN);
 
-       sensord_init(NULL);
+       std::set_new_handler(on_new_failed);
+
+       server::run();
 
        _I("Stopped");
 
        return 0;
 }
-
-__attribute__((visibility("default")))
-unified_system_service unified_system_service_sensord_data = {
-       .name           = "unified-system-service-sensord-data",
-       .early_init     = NULL,
-       .init           = sensord_init,
-       .exit           = sensord_exit,
-       .late_exit      = NULL,
-};