migration to scm service

54 views
Skip to first unread message

Jose Tabisi

unread,
Jul 4, 2017, 3:08:47 PM7/4/17
to scmmanager
I have been using SCM Manager for a couple of weeks now on an Ubuntu 14.04 server. Initial installation was done downloading the tar file from SCM Manager download page and worked fine. I had some issues automating the start of the service so I decided to try the .deb installation by following the instructions on the wiki page.

DEB


The DEB package is tested with Debian and Ubuntu. Execute the following commands to install scm-server:

# add the scm-manager repository
echo "echo 'deb http://maven.scm-manager.org/nexus/content/repositories/releases ./' >> /etc/apt/sources.list" | sudo sh

# install gpg key for the scm-manager repository
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 D742B261

# update
sudo apt-get update

# install scm-server
sudo apt-get install scm-server
 

Migration from ApplicationServer or Standalone version


To migrate from an existing installation, you have to the following steps:

  • Stop the old service
  • Move the folder /opt/scm-server, if it exists
  • Install the package
  • Copy the content of your existing scm home directory to /var/lib/scm
  • Change the owner of the directory and all containing files to scm:scm (chown -R scm:scm /var/lib/scm)
  • Verify repositoryDirectory in /var/lib/scm/config/[git|hg|svn].xml], make sure they point to respective /var/lib/scm/repositories/[git|hg|svn] and not your old location. Otherwise the repository health check will fail.
  • Optional: Reapply changes to /opt/scm-server/conf/server-config.xml and /opt/scm-server/conf/logging.xml
  • Start scm-server (/etc/init.d/scm-server start)

I think I have followed all the steps but it does not work.


On the /var/log/scm folder there are two files, scm-server.out which is empty, and scm-server.err which has many lines repeating Service killed by signal 11.


What am I missing ?


Thanks.

Jose Tabisi

unread,
Jul 5, 2017, 8:26:51 AM7/5/17
to scmmanager
Ok. Further information  to help troubleshoot the problem, I would aprecciate it if you could give me a hand.

If I run sh /opt/scm-server/bin/scm-server the server does start and behaves normally.

However if I run /etc/init.d/scm-server start, I get : SCM-Server will now be started

root@ubuntu14:~# sudo service scm-server status
SCM-Server is running
 PID: 8571

So it looks like the service should be running, but actually it does not, or at least I can not connect to it from the svn clients or the the admin web page.

This is the /etc/init.d/scm-server script (I did not edit it). It belongs to root:root

---------------------------------
#!/bin/sh

#
# SCM-Server start script
#

#
# Copyright (c) 2010, Sebastian Sdorra
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#    this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution.
# 3. Neither the name of SCM-Manager; nor the names of its
#    contributors may be used to endorse or promote products derived from this
#    software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# http://bitbucket.org/sdorra/scm-manager
#

# chkconfig: 35 35 65
# description: SCM-Server
#
### BEGIN INIT INFO
# Provides:       scm-server
# Required-Start: $local_fs $remote_fs $network $time $named
# Required-Stop:  $local_fs $remote_fs $network $time $named
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description:    SCM-Server
### END INIT INFO

# start script is based on the one posted from JavaNode to SCM-Manager mailing
# list: https://groups.google.com/d/msg/scmmanager/-wNjenUbl0Q/CkELJ6fLMHsJ


# Source function library.
if [ -x /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi

# Check for and source configuration file otherwise set defaults
RETVAL=0

appname=ScmServerDaemon

# See how we were called.
start() {
    if [ $(ps aux | grep java | grep ${appname} | wc -l) = 0 ]
    then
          echo "SCM-Server will now be started"
          /opt/scm-server/bin/scm-server start
    else
          echo "SCM-Server already running"
          status
    fi
}

stop() {
    if [ ! $(ps aux | grep java | grep ${appname} | wc -l) = 0 ]
    then
          echo "SCM-Server will now be stopped"
          /opt/scm-server/bin/scm-server stop
    else
          echo "SCM-Server is not running"
    fi
}

status() {
    if [ "$(ps auxwww | grep java | grep ${appname} | awk '{ print $1 " PID:" $2
 }')" ]; then
          echo "SCM-Server is running"
          ps auxwww | grep java | grep ${appname} | awk '{ print " PID: " $2 }'
    else
          echo "SCM-Server is not running"
    fi
}

restart() {
    stop
    SECONDS=0
    STAT=$( ps auxwww | grep  java | grep ${appname} |  wc -l )
    while [ $STAT -ne 0 ]
    do
      echo -n .
      sleep 3
        if [ $SECONDS -gt 300 ]
        then
          SCM_PID=$( ps auxwww | grep  java | grep ${appname} | awk '{ print $2
}' )
          kill -9 $SCM_PID
        fi
      STAT=$( ps auxwww | grep  java | grep ${appname} |  wc -l )
    done
    status
    start
    status
}

# See how we were called.

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  status)
        status
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $RETVAL

-------------------------

I suspect a permissions issue but I do not know where to look.

Thanks.

Sebastian Sdorra

unread,
Jul 6, 2017, 4:12:37 AM7/6/17
to scmma...@googlegroups.com
Do you see any logs at /var/log/scm?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jose Tabisi

unread,
Jul 6, 2017, 6:52:35 AM7/6/17
to scmmanager
Hi Sebastian,

After following the wiki instructions, there where two files created at /var/log/scm, one named scm-server.out which is actually empty, and another file named scm-server.err. This one has only one line saying "Service killed by signal 11" repeated many times. It looks as if the service starts and then something stops it and writes this line.

After I run the script directly # sh /opt/scm-server/bin/scm-server, the server started, /var/log/scm-manager.log was created and everything is back to normal behaviour.

What I hope to get is a way to automate the Scm server start since I am the administrator of the server and it is not easy to teach someone else to do it, specially because I do not want to enable remote ssh to the server.

Please let me know what you think, I am curious to know why there´s no one else having this problem on this group.

Thanks.

Sebastian Sdorra

unread,
Jul 6, 2017, 12:15:10 PM7/6/17
to scmma...@googlegroups.com
Please check the permissions of the scm home folder (/var/lib/scm) and be sure all files are owned by the scm user. In the case that the permissions are not the problem, please have a look at issue #930, perhaps your problem is related.


Sebastian

--
Message has been deleted

Jose Tabisi

unread,
Jul 6, 2017, 1:48:23 PM7/6/17
to scmmanager
Glad to hear I am not alone.

Permissions are fine, I did run chown scm:scm, from ls -l /var/lib

drwxr-xr-x 7 scm     scm     4096 jul  4 10:50 scm

# ls -l /var/lib/scm gives

total 20
drwxr-xr-x  2 scm scm 4096 jul  4 11:30 config
drwxr-xr-x  3 scm scm 4096 jun 27 15:27 lib
drwxr-xr-x  2 scm scm 4096 jun 27 15:27 logs
drwxr-xr-x 11 scm scm 4096 jun 28 07:54 plugins
drwxr-xr-x  5 scm scm 4096 jun 28 14:19 repositories

Regarding issue # 930, in case it means anything to you:

jose@ubuntu14:~$ uname -a
Linux ubuntu14 4.4.0-81-generic #104~14.04.1-Ubuntu SMP Wed Jun 14 12:45:52 UTC
2017 x86_64 x86_64 x86_64 GNU/Linux

I tried sudo apt-get update && sudo apt-get upgrade but the problem remains.

It looks like I should try to upgrade to 4.4.0-83 but I am not sure how, maybe I will try a dist-upgrade after backing up.

Thanks.

Regards

José

Jose Tabisi

unread,
Jul 7, 2017, 7:25:35 AM7/7/17
to scmmanager
Ok, this is how I did it.

$ sudo apt-get install linux-generic-lts-xenial

This upgrades the kernel to 4.4.0-83.

$ uname -a
Linux ubuntu14 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC

2017 x86_64 x86_64 x86_64 GNU/Linux

This let me start the server from the /etc/init.d/scm-server script but did not start automatically. To register it I had to run:


$ sudo update-rc.d scm-server defaults

Now it is working automatically.

Thanks


Reply all
Reply to author
Forward
0 new messages