use user scm to run scm-server for rpm package installations

This commit is contained in:
Sebastian Sdorra
2014-05-16 12:39:08 +02:00
parent 3a4e51b9a8
commit a5355cfefb
3 changed files with 18 additions and 6 deletions

View File

@@ -178,6 +178,7 @@
<executions>
<execution>
<goals>
<goal>deb</goal>
<goal>rpm</goal>
</goals>
<phase>package</phase>
@@ -197,6 +198,7 @@
<architecture>noarch</architecture>
<os>linux</os>
</platform>
<rpmPreInstallScript>${project.basedir}/src/main/nativepkg/rpm-create-user</rpmPreInstallScript>
<mappings>
<files>
<file>
@@ -245,10 +247,6 @@
</file>
</files>
<links>
<link>
<source>/usr/sbin/scm-server</source>
<target>/opt/scm-server/bin/scm-server</target>
</link>
<link>
<source>/opt/scm-server/var/log</source>
<target>/var/log/scm</target>
@@ -265,12 +263,21 @@
</directory>
<directory>
<path>/var/cache/scm/work</path>
<uname>scm</uname>
<gname>scm</gname>
<dirMode>0700</dirMode>
</directory>
<directory>
<path>/var/log/scm</path>
<uname>root</uname>
<gname>scm</gname>
<dirMode>0770</dirMode>
</directory>
<directory>
<path>/var/lib/scm</path>
<uname>scm</uname>
<gname>scm</gname>
<dirMode>0700</dirMode>
</directory>
</directories>
</mappings>

View File

@@ -33,10 +33,10 @@
PORT=8080
# change user
# USER=scm
USER=scm
# home of scm-manager
SCM_HOME=/var/lib/scm
export SCM_HOME=/var/lib/scm
# alternative jvm path
JAVA_HOME="/usr/lib/jvm/jre"

View File

@@ -0,0 +1,5 @@
getent group scm >/dev/null || groupadd -r scm
getent passwd scm >/dev/null || \
useradd -r -g scm -M -s /sbin/nologin \
-c "user for the scm-server process" scm
exit 0