From: José Bollo Date: Wed, 18 Feb 2015 15:42:28 +0000 (+0100) Subject: Creation of the user account for the SDK X-Git-Tag: submit/tizen_common/20150224.141123^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2937cff29fff0b56da7b08b7793f2a893130437f;p=sdk%2Ftarget%2Fsdbd.git Creation of the user account for the SDK This replace the previously hackish creation of the user handled by SDB for the SDK. The current implementation creates the user on need at installation time of SDB. If the user still exists, it is not recreated to avoid erasing of previously existing data. The group developer is also created. TODO: check that the group developer is needed. Change-Id: Ie2a1fae481ad7f89f8349aafa1d19f858b8a1313 Signed-off-by: José Bollo --- diff --git a/packaging/sdbd.spec b/packaging/sdbd.spec index 70a5f0d..700451e 100644 --- a/packaging/sdbd.spec +++ b/packaging/sdbd.spec @@ -47,11 +47,16 @@ mkdir -p %{buildroot}%{_prefix}/sbin install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/ -%post -mkdir -p /home/developer/.applications -chown -R developer:users /home/developer/ -chsmack -a "User" /home/developer/ -chsmack -a "User" /home/developer/.applications +%post +. %{_sysconfdir}/tizen-platform.conf +if ! getent passwd "${TZ_SDK_USER_NAME}" > /dev/null; then + rm -rf "${TZ_SDK_HOME}" + useradd -u 5100 -s /bin/false -m -d "${TZ_SDK_HOME}" "${TZ_SDK_USER_NAME}" + getent group developer > /dev/null || groupadd -g 5100 developer + for x in app_logging crash developer; do + usermod -a -G app_logging "${TZ_SDK_USER_NAME}" + done +fi %files %manifest sdbd.manifest