From: Dariusz Michaluk Date: Mon, 15 Dec 2014 12:13:52 +0000 (+0100) Subject: Change zonesPath and ExecStart command in service X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bf358a390639906a64f6d9c1487c86be2962ba2;p=platform%2Fcore%2Fsecurity%2Fvasum.git Change zonesPath and ExecStart command in service [Bug/Feature] N/A [Cause] N/A [Solution] N/A [Verification] Build, install, run tests Change-Id: Ie51e3bd436f039f926c93b92ea5343e27e7314c0 Signed-off-by: Dariusz Michaluk --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cd999d7..a12367f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,6 +152,10 @@ IF(NOT DEFINED SYSTEMD_UNIT_DIR) SET(SYSTEMD_UNIT_DIR "${LIB_INSTALL_DIR}/systemd/system") ENDIF(NOT DEFINED SYSTEMD_UNIT_DIR) +IF(NOT DEFINED DATA_DIR) + SET(DATA_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}") +ENDIF(NOT DEFINED DATA_DIR) + SET(VSM_CONFIG_INSTALL_DIR ${SYSCONF_INSTALL_DIR}/vasum) SET(VSM_DATA_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/vasum) diff --git a/packaging/vasum.spec b/packaging/vasum.spec index 78db5de..887409e 100644 --- a/packaging/vasum.spec +++ b/packaging/vasum.spec @@ -51,6 +51,7 @@ between them. A process from inside a zone can request a switch of context %{_unitdir}/vasum.service %{_unitdir}/multi-user.target.wants/vasum.service /etc/dbus-1/system.d/org.tizen.vasum.host.conf +%dir %{_datadir}/.zones %prep %setup -q @@ -67,6 +68,7 @@ between them. A process from inside a zone can request a switch of context -DCMAKE_BUILD_TYPE=%{build_type} \ -DSCRIPT_INSTALL_DIR=%{script_dir} \ -DSYSTEMD_UNIT_DIR=%{_unitdir} \ + -DDATA_DIR=%{_datadir} \ -DPYTHON_SITELIB=%{python_sitelib} \ -DVASUM_USER=%{vsm_user} \ -DINPUT_EVENT_GROUP=%{input_event_group} \ @@ -78,6 +80,7 @@ make -k %{?jobs:-j%jobs} %make_install mkdir -p %{buildroot}/%{_unitdir}/multi-user.target.wants ln -s ../vasum.service %{buildroot}/%{_unitdir}/multi-user.target.wants/vasum.service +mkdir -p %{buildroot}/%{_datadir}/.zones %clean rm -rf %{buildroot} diff --git a/server/configs/CMakeLists.txt b/server/configs/CMakeLists.txt index b5c9286..9c0fa4b 100644 --- a/server/configs/CMakeLists.txt +++ b/server/configs/CMakeLists.txt @@ -29,7 +29,10 @@ CONFIGURE_FILE(systemd/vasum.service.in ## Install ##################################################################### -INSTALL(FILES daemon.conf +CONFIGURE_FILE(daemon.conf.in + ${CMAKE_BINARY_DIR}/daemon.conf) + +INSTALL(FILES ${CMAKE_BINARY_DIR}/daemon.conf DESTINATION ${VSM_CONFIG_INSTALL_DIR}) # preprocess d-bus configs diff --git a/server/configs/daemon.conf b/server/configs/daemon.conf.in similarity index 84% rename from server/configs/daemon.conf rename to server/configs/daemon.conf.in index 714640e..296c1c7 100644 --- a/server/configs/daemon.conf +++ b/server/configs/daemon.conf.in @@ -1,7 +1,7 @@ { "zoneConfigs" : ["zones/private.conf", "zones/business.conf"], - "zonesPath" : "/opt/usr/zones", - "zoneImagePath" : "/opt/usr/zones/img/system-data.img", + "zonesPath" : "${DATA_DIR}/.zones", + "zoneImagePath" : "${DATA_DIR}/.zones/img/system-data.img", "zoneTemplatePath" : "templates", "zoneNewConfigPrefix" : "/var/lib/vasum", "runMountPointPrefix" : "/var/run/zones", diff --git a/server/configs/systemd/vasum.service.in b/server/configs/systemd/vasum.service.in index f36622a..8131ed5 100644 --- a/server/configs/systemd/vasum.service.in +++ b/server/configs/systemd/vasum.service.in @@ -4,7 +4,7 @@ ConditionVirtualization=no [Service] Type=simple -ExecStart=${CMAKE_INSTALL_PREFIX}/bin/vasum-server +ExecStart=${CMAKE_INSTALL_PREFIX}/bin/vasum-server -r Restart=on-failure ExecReload=/bin/kill -HUP $MAINPID