SCM file in running user's directory, scm-manager is not self-contained

1,508 views
Skip to first unread message

Guillem Liarte

unread,
Nov 19, 2013, 5:35:04 AM11/19/13
to scmma...@googlegroups.com
I have noticed that there is a number of files that scm created in my root directory:

/root
tree .scm/ -L 2

.scm/
|-- config
|   |-- config.xml
|   |-- git.xml
|   |-- hg.xml
|   |-- ldap.xml
|   |-- svn.xml
|   |-- users.xml
|   `-- version.txt
|-- lib
|   `-- python
|-- logs
|   `-- scm-manager.log
|-- plugins
|   |-- aopalliance
|   |-- classpath.xml
|   |-- com
|   |-- javax
|   |-- org
|   `-- sonia
`-- repositories
    |-- git
    |-- hg
    `-- svn

14 directories, 9 files

I do not like that at all. Application files belong to the application directories, should have nothing to do in a user's homedir. While this may be handy for captive installations where there is not access to root account, I would expect all this to go to the /opt/scm-manager.

As a workaround, it is possible to run the application as scm-manager user and set the user's home directory as /opt/scm-manager, but it will still be rather strange.

Is it possible to have an installation where all files are under /opt/scm-manager?

If the application is run by root, it will be inherently dangerous to have those file hanging in /root
If it is run by a normal user, it is still a problem with a split location for configuration and application files (plug-in, for example)

Is it possible to do either of this:

- have the files that exists in ~/.scm placed to /opt/scm-manager  ?
- have a new version that does not place files in the users' homedir?

Thanks.

Sebastian Sdorra

unread,
Nov 19, 2013, 5:54:25 AM11/19/13
to scmma...@googlegroups.com

Hi,
You can move the Scm home directory with a java system property or a environment variable. Please have a look at the faq. I'm currently on vacation, so answers from me could be rare in this week.

Sebastian

--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Guillem Liarte

unread,
Nov 19, 2013, 8:03:41 AM11/19/13
to scmma...@googlegroups.com
Sebastian,

Of the options given:

How can I change the SCM-Manager home directory?

You could change the SCM-Manager home directory in a few ways:

  • Edit the scm.properties (WEB-INF/classes) file and add the path to your folder f.e. scm.home=/var/scm
  • Set an environment variable SCM_HOME with the path of your directory
  • Start your application server with a java property called scm.home f.e. -Dscm.home=/var/scm

Only the highlighted one is desirable. Setting environmental variables would be a less bad way, but still more a hack than a solution. I will not comment about the third, not a good idea to override such thing s form the JVM, but I am not an expert.

I would say the only good manageable solution would be to set the configuration time at deploy time. However ...

... that file does not exist in my installation:

.
|-- bin
|   |-- scm-server
|   `-- scm-server.bat
|-- conf
|   |-- logging.xml
|   `-- server-config.xml
|-- lib
|   |-- commons-daemon-1.0.10.jar
|   |-- javax.servlet-2.5.0.v201103041518.jar
|   |-- jetty-ajp-7.6.13.v20130916.jar
|   |-- jetty-continuation-7.6.13.v20130916.jar
|   |-- jetty-http-7.6.13.v20130916.jar
|   |-- jetty-io-7.6.13.v20130916.jar
|   |-- jetty-jmx-7.6.13.v20130916.jar
|   |-- jetty-security-7.6.13.v20130916.jar
|   |-- jetty-server-7.6.13.v20130916.jar
|   |-- jetty-servlet-7.6.13.v20130916.jar
|   |-- jetty-util-7.6.13.v20130916.jar
|   |-- jetty-webapp-7.6.13.v20130916.jar
|   |-- jetty-xml-7.6.13.v20130916.jar
|   `-- scm-server-1.34.jar
|-- libexec
|   |-- jsvc-darwin
|   |-- jsvc-linux-i686
|   |-- jsvc-linux-x86_64
|   |-- jsvc-solaris-i386
|   |-- jsvc-solaris-x86_64
|   |-- prunmgr.exe
|   |-- prunsrv-amd64.exe
|   |-- prunsrv.exe
|   `-- prunsrv-ia64.exe
|-- README.txt
`-- var
    |-- log
    |   |-- scm-server.err
    |   `-- scm-server.out
    |-- scm-server.pid
    `-- webapp
        |-- docroot
        |   `-- index.html
        `-- scm-webapp.war

8 directories, 33 files

It does not exist anywhere in ~/.scm  nor /opt/scm-manager, I cannot find any directory named WEB-INF either. Anywhere.

This is as per the faq here:

https://bitbucket.org/sdorra/scm-manager/wiki/faq

If anybody knows the answer to this in Sebastian's absence, please let me know, and many thanks in advance.

G

Sebastian Sdorra

unread,
Nov 27, 2013, 8:48:00 AM11/27/13
to scmma...@googlegroups.com
Hi,
The scm.properties file is inside of the scm-webapp.war file and it is more an option for other application server (e.g. tomcat). You could also create a file at /etc/default/scm-server and set the SCM_HOME environment variable there.

Sebastian


2013/11/19 Guillem Liarte <guillem...@googlemail.com>

Carlos Alberto Costa Beppler

unread,
Feb 28, 2014, 1:42:31 PM2/28/14
to scmma...@googlegroups.com
Hello.

I´m having the same problem here using version 1.35 on Debian wheezy. 

I tried to create the file /etc/default/scm-server with the following content:

SCM_HOME="/opt/scm-server"
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

But the /root/.scm directory continues to be created.

My server is installet on /opt/scm-server.

Sebastian Sdorra

unread,
Mar 3, 2014, 2:15:59 AM3/3/14
to scmma...@googlegroups.com
Hi,
The file has to be executable.

Sebastian

Carlos Alberto Costa Beppler

unread,
Mar 5, 2014, 12:58:36 PM3/5/14
to scmma...@googlegroups.com
I granted the execute permission, but the problem persists.

ls -l /etc/default

total 80
-rw-r--r-- 1 root root  346 Apr 15  2013 acpid
-rw-r--r-- 1 root root  222 May 16  2012 bsdmainutils
-rw------- 1 root root  384 Jan 27  2013 cacerts
-rw-r--r-- 1 root root  285 Nov 11 14:15 console-setup
-rw-r--r-- 1 root root  955 Jul  3  2012 cron
-rw-r--r-- 1 root root  297 Jun 12  2013 dbus
-rw-r--r-- 1 root root   92 Oct 15  2012 devpts
-rw-r--r-- 1 root root 1203 Nov 11 17:14 grub
-rw-r--r-- 1 root root   86 Oct 15  2012 halt
-rw-r--r-- 1 root root  657 Dec 11  2012 hwclock
-rw-r--r-- 1 root root  150 Nov 11 14:15 keyboard
-rw-r--r-- 1 root root   74 Nov 11 14:14 locale
-rw-r--r-- 1 root root  306 Mar 14  2013 networking
-rw-r--r-- 1 root root 1756 Dec 30  2012 nss
-rw-r--r-- 1 root root  620 Nov 11 14:25 rcS
-rw-r--r-- 1 root root  152 Mar  5  2013 rsyslog
-rwxr-xr-x 1 root root   77 Feb 28 15:43 scm-server
-rw-r--r-- 1 root root  133 Feb  8  2013 ssh
-rw-r--r-- 1 root root 1115 Dec 17  2012 tmpfs
-rw-r--r-- 1 root root 1118 May 25  2012 useradd

Carlos Alberto Costa Beppler

unread,
Mar 5, 2014, 2:04:27 PM3/5/14
to scmma...@googlegroups.com
I managed to get it working.

I change my /etc/default/scm-server to this:

export SCM_HOME="/var/opt/scm-server"
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"

The it started to save the files on /var/opt/scm-server directory.
Reply all
Reply to author
Forward
0 new messages