summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengwei Yang <chengwei.yang@intel.com>2013-08-21 05:18:07 (GMT)
committerChengwei Yang <chengwei.yang@intel.com>2013-08-21 05:18:36 (GMT)
commit047d0849293d4289282b1e1fe34c35eb71fa5cb5 (patch)
treeffb8d54e55ffb5537c4399e60b12904cd67d07db
parent904a5884eb0d707d5a1c91e05b9e11708ae62905 (diff)
downloadoma-ds-agent-047d0849293d4289282b1e1fe34c35eb71fa5cb5.zip
oma-ds-agent-047d0849293d4289282b1e1fe34c35eb71fa5cb5.tar.gz
oma-ds-agent-047d0849293d4289282b1e1fe34c35eb71fa5cb5.tar.bz2
Remove sysvinit script and fix systemd unitrefs/changes/89/8489/1
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 <chengwei.yang@intel.com>
-rwxr-xr-xoma-ds73
-rwxr-xr-xoma-ds-agent.manifest3
-rw-r--r--oma-ds-agent.service1
-rw-r--r--packaging/oma-ds-agent.changes3
-rwxr-xr-xpackaging/oma-ds-agent.spec15
-rwxr-xr-xsrc/agent/CMakeLists.txt4
6 files changed, 4 insertions, 95 deletions
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 @@
<filesystem path="/usr/share/oma-ds-cfg/omads_fw_config.xml" label="oma-ds-agent::cfg"/>
<filesystem path="/opt/dbspace/.omasyncagent.db" exec_label="oma-ds-agent::db"/>
<filesystem path="/opt/dbspace/.omasyncagent.db-journal" exec_label="oma-ds-agent::db"/>
- <filesystem path="/etc/rc.d/rc3.d/S91oma-ds-agent" label="_" exec_label="none"/>
- <filesystem path="/etc/rc.d/rc5.d/S91oma-ds-agent" label="_" exec_label="none"/>
- <filesystem path="/etc/init.d/oma-ds" label="_" exec_label="none"/>
<filesystem path="/usr/share/dbus-1/system-services/com.samsung.omadsagent.service" label="_"/>
<filesystem path="/etc/dbus-1/system.d/com.samsung.omadsagent.conf" label="_"/>
</assign>
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,4 +1,7 @@
* Wed Aug 21 2013 Chengwei Yang <chengwei.yang@intel.com>
+- Remove sysvinit script
+
+* Wed Aug 21 2013 Chengwei Yang <chengwei.yang@intel.com>
- Install dbus service file to system-wide dbus service directory, TDIST-295
* Wed Aug 21 2013 Chengwei Yang <chengwei.yang@intel.com>
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/)
-