mkdir -p %{buildroot}/etc/dbus-1/system.d/
cp -af %{_builddir}/%{name}-%{version}/packaging/org.tizen.SmartcardService.conf %{buildroot}/etc/dbus-1/system.d/
+install -D -m 0644 server/org.tizen.SmartcardService.service %{buildroot}/%{_unitdir}/org.tizen.SmartcardService.service
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_bindir}/smartcard-daemon
%{_sysconfdir}/dbus-1/system.d/org.tizen.SmartcardService.conf
-%{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
+%{_unitdir}/org.tizen.SmartcardService.service
%if 0%{?gtests:1}
%{_bindir}/gtest*
%endif
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-L../common" "-lsmartcard-service-common" "-pie -ldl")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.SmartcardService.service DESTINATION share/dbus-1/system-services)
extern "C" void __gcov_flush(void);
#endif
-#ifndef USE_AUTOSTART
-static void daemonize(void)
-{
- pid_t pid, sid;
-
- /* already a daemon */
- if (getppid() == 1)
- return;
-
- /* Fork off the parent process */
- pid = fork();
- if (pid < 0)
- {
- exit(EXIT_FAILURE);
- }
-
- if (pid > 0)
- {
- exit(EXIT_SUCCESS); /*Killing the Parent Process*/
- }
-
- /* At this point we are executing as the child process */
- umask(0);
-
- /* Create a new SID for the child process */
- sid = setsid();
- if (sid < 0)
- {
- exit(EXIT_FAILURE);
- }
-
- /* Change the current working directory. */
- if ((chdir("/")) < 0)
- {
- exit(EXIT_FAILURE);
- }
-
- close(STDIN_FILENO);
- close(STDOUT_FILENO);
- close(STDERR_FILENO);
-}
-#endif
-
static void _bus_acquired_cb(GDBusConnection *connection,
const gchar *path, gpointer user_data)
{
guint id = 0;
signal(SIGTERM, &__sighandler);
-#ifndef USE_AUTOSTART
- daemonize();
-#endif
-
#if (BUILD_GCOV != 0)
setenv("GCOV_PREFIX", "/tmp/", 1);
#endif