packaging-RSA: Import platform restart from RSA
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Thu, 18 Apr 2013 07:29:53 +0000 (09:29 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 23 Feb 2024 13:52:13 +0000 (14:52 +0100)
Platform restart functionality patch reorganized.

 Previous patch made by Sangjung Woo <sangjung.woo@samsung.com>
 had to be reorganized to ensure that it may be applied on any
 systemd version. Now it is applied without modifying any
 systemd files (ex. Makefile).

Change-Id: I187f05c24f3e8267a9e88c11a0a9ca84a6ae7d71
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
platform_restart/cleanup-tmp.service [new file with mode: 0644]
platform_restart/do-return.service [new file with mode: 0644]
platform_restart/platform-restart.service [new file with mode: 0644]
platform_restart/platform-restart.target [new file with mode: 0644]
platform_restart/pr-action.target [new file with mode: 0644]
platform_restart/pr-custom.target [new file with mode: 0644]

diff --git a/platform_restart/cleanup-tmp.service b/platform_restart/cleanup-tmp.service
new file mode 100644 (file)
index 0000000..7509754
--- /dev/null
@@ -0,0 +1,14 @@
+# This file is for platform restart of Tizen
+
+[Unit]
+Description=Clean up temporary directory
+DefaultDependencies=no
+Before=pr-action.target pr-custom.target do-return.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/umount /tmp
+ExecStart=/bin/mount /tmp
+
+[Install]
+WantedBy=pr-action.target
diff --git a/platform_restart/do-return.service b/platform_restart/do-return.service
new file mode 100644 (file)
index 0000000..fe9675d
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Re-run system daemon
+DefaultDependencies=no
+After=pr-custom.target
+Before=pr-action.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/systemctl default
+
+[Install]
+WantedBy=pr-action.target
diff --git a/platform_restart/platform-restart.service b/platform_restart/platform-restart.service
new file mode 100644 (file)
index 0000000..f5b0b3f
--- /dev/null
@@ -0,0 +1,12 @@
+# This file is the main service file of platform restart.
+#
+[Unit]
+Description=Platform restart main service
+DefaultDependencies=no
+Requires=shutdown.target
+After=shutdown.target
+
+[Service]
+Type=oneshot
+StandardOutput=kmsg
+ExecStart=/usr/bin/systemctl isolate pr-action.target
diff --git a/platform_restart/platform-restart.target b/platform_restart/platform-restart.target
new file mode 100644 (file)
index 0000000..46b9e5c
--- /dev/null
@@ -0,0 +1,6 @@
+[Unit]
+Description=Platform restart without Kernel rebooting
+DefaultDependencies=no
+Requires=platform-restart.service
+After=platform-restart.service
+AllowIsolate=yes
diff --git a/platform_restart/pr-action.target b/platform_restart/pr-action.target
new file mode 100644 (file)
index 0000000..64c4eca
--- /dev/null
@@ -0,0 +1,11 @@
+# This file is for platform-restart action target
+#
+# This target do something as belows
+# - Clean the '/tmp' directory
+# - Run 'pr-custom.target'
+# - Re-run all Tizen service daemons
+
+[Unit]
+Description=Platform-restart action
+DefaultDependencies=no
+AllowIsolate=yes
diff --git a/platform_restart/pr-custom.target b/platform_restart/pr-custom.target
new file mode 100644 (file)
index 0000000..8236058
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=Custom action script for platform restart
+DefaultDependencies=no
+After=cleanup-tmp.service
+Before=do-return.service