Running SCM Server in background

Showing 1-25 of 25 messages
Running SCM Server in background Kamran Chohdry 7/5/11 8:03 AM
Hi,

Can anybody recommend a way to run scm server in background and on
restart if needed on centos?

Thanks
Re: Running SCM Server in background Sebastian Sdorra 7/5/11 8:13 AM
Hi,
You can use the start and stop parameter of the scm-server (not
available on windows) e.g. ./scm-server start. The start parameter
starts the scm-manager as unix daemon.

Sebastian

2011/7/5 Chohdry <cho...@gmail.com>:

Re: Running SCM Server in background Sebastian Sdorra 7/5/11 8:26 AM
Hi,
Sorry, I forgot the init script. Put a script like the following in
/etc/init.d/scmserver:

#!/bin/sh
# chkconfig: 2345 90 10
# description: SCM-Server

SCM_SERVER="/opt/scm-server/bin/scm-server"

start() {
  "$SCM_SERVER" start
}

stop() {
  "$SCM_SERVER" stop
}

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

Make it executable (chmod 755) and add it as centos service (chkconfig
--add scmserver).

Sebastian

2011/7/5 Sebastian Sdorra <s.sd...@gmail.com>:

Re: Running SCM Server in background Kamran Chohdry 7/7/11 3:47 PM
Hi Sebastian,

Thanks for detailed and prompt reply.
It was really helpful I was just missing a couple of things.
Specially was not aware of daemon mode with start command line param.

Only thing is that when I try running in daemon it comes back with following error?

/opt/scm-server/libexec/jsvc-linux-i686: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory

Do you think I might need to update to latest version?
Also this reminds me wiki is missing some update instructions / best practices.

Regards,
Kamran Chohdry
http://chohdry.com
unk...@googlegroups.com 7/7/11 3:49 PM <This message has been deleted.>
Re: Running SCM Server in background Sebastian Sdorra 7/7/11 10:59 PM
Hi,
Yes, you are right the wiki needs some updates. Which version of java
do you use Oracle/Sun or OpenJDK?

Sebastian

2011/7/8 Chohdry <cho...@gmail.com>:


> Hi Sebastian,
>
> Thanks for detailed and prompt reply.
> It was really helpful I was just missing a couple of things.
> Specially was not aware of daemon mode with start command line param.
>
> Only thing is that when I try running in daemon it comes back with
> following error?
>
> /opt/scm-server/libexec/jsvc-linux-i686: error while loading shared
> libraries: libcap.so.2: cannot open shared object file: No such file
> or directory
>
> Do you think I might need to update to latest version?
> Also this reminds me wiki is missing some update instructions / best
> practices.
>
> Thanks
> Chohdry>> 2011/7/5 Sebastian Sdorra <s.sdo...@gmail.com>:

>>
>>
>>
>>
>>
>>
>>
>> > Hi,
>> > You can use the start and stop parameter of the scm-server (not
>> > available on windows) e.g. ./scm-server start. The start parameter
>> > starts the scm-manager as unix daemon.
>>
>> > Sebastian
>>
>> > 2011/7/5 Chohdry <choh...@gmail.com>:

>> >> Hi,
>>
>> >> Can anybody recommend a way to run scm server in background and on
>> >> restart if needed on centos?
>>
>> >> Thanks

Re: Running SCM Server in background Sebastian Sdorra 7/8/11 12:58 AM
Hi,
Could you post the output of this command "ldd
scm-server/libexec/jsvc-linux-i686"?

Sebastian

2011/7/8 Sebastian Sdorra <s.sd...@gmail.com>:

Re: Running SCM Server in background Kamran Chohdry 7/8/11 4:52 AM
Hi Sebastian,

ldd comes back with
ldd: scm-server/libexec/jsvc-linux-i686: No such file or directory

Java is OpenJDK

java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.21.b17.el5-i386)
OpenJDK Client VM (build 14.0-b16, mixed mode)


Regards,
Kamran Chohdry
http://chohdry.com



Re: Running SCM Server in background Sebastian Sdorra 7/8/11 4:57 AM
Hi,
Could you please execute the ldd command with the full path to the
scm-server/libexec/jsvc-linux-i686
e.g.: ldd /opt/scm-server/libexec/jsvc-linux-i686

Sebastian

2011/7/8 Kamran Chohdry <cho...@gmail.com>:

Re: Running SCM Server in background Kamran Chohdry 7/8/11 4:58 AM
Hi Sebastian,

Sorry did not notice the path there

here is right one.

        libdl.so.2 => /lib/libdl.so.2 (0xb7fb4000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7f9c000)
        libcap.so.2 => not found
        libc.so.6 => /lib/libc.so.6 (0xb7e58000)
        /lib/ld-linux.so.2 (0xb7fbd000)



Regards,
Kamran Chohdry
http://chohdry.com



Re: Running SCM Server in background Sebastian Sdorra 7/8/11 5:02 AM
Hi,
Could you please replace the jsvc-linux-i686 file with this one
http://download.scm-manager.org/thread/fb03637a751b9744/jsvc-linux-i686
Re: Running SCM Server in background Kamran Chohdry 7/8/11 6:53 AM
Hi,

I replaced the file however after that trying to start scm-server resulted in error "can not locate Java Home"
Checking echo $JAVA_HOME came back with blank, so had to

export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export PATH=$PATH:$JAVA_HOME/bin

Also added above to my bash profile by going to following and appending the above two lines
vi $HOME/.bash_profile

Would you recommend adding this path anywhere else or is it good enough place to leave?


Regards,
Kamran Chohdry
http://chohdry.com



Re: Running SCM Server in background Sebastian Sdorra 7/8/11 12:17 PM
Hi,
You could place the JAVA_HOME variable in scm-server start-script, but
your solution with the .bash_profile is very good because you don't
have to change the start-script again after an update.
Re: Running SCM Server in background Kamran Chohdry 7/12/11 4:23 AM
Hi,

Thanks very much Sebastian for your help, works like a treat.


Regards,
Kamran Chohdry
http://chohdry.com



Re: Running SCM Server in background Garrett Johnson 7/27/11 1:43 PM
I'm having the same issue, but with the x86_64 version...

/opt/scm-server/libexec/jsvc-linux-x86_64: error while loading shared
libraries: libcap.so.2: cannot open shared object file: No such file
or directory

Do you have a replacement file for it too?


On Jul 8, 7:02 am, Sebastian Sdorra <s.sdo...@gmail.com> wrote:
> Hi,
> Could you please replace the jsvc-linux-i686 file with this onehttp://download.scm-manager.org/thread/fb03637a751b9744/jsvc-linux-i686
>
> Sebastian
>
> 2011/7/8 Kamran Chohdry <choh...@gmail.com>:
>
>
>
> > Hi Sebastian,
>
> > Sorry did not notice the path there
>
> > here is right one.
>
> >         libdl.so.2 => /lib/libdl.so.2 (0xb7fb4000)
> >         libpthread.so.0 => /lib/libpthread.so.0 (0xb7f9c000)
> >         libcap.so.2 => not found
> >         libc.so.6 => /lib/libc.so.6 (0xb7e58000)
> >         /lib/ld-linux.so.2 (0xb7fbd000)
>
> > Regards,
> > Kamran Chohdry
> >http://chohdry.com
>
> > On Fri, Jul 8, 2011 at 12:57, Sebastian Sdorra <s.sdo...@gmail.com> wrote:
>
> >> Hi,
> >> Could you please execute the ldd command with the full path to the
> >> scm-server/libexec/jsvc-linux-i686
> >> e.g.: ldd /opt/scm-server/libexec/jsvc-linux-i686
>
> >> Sebastian
>
> >> 2011/7/8 Kamran Chohdry <choh...@gmail.com>:
> >> > Hi Sebastian,
>
> >> > ldd comes back with
> >> > ldd: scm-server/libexec/jsvc-linux-i686: No such file or directory
>
> >> > Java is OpenJDK
>
> >> > java version "1.6.0_17"
> >> > OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.21.b17.el5-i386)
> >> > OpenJDK Client VM (build 14.0-b16, mixed mode)
>
> >> > Regards,
> >> > Kamran Chohdry
> >> >http://chohdry.com
>
> >> > On Fri, Jul 8, 2011 at 08:58, Sebastian Sdorra <s.sdo...@gmail.com>
> >> > wrote:
>
> >> >> Hi,
> >> >> Could you post the output of this command "ldd
> >> >> scm-server/libexec/jsvc-linux-i686"?
>
> >> >> Sebastian
>
> >> >> 2011/7/8 Sebastian Sdorra <s.sdo...@gmail.com>:
> >> >> > Hi,
> >> >> > Yes, you are right the wiki needs some updates. Which version of java
> >> >> > do you use Oracle/Sun or OpenJDK?
>
> >> >> > Sebastian
>
> >> >> > 2011/7/8 Chohdry <choh...@gmail.com>:
Re: Running SCM Server in background Sebastian Sdorra 7/28/11 2:32 AM
Hi,
You could test this file
http://download.scm-manager.org/thread/fb03637a751b9744/jsvc-linux-x86_64

Sebastian

2011/7/27 Garrett Johnson <garre...@gmail.com>:

Re: Running SCM Server in background Garrett Johnson 7/28/11 8:57 AM
Works good. Thank you for your help and this awesome piece of
software.

On Jul 28, 4:32 am, Sebastian Sdorra <s.sdo...@gmail.com> wrote:
> Hi,
> You could test this filehttp://download.scm-manager.org/thread/fb03637a751b9744/jsvc-linux-x8...
>
> Sebastian
>
> 2011/7/27 Garrett Johnson <garrettr...@gmail.com>:
Re: Running SCM Server in background Peter Nicolai 9/1/11 10:06 AM
I'm trying to use this script on Ubuntu using update-rc.d instead of chkconfig. Trying to start the service, even as root, fails with "Permission denied" at the last line of the script (the "esac"). Any ideas??


Re: Running SCM Server in background Peter Nicolai 9/1/11 12:17 PM
Never mind, typo in the script..
Re: Running SCM Server in background JavaNode 9/7/11 3:42 AM
Debian script.This is alternative solution if jsvc.exec doesn't work or you don't want to use it.
you have to create scmserver user first.

add this script to /etc/init.d/
and then
update-rc.d -f  scmadmin default - add it tu default run levels
update-rc.d -f  scmserver remove - remove from run levels

#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          scmserver
# Required-Start:    $remote_fs $syslog $network
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start scmserver at boot time
# Description:       Control Repositories
### END INIT INFO



# 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() {
    # Call the tomcat init script as our user
    /bin/su - scmserver -c "/opt/scm-server/bin/scm-server start >> /opt/scm-home/logs/scm-manager-output.log 2>&1 & "
}

stop() {
    if [ ! status = 0 ]
    then
          #SCM_PID=$( ps auxwww | grep  java | grep ${appname} | awk '{ print $2 }' )
          kill -9 $SCM_PID
    else
      echo "SCM is not running"
    fi
}

status() {
    ps auxwww | grep  java | grep ${appname} || echo "SCM is not running"
}

restart() {
    stop
    SECONDS=0
    STAT=$( ps auxwww | grep  java | grep ${appname} |  wc -l )
    while [ $STAT -ne 0 ]
    do
      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
    start
}

# 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

Re: Running SCM Server in background JavaNode 9/7/11 3:45 AM
btw why when I use /scm-server start it is running 2 processes ?
Re: Running SCM Server in background Sebastian Sdorra 9/7/11 3:57 AM
Yes, this correct. Have a look at the "How jsvc works" part of
http://commons.apache.org/daemon/jsvc.html

2011/9/7 JavaNode <yura....@gmail.com>:


> btw why when I use /scm-server start it is running 2 processes ?
>

Re: Running SCM Server in background Andrey Kozhyn 5/23/12 1:09 AM
So its not possible on windows?

среда, 7 сентября 2011 г., 13:57:41 UTC+3 пользователь Sebastian Sdorra написал:
Re: Running SCM Server in background Sebastian Sdorra 5/23/12 1:23 AM
Hi,
You could install scm-manager as windows serice. Execute the following
command as administrator:

scm-manager.bat install

After that you should be able to start and stop the service over the
windows service console.

Sebastian

2012/5/23 Andrey Kozhyn <hed...@gmail.com>:
Re: Running SCM Server in background John Yeuk Hon Wong 1/24/13 4:06 PM
Just an update for debian and ubuntu users.

You probably want to install these

and in your ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/jre
export PATH=$PATH:$JAVA_HOME/bin

I also suggest to just put it in /etc/environment
For certain deployment/configuration tool, they don't source your bashrc so it's better just add this one line to environment file directly.
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/jre
More topics »