Remove warning on imaging 59/189359/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 17 Sep 2018 07:52:21 +0000 (10:52 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 17 Sep 2018 07:52:21 +0000 (10:52 +0300)
Change-Id: I9c7698b66ad422c6ebccd044fc4f46001613838a
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
packaging/swap-manager.spec

index 19a7b415d4570eba245ab40667b2fc9d17eaabd2..b3dc8d2eec9b3bac126e088cec9a0b75554297c8 100644 (file)
@@ -213,9 +213,14 @@ cd -
 mkdir -p %{TZ_SYS_ETC}
 touch %{TZ_SYS_ETC}/resourced_proc_exclude.ini
 
-# update units
-systemctl daemon-reload
-su - owner -c "systemctl --user daemon-reload"
+# Update systemd units if script called from target.
+#  "id -G" - helps to determine the current environment:
+#    0     - called from image creation process
+#    other - called form target
+if [[ "$(id -G)" != "0" ]]; then
+  systemctl daemon-reload
+  su - owner -c "systemctl --user daemon-reload"
+fi
 
 
 %files