Move rc.shutdown from system-plugin-slp 38/8538/5
authorMaciej Wereski <m.wereski@partner.samsung.com>
Thu, 24 Oct 2013 03:07:05 +0000 (12:07 +0900)
committerjy910.yun <jy910.yun@samsung.com>
Thu, 24 Oct 2013 03:08:24 +0000 (12:08 +0900)
Change-Id: Ic26101c5a423c1aef3639ce3378b55f2f2ad7fb2
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
CMakeLists.txt
packaging/system-server.changes
packaging/system-server.spec
restarter/restart.c
shutdown.sh [new file with mode: 0755]
ss_predefine.c

index f2975ee..f6f6a9f 100755 (executable)
@@ -109,6 +109,7 @@ INSTALL(FILES ${UDEV_RULES} DESTINATION ${UDEV_RULES_PATH})
 INSTALL(FILES system-server.conf DESTINATION /etc/dbus-1/system.d)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/packaging/system-server.rule DESTINATION /opt/etc/smack/accesses.d)
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mmc-smack-label DESTINATION bin)
+INSTALL(PROGRAMS shutdown.sh DESTINATION /usr/lib/system-server)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/system-server.service DESTINATION /usr/lib/systemd/system)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/system-server.socket  DESTINATION /usr/lib/systemd/system)
index fb13887..d048d0a 100644 (file)
@@ -1,3 +1,6 @@
+* Thu Aug 22 2013 Maciej Wereski <m.wereski@partner.samsung.com> accepted/tizen/20130710.221248@1177917
+- Move rc.shutdown from system-plugin-slp
+
 * Sun Aug 25 2013 Chengwei Yang <chengwei.yang@intel.com>
 - Remove debian packaging stuff
 
index 83a9a43..408ad07 100755 (executable)
@@ -145,6 +145,7 @@ systemctl daemon-reload
 %config %{_sysconfdir}/dbus-1/system.d/system-server.conf
 %{_bindir}/system_server
 /opt/etc/smack/accesses.d/system-server.rule
+/usr/lib/system-server/shutdown.sh
 %if 0%{?simulator}
 %exclude %{_bindir}/restart
 %else
index e869e41..5e40f33 100644 (file)
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-       system("/etc/rc.d/rc.shutdown &");
+       system("/usr/lib/system-server/shutdown.sh &");
         sleep(1);
         sync();
        reboot(RB_AUTOBOOT);
diff --git a/shutdown.sh b/shutdown.sh
new file mode 100755 (executable)
index 0000000..553f94f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+export DISPLAY=:0
+killall power_manager
+killall -9 udevd
+#killall -9 system_server
+killall -9 xinit
+
+rm -rf /tmp/vip/*
+
+echo "Run Shutdown animation..."
+nice -n -15 /usr/bin/boot-animation --offmsg " " --clear &
+sleep 1
+
+echo "Stopping indicator..."
+killall -9 indicator
+
+# factory resetting...
+# flag set by factory-reset.sh
+if [ -f /opt/.factoryreset ]; then
+       /usr/bin/run-factory-reset.sh
+fi
+
index 44e8d28..82980e0 100644 (file)
@@ -557,7 +557,7 @@ int internal_poweroff_def_predefine_action(int argc, char **argv)
 {
        int ret;
 
-       system("/etc/rc.d/rc.shutdown &");
+       system("/usr/lib/system-server/shutdown.sh &");
        sync();
 
        gettimeofday(&tv_start_poweroff, NULL);
@@ -733,7 +733,7 @@ int restart_def_predefine_action(int argc, char **argv)
 
        heynoti_publish(POWEROFF_NOTI_NAME);
        pm_change_state(LCD_NORMAL);
-       system("/etc/rc.d/rc.shutdown &");
+       system("/usr/lib/system-server/shutdown.sh &");
        sync();
 
        gettimeofday(&tv_start_poweroff, NULL);