From dbab83d9d79b824f5df22055b659ee63a3201e0e Mon Sep 17 00:00:00 2001 From: youngman Date: Tue, 23 Feb 2016 07:25:53 +0900 Subject: [PATCH] Fix user (for tizen 2.x) Change-Id: I7e6d3c013bf19bbcd5cc0ff50525e8b9da95c259 Signed-off-by: youngman --- packaging/iotcon-old.service | 13 +++++++++++++ packaging/iotcon.spec | 10 ++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 packaging/iotcon-old.service diff --git a/packaging/iotcon-old.service b/packaging/iotcon-old.service new file mode 100644 index 0000000..d76f30c --- /dev/null +++ b/packaging/iotcon-old.service @@ -0,0 +1,13 @@ +[Unit] +Description=Tizen IoT Connectivity + +[Service] +Type=simple +ExecStart=/usr/bin/iotcon-daemon +Restart=always +User=system +Group=system +SmackProcessLabel=iotcon + +[Install] +WantedBy=multi-user.target diff --git a/packaging/iotcon.spec b/packaging/iotcon.spec index 4e11aae..21512a8 100644 --- a/packaging/iotcon.spec +++ b/packaging/iotcon.spec @@ -6,6 +6,7 @@ Group: Network & Connectivity/Service License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: %{name}.service +Source2: %{name}-old.service Source1001: %{name}.manifest Source1002: %{name}-old.manifest Source1003: %{name}-test-old.manifest @@ -26,7 +27,9 @@ BuildRequires: pkgconfig(cynara-creds-gdbus) %if "%{tizen}" == "2.3" BuildRequires: python-xml %endif +%if 0%{?tizen_version_major} >= 3 Requires(post): /usr/bin/getent, /usr/bin/useradd, /usr/bin/groupadd +%endif Requires(post): /sbin/ldconfig, /usr/bin/systemctl Requires(postun): /sbin/ldconfig, /usr/bin/systemctl @@ -59,9 +62,11 @@ Tizen IoT Connectivity Test Programs %setup -q chmod g-w %_sourcedir/* %if 0%{?tizen_version_major} < 3 +cp %{SOURCE2} ./%{name}.service cp %{SOURCE1002} ./%{name}.manifest cp %{SOURCE1003} ./%{name}-test.manifest %else +cp %{SOURCE1} ./%{name}.service cp %{SOURCE1001} ./%{name}.manifest cp %{SOURCE1001} ./%{name}-test.manifest %endif @@ -85,7 +90,7 @@ rm -rf %{buildroot} %make_install mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants -cp -af %{SOURCE1} %{buildroot}%{_unitdir}/ +cp -af %{name}.service %{buildroot}%{_unitdir}/ ln -s ../%{name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{name}.service %if 0%{?tizen_version_major} < 3 @@ -100,9 +105,10 @@ cp -af %{SOURCE1004} %{buildroot}%{_sysconfdir}/dbus-1/system.d/%{name}.conf %post - +%if 0%{?tizen_version_major} >= 3 getent group iotcon > /dev/null || groupadd -r iotcon getent passwd iotcon > /dev/null || useradd -r -g iotcon -d '/var/lib/empty' -s /sbin/nologin -c "iotcon daemon" iotcon +%endif systemctl daemon-reload if [ $1 == 1 ]; then -- 2.34.1