Remove final.target dependency from reboot sequence 46/259546/3 accepted/tizen/unified/20210611.145056 submit/tizen/20210610.022051
authorHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 9 Jun 2021 10:34:48 +0000 (19:34 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 10 Jun 2021 00:58:19 +0000 (09:58 +0900)
Change-Id: I1fbc7a5eda461f90202db92093a60edbb63d3941
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
CMakeLists.txt
packaging/deviced.spec
systemd/deviced-request-shutdown-exit.conf [new file with mode: 0644]
systemd/deviced-request-shutdown-halt.conf [new file with mode: 0644]
systemd/deviced-request-shutdown-poweroff.conf [new file with mode: 0644]
systemd/deviced-request-shutdown-reboot.conf [new file with mode: 0644]

index be6292a..a6dc088 100644 (file)
@@ -247,7 +247,16 @@ IF(POWER_MODULE STREQUAL on)
        SET(deviced-shutdown_LDFLAGS ${pkgs_LDFLAGS})
        TARGET_LINK_LIBRARIES(deviced-shutdown ${pkgs_LDFLAGS} "-lrt -ldl -lm" shared)
        INSTALL(TARGETS deviced-shutdown DESTINATION /usr/lib/systemd)
-       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown@.service DESTINATION /usr/lib/systemd/system)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown@.service
+                       DESTINATION /usr/lib/systemd/system)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-reboot.conf
+                       DESTINATION /usr/lib/systemd/system/systemd-reboot.service.d)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-poweroff.conf
+                       DESTINATION /usr/lib/systemd/system/systemd-poweroff.service.d)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-halt.conf
+                       DESTINATION /usr/lib/systemd/system/systemd-halt.service.d)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced-request-shutdown-exit.conf
+                       DESTINATION /usr/lib/systemd/system/systemd-exit.service.d)
 
        ADD_EXECUTABLE(deviced-request-shutdown src/power-command/command.c src/core/common.c src/core/execute.c)
        SET(deviced-request-shutdown_LDFLAGS ${pkgs_LDFLAGS})
index 143dbbf..53096aa 100644 (file)
@@ -184,12 +184,6 @@ rm -rf %{buildroot}
 %install_service basic.target.wants sdb-prestart.service
 %endif
 
-for i in reboot halt poweroff exit; do
-  D=%{buildroot}%{_unitdir}/systemd-${i}.service.wants
-  mkdir -p $D
-  ln -s ../deviced-request-shutdown@.service $D/deviced-request-shutdown@${i}.service
-done
-
 mkdir -p %{buildroot}%{TZ_SYS_DUMPGEN}
 install -m 775 scripts/dump_pmstate_log.sh %{buildroot}%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
 
@@ -281,10 +275,10 @@ mv %{_libdir}/iot-display.so %{_libdir}/deviced/display.so
 
 # Assume power module is on (-DPOWER_MODULE=on)
 %{_unitdir}/deviced-request-shutdown@.service
-%{_unitdir}/systemd-exit.service.wants/deviced-request-shutdown@exit.service
-%{_unitdir}/systemd-halt.service.wants/deviced-request-shutdown@halt.service
-%{_unitdir}/systemd-reboot.service.wants/deviced-request-shutdown@reboot.service
-%{_unitdir}/systemd-poweroff.service.wants/deviced-request-shutdown@poweroff.service
+%{_unitdir}/systemd-reboot.service.d/deviced-request-shutdown-reboot.conf
+%{_unitdir}/systemd-poweroff.service.d/deviced-request-shutdown-poweroff.conf
+%{_unitdir}/systemd-halt.service.d/deviced-request-shutdown-halt.conf
+%{_unitdir}/systemd-exit.service.d/deviced-request-shutdown-exit.conf
 %{_prefix}/lib/systemd/deviced-shutdown
 %{_sbindir}/deviced-request-shutdown
 
diff --git a/systemd/deviced-request-shutdown-exit.conf b/systemd/deviced-request-shutdown-exit.conf
new file mode 100644 (file)
index 0000000..66e49cb
--- /dev/null
@@ -0,0 +1,3 @@
+[Unit]
+Wants=deviced-request-shutdown@exit.service
+After=deviced-request-shutdown@exit.service
diff --git a/systemd/deviced-request-shutdown-halt.conf b/systemd/deviced-request-shutdown-halt.conf
new file mode 100644 (file)
index 0000000..467068d
--- /dev/null
@@ -0,0 +1,3 @@
+[Unit]
+Wants=deviced-request-shutdown@halt.service
+After=deviced-request-shutdown@halt.service
diff --git a/systemd/deviced-request-shutdown-poweroff.conf b/systemd/deviced-request-shutdown-poweroff.conf
new file mode 100644 (file)
index 0000000..0586d9d
--- /dev/null
@@ -0,0 +1,3 @@
+[Unit]
+Wants=deviced-request-shutdown@poweroff.service
+After=deviced-request-shutdown@poweroff.service
diff --git a/systemd/deviced-request-shutdown-reboot.conf b/systemd/deviced-request-shutdown-reboot.conf
new file mode 100644 (file)
index 0000000..a784a88
--- /dev/null
@@ -0,0 +1,3 @@
+[Unit]
+Wants=deviced-request-shutdown@reboot.service
+After=deviced-request-shutdown@reboot.service