From a3cfb75871c9bccd1edc98903296f223e2537521 Mon Sep 17 00:00:00 2001 From: Jean-Benoit MARTIN Date: Tue, 11 Feb 2014 16:45:43 +0100 Subject: [PATCH] remove hardcoded path for multiuser support Bug-Tizen: PTREL-349 Change-Id: Id1dd67971e33281351b65cb3a106aca7ded6a229 Signed-off-by: Jean-Benoit MARTIN --- packaging/init_push_DB.sh | 36 ++++++++++++++++++++++++++++++++++++ packaging/push.spec | 38 ++++++-------------------------------- 2 files changed, 42 insertions(+), 32 deletions(-) create mode 100644 packaging/init_push_DB.sh diff --git a/packaging/init_push_DB.sh b/packaging/init_push_DB.sh new file mode 100644 index 0000000..ad3fbee --- /dev/null +++ b/packaging/init_push_DB.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +source /etc/tizen-platform.conf + +mkdir -p $TZ_SYS_DB +sqlite3 $TZ_SYS_DB/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null +chown root:$TZ_SYS_USER_GROUP $TZ_SYS_DB/.push.db +chown root:$TZ_SYS_USER_GROUP $TZ_SYS_DB/.push.db-journal +chmod 660 $TZ_SYS_DB/.push.db +chmod 660 $TZ_SYS_DB/.push.db-journal + +#chsmack -a 'push-service::db' /opt/dbspace/.push.db +#chsmack -a 'push-service::db' /opt/dbspace/.push.db-journal + +users_gid=$(getent group $TZ_SYS_USER_GROUP | cut -f3 -d':') + +_VER="1" +_DEV_TYPE="00000000" +_DEV_INFO="device.model=ssltest" +_IP_PV="gld.push.samsungosp.com" +_PORT_PV=5223 +#ping interval {120,240,480,960,1920} +_PING_INT=480 +_GRP="-g $users_gid" + +vconftool set -t string file/private/push-bin/version ${_VER} ${_GRP} -f +vconftool set -t string file/private/push-bin/dev_type ${_DEV_TYPE} ${_GRP} -f +vconftool set -t string file/private/push-bin/dev_info ${_DEV_INFO} ${_GRP} -f +vconftool set -t string file/private/push-bin/ip_pv ${_IP_PV} ${_GRP} -f +vconftool set -t int file/private/push-bin/port_pv ${_PORT_PV} ${_GRP} -f +vconftool set -t int file/private/push-bin/ping_int ${_PING_INT} ${_GRP} -f +vconftool set -t string file/private/push-bin/devtk "" ${_GRP} -f +vconftool set -t string file/private/push-bin/ip_pri "" ${_GRP} -f +vconftool set -t int file/private/push-bin/port_pri -1 ${_GRP} -f +vconftool set -t string file/private/push-bin/ip_sec "" ${_GRP} -f +vconftool set -t int file/private/push-bin/port_sec -1 ${_GRP} -f diff --git a/packaging/push.spec b/packaging/push.spec index 5963809..1459fa1 100755 --- a/packaging/push.spec +++ b/packaging/push.spec @@ -9,6 +9,8 @@ Source1001: libpush.manifest Source1002: libpush-devel.manifest Source1003: %{name}-bin.manifest Source1004: %{name}-tool.manifest +Source1005: init_push_DB.sh +BuildRequires: pkgconfig(libtzplatform-config) %description @@ -117,39 +119,10 @@ cp -a x86/bin/push_tool %{buildroot}%{_bindir} # chsmack -a "_" -e "_" %{buildroot}/etc/rc.d/rc5.d/S90pushd #fi +install -D -m 0750 %{SOURCE1005} %{buildroot}%{_datadir}/%{name}/init_push_DB.sh + %post bin -mkdir -p /opt/dbspace -sqlite3 /opt/dbspace/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null -chown root:5000 /opt/dbspace/.push.db -chown root:5000 /opt/dbspace/.push.db-journal -chmod 660 /opt/dbspace/.push.db -chmod 660 /opt/dbspace/.push.db-journal - -#chsmack -a 'push-service::db' /opt/dbspace/.push.db -#chsmack -a 'push-service::db' /opt/dbspace/.push.db-journal - -_VER="1" -_DEV_TYPE="00000000" -_DEV_INFO="device.model=ssltest" -_IP_PV="gld.push.samsungosp.com" -_PORT_PV=5223 -#ping interval {120,240,480,960,1920} -_PING_INT=480 -_GRP="-g 5000" - -vconftool set -t string file/private/push-bin/version ${_VER} ${_GRP} -f -vconftool set -t string file/private/push-bin/dev_type ${_DEV_TYPE} ${_GRP} -f -vconftool set -t string file/private/push-bin/dev_info ${_DEV_INFO} ${_GRP} -f -vconftool set -t string file/private/push-bin/ip_pv ${_IP_PV} ${_GRP} -f -vconftool set -t int file/private/push-bin/port_pv ${_PORT_PV} ${_GRP} -f -vconftool set -t int file/private/push-bin/ping_int ${_PING_INT} ${_GRP} -f -vconftool set -t string file/private/push-bin/devtk "" ${_GRP} -f -vconftool set -t string file/private/push-bin/ip_pri "" ${_GRP} -f -vconftool set -t int file/private/push-bin/port_pri -1 ${_GRP} -f -vconftool set -t string file/private/push-bin/ip_sec "" ${_GRP} -f -vconftool set -t int file/private/push-bin/port_sec -1 ${_GRP} -f - -#vconftool unset file/private/push-bin/devtk +%{_datadir}/%{name}/init_push_DB.sh %post -n libpush /sbin/ldconfig @@ -176,6 +149,7 @@ vconftool set -t int file/private/push-bin/port_sec -1 ${_GRP} -f /etc/rc.d/rc5.d/S90pushd /usr/lib/systemd/user/pushd.service /usr/lib/systemd/user/tizen-middleware.target.wants/pushd.service +%{_datadir}/%{name}/init_push_DB.sh %files tool %manifest %{name}-tool.manifest -- 2.7.4