From 047d0849293d4289282b1e1fe34c35eb71fa5cb5 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Wed, 21 Aug 2013 13:18:07 +0800 Subject: Remove sysvinit script and fix systemd unit Sysvinit script is obsolete since tizen 2.1, so it's time to remove it. Meanwhile, there was a minor bug when migrate from sysvinit to systemd, so fix it. Change-Id: If34315c539429e0802050756cc343b69d2c77753 Signed-off-by: Chengwei Yang --- oma-ds | 73 ------------------------------------------ oma-ds-agent.manifest | 3 -- oma-ds-agent.service | 1 + packaging/oma-ds-agent.changes | 3 ++ packaging/oma-ds-agent.spec | 15 --------- src/agent/CMakeLists.txt | 4 --- 6 files changed, 4 insertions(+), 95 deletions(-) delete mode 100755 oma-ds diff --git a/oma-ds b/oma-ds deleted file mode 100755 index 893ebdb..0000000 --- a/oma-ds +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -DESC="OMA DS agent daemon" -NAME=oma-ds-agent -DAEMON=/usr/bin/$NAME -SCRIPTNAME=/etc/init.d/oma-ds - -[ -x "$DAEMON" ] || exit 0 - -do_start() { - PID=`pidof $NAME` - [ -z "$PID" ] || return 1 - $DAEMON - RETVAL=$? - return "$RETVAL" -} - -do_stop() { - PID=`pidof $NAME` - if [ -n "$PID" ]; then - kill $PID - fi - return 0 -} - -prt_res() { - RETVAL=$1 - - case "$RETVAL" in - 0|1) - echo "... done." - RETVAL=0 - ;; - *) - echo "... failed!" - RETVAL=1 - ;; - esac - - return $RETVAL -} - -case "$1" in - start) - echo "Starting $DESC" "$NAME" - if [ -f /opt/usr/data/oma-ds/.oma-ds-agent-enabled ]; then - do_start - prt_res $? - else - echo "don't exist oma-ds-agent enabled file" - prt_res $? - fi - ;; - stop) - echo "Stopping $DESC" "$NAME" - do_stop - prt_res $? - ;; - restart) - echo "Stopping $DESC" "$NAME" - do_stop - prt_res $? - sleep 2 - echo "Starting $DESC" "$NAME" - do_start - prt_res $? - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 - exit 3 - ;; -esac - diff --git a/oma-ds-agent.manifest b/oma-ds-agent.manifest index 607dc95..219c786 100755 --- a/oma-ds-agent.manifest +++ b/oma-ds-agent.manifest @@ -13,9 +13,6 @@ - - - diff --git a/oma-ds-agent.service b/oma-ds-agent.service index 82092c6..fe86da5 100644 --- a/oma-ds-agent.service +++ b/oma-ds-agent.service @@ -4,6 +4,7 @@ After=calendar.service contacts-service.service pushd.service msg-service.servic [Service] #Type=forking +ConditionPathExists=/opt/usr/data/oma-ds/.oma-ds-agent-enabled ExecStart=/usr/bin/oma-ds-agent [Install] diff --git a/packaging/oma-ds-agent.changes b/packaging/oma-ds-agent.changes index 129fc74..06afe9a 100644 --- a/packaging/oma-ds-agent.changes +++ b/packaging/oma-ds-agent.changes @@ -1,3 +1,6 @@ +* Wed Aug 21 2013 Chengwei Yang +- Remove sysvinit script + * Wed Aug 21 2013 Chengwei Yang - Install dbus service file to system-wide dbus service directory, TDIST-295 diff --git a/packaging/oma-ds-agent.spec b/packaging/oma-ds-agent.spec index 6518f4f..0cdc7b5 100755 --- a/packaging/oma-ds-agent.spec +++ b/packaging/oma-ds-agent.spec @@ -72,21 +72,8 @@ then mkdir /etc/rc.d/rc5.d fi -if [ ! -f /etc/rc.d/rc3.d/S91oma-ds-agent ] -then -ln -s /etc/init.d/oma-ds /etc/rc.d/rc3.d/S91oma-ds-agent -fi - -if [ ! -f /etc/rc.d/rc5.d/S91oma-ds-agent ] -then - ln -s /etc/init.d/oma-ds /etc/rc.d/rc5.d/S91oma-ds-agent -fi - -#/etc/init.d/oma-ds start - %preun -/etc/init.d/oma-ds stop %postun @@ -114,8 +101,6 @@ rm -rf /usr/share/oma-ds-cfg /usr/share/oma-ds-cfg/* %defattr(700,root,root) -/etc/init.d/oma-ds - %defattr(644,root,root) /usr/lib/systemd/system/oma-ds-agent.service /usr/lib/systemd/system/graphical.target.wants/oma-ds-agent.service diff --git a/src/agent/CMakeLists.txt b/src/agent/CMakeLists.txt index 0d99c9e..ee1ea32 100755 --- a/src/agent/CMakeLists.txt +++ b/src/agent/CMakeLists.txt @@ -79,7 +79,3 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.samsung.omadsagent.conf DESTINATION /etc/d INSTALL(FILES ${CMAKE_SOURCE_DIR}/oma-ds-agent.service DESTINATION /usr/lib/systemd/system) INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/usr/lib/systemd/system/graphical.target.wants)") INSTALL(CODE "EXECUTE_PROCESS(COMMAND ln -sf ../oma-ds-agent.service . WORKING_DIRECTORY \$ENV{DESTDIR}/usr/lib/systemd/system/graphical.target.wants)") - -# install booting script file -INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/${PROJECT_NAME} DESTINATION /etc/init.d/) - -- cgit v1.2.3