From: sung.goo.kim Date: Fri, 19 Feb 2016 06:40:44 +0000 (+0900) Subject: Fix user (root -> iotcon) X-Git-Tag: accepted/tizen/mobile/20160226.095911~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F59880%2F5;p=platform%2Fcore%2Fiot%2Fiotcon.git Fix user (root -> iotcon) Change-Id: I0018bdbf3c09b7211245d2be8520ae11f0657749 --- diff --git a/packaging/iotcon.service b/packaging/iotcon.service index 92b1622..5fbbb6e 100644 --- a/packaging/iotcon.service +++ b/packaging/iotcon.service @@ -5,6 +5,7 @@ Description=Tizen IoT Connectivity Type=simple ExecStart=/usr/bin/iotcon-daemon Restart=always +User=iotcon [Install] WantedBy=multi-user.target diff --git a/packaging/iotcon.spec b/packaging/iotcon.spec index 2102c7d..0e955c9 100644 --- a/packaging/iotcon.spec +++ b/packaging/iotcon.spec @@ -26,6 +26,7 @@ BuildRequires: pkgconfig(cynara-creds-gdbus) %if "%{tizen}" == "2.3" BuildRequires: python-xml %endif +Requires(post): /usr/bin/getent, /usr/bin/useradd, /usr/bin/groupadd Requires(post): /sbin/ldconfig, /usr/bin/systemctl Requires(postun): /sbin/ldconfig, /usr/bin/systemctl @@ -98,6 +99,10 @@ cp -af %{SOURCE1004} %{buildroot}%{_sysconfdir}/dbus-1/system.d/%{name}.conf %post + +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 + systemctl daemon-reload if [ $1 == 1 ]; then systemctl restart %{name}.service