Skip to content

Commit

Permalink
Change home directory variable for the new app user
Browse files Browse the repository at this point in the history
     - This is only done for RHEL6 - it will point to the virtualenv dir
     - For other distros the homedir will be /usr/share/ztpserver
  • Loading branch information
phil-dileo committed Jan 22, 2015
1 parent 0140dac commit 9674884
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpm/ztpserver.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
%global python2_sitearch %{app_virtualenv_dir}/lib64/python2.7
%global basedatadir %{_datadir}
%global basesysconfdir %{_sysconfdir}
%global apphomedir %{app_virtualenv_dir}
%else
%global httpd_dir %{_sysconfdir}/httpd/conf.d
%global apphomedir %{_datadir}/ztpserver
%endif

# We don't need the -debug package
Expand Down Expand Up @@ -124,7 +126,7 @@ python setup.py install --root=$RPM_BUILD_ROOT --install-scripts=%{_bindir} \
%pre
getent group %{app_user} > /dev/null || groupadd -r %{app_user}
getent passwd %{app_user} > /dev/null || \
useradd -m -g %{app_user} -d %{_datadir}/ztpserver/ -s /bin/false \
useradd -m -g %{app_user} -d %{apphomedir} -s /bin/false \
-c "%{name} - Server" %{app_user}
exit 0

Expand Down

0 comments on commit 9674884

Please sign in to comment.