Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M19
    • Fix Version/s: 2.0.0-M20
    • Component/s: core
    • Labels:
      None
    • Environment:
      Linux Ubuntu 14.04
      OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~trusty1)
      OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

      Description

      When I try to start ApacheDS, using the command sh apacheds.sh
      appears this message.
      Usage: apacheds.sh [<instance name>] <action>
      If <instance name> is ommited, 'default' will be used.
      <action> is one of start, stop.
      When I use sh apacheds.sh default this message appears
      apacheds.sh: 105: apacheds.sh: Syntax error: "(" unexpected (expecting ")")
      I downloaded apacheds-2.0.0-M19.tar.gz

      1. apacheds.sh
        8 kB
        Alvaro Feitais
      2. apacheds_sh.png
        58 kB
        Alvaro Feitais

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        Can you attach the apacheds.sh file ? The one we provide in M19 is only 47 lines long...

        Show
        elecharny Emmanuel Lecharny added a comment - Can you attach the apacheds.sh file ? The one we provide in M19 is only 47 lines long...
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Which OS are you running on, and which shell are you using ?

        The script line 105 is perfectly correct.

        Show
        elecharny Emmanuel Lecharny added a comment - Which OS are you running on, and which shell are you using ? The script line 105 is perfectly correct.
        Hide
        feitais Alvaro Feitais added a comment -

        Linux Ubuntu 14.04
        OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~trusty1)
        OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
        The terminal I use is the Linux default (bash)

        Show
        feitais Alvaro Feitais added a comment - Linux Ubuntu 14.04 OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~trusty1) OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode) The terminal I use is the Linux default (bash)
        Hide
        seelmann Stefan Seelmann added a comment -

        You start the scirpt using "sh apacheds.sh", and on Ubuntu the default sh is dash which probably doesn't support the expression in line 105. Can you try to start "./apacheds.sh"?

        Show
        seelmann Stefan Seelmann added a comment - You start the scirpt using "sh apacheds.sh", and on Ubuntu the default sh is dash which probably doesn't support the expression in line 105. Can you try to start "./apacheds.sh"?
        Hide
        feitais Alvaro Feitais added a comment -

        I used the command trhat you sugested and the error persisted.

        alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ ./apacheds.sh
        Usage: apacheds.sh [<instance name>] <action>
        If <instance name> is ommited, 'default' will be used.
        <action> is one of start, stop.
        alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ ./apacheds.sh default start
        ./apacheds.sh: 105: ./apacheds.sh: Syntax error: "(" unexpected (expecting ")")
        alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$

        Show
        feitais Alvaro Feitais added a comment - I used the command trhat you sugested and the error persisted. alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ ./apacheds.sh Usage: apacheds.sh [<instance name>] <action> If <instance name> is ommited, 'default' will be used. <action> is one of start, stop. alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ ./apacheds.sh default start ./apacheds.sh: 105: ./apacheds.sh: Syntax error: "(" unexpected (expecting ")") alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$
        Hide
        elecharny Emmanuel Lecharny added a comment -

        try with /bin/bash apacheds.sh.

        Show
        elecharny Emmanuel Lecharny added a comment - try with /bin/bash apacheds.sh .
        Hide
        feitais Alvaro Feitais added a comment -

        I tried the command that you suggested.
        The error changed.

        alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ /bin/bash apacheds.sh default start
        Using ADS_HOME: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19
        Using JAVA_HOME:

        Starting ApacheDS instance 'default'...
        apacheds.sh: line 150: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid: No such file or directory

        I navigated to that directorty. The directory was empty.

        Show
        feitais Alvaro Feitais added a comment - I tried the command that you suggested. The error changed. alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ /bin/bash apacheds.sh default start Using ADS_HOME: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19 Using JAVA_HOME: Starting ApacheDS instance 'default'... apacheds.sh: line 150: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid: No such file or directory I navigated to that directorty. The directory was empty.
        Hide
        elecharny Emmanuel Lecharny added a comment - - edited

        ok, can you now try witj /bin/bash -x apacheds.sh > logs.txt and attach the produced logs.txt file ?

        Show
        elecharny Emmanuel Lecharny added a comment - - edited ok, can you now try witj /bin/bash -x apacheds.sh > logs.txt and attach the produced logs.txt file ?
        Hide
        feitais Alvaro Feitais added a comment -

        This was the output from the console:

        alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ /bin/bash -x apacheds.sh default start > logs.txt
        ++ dirname apacheds.sh
        + PROGRAM_DIR=.
        + '[' -z '' ']'
        ++ cd ./..
        ++ pwd
        + ADS_HOME=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19
        + '[' -z /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19 ']'
        + HAVE_TTY=0
        ++ tty
        + '[' /dev/pts/3 '!=' 'not a tty' ']'
        + HAVE_TTY=1
        + cygwin=false
        + case "`uname`" in
        ++ uname
        + ADS_INSTANCE_NAME=
        + ADS_ACTION=
        + '[' 2 -eq 1 ']'
        + '[' 2 -eq 2 ']'
        + ADS_INSTANCE_NAME=default
        + ADS_ACTION=start
        + '[' -r /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/bin/setenv.sh ']'
        + false
        + '[' -z '' ']'
        + ADS_INSTANCES=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances
        + RUN_JAVA=
        + '[' -z '' ']'
        ++ which java
        + RUN_JAVA=/usr/bin/java
        ++ JARS=("$ADS_HOME"/lib/*.jar)
        ++ IFS=:
        ++ echo /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/lib/apacheds-service-2.0.0-M19.jar
        + CLASSPATH=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/lib/apacheds-service-2.0.0-M19.jar
        + ADS_INSTANCE=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default
        + ADS_OUT=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/log/apacheds.out
        + ADS_PID=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid
        + false
        + '[' -z '' ']'
        + ADS_CONTROLS=-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory
        + '[' -z '' ']'
        + ADS_EXTENDED_OPERATIONS=-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory
        + '[' 1 -eq 1 ']'
        + echo 'Using ADS_HOME: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19'
        + echo 'Using JAVA_HOME: '
        + echo ''
        + '[' start = start ']'
        + '[' 1 -eq 1 ']'
        + echo 'Starting ApacheDS instance '\''default'\''...'
        + '[' -f /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid ']'
        ++ cat /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid
        + PID=15360
        + kill -0 15360
        + eval '"/usr/bin/java"' -Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory -Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory '-Dlog4j.configuration="file:/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/conf/log4j.properties"' '-Dapacheds.log.dir="/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/log"' -classpath '"/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/lib/apacheds-service-2.0.0-M19.jar"' org.apache.directory.server.UberjarMain '"/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default"' '&'
        + echo 15392

        And that was printed inside the logs.txt:

        Using ADS_HOME: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19
        Using JAVA_HOME:

        Starting ApacheDS instance 'default'...

        Show
        feitais Alvaro Feitais added a comment - This was the output from the console: alvaro@dsi6164l:~/ambienteDSI/servidores/apacheds-2.0.0-M19/bin$ /bin/bash -x apacheds.sh default start > logs.txt ++ dirname apacheds.sh + PROGRAM_DIR=. + ' [' -z '' '] ' ++ cd ./.. ++ pwd + ADS_HOME=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19 + ' [' -z /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19 '] ' + HAVE_TTY=0 ++ tty + ' [' /dev/pts/3 '!=' 'not a tty' '] ' + HAVE_TTY=1 + cygwin=false + case "`uname`" in ++ uname + ADS_INSTANCE_NAME= + ADS_ACTION= + ' [' 2 -eq 1 '] ' + ' [' 2 -eq 2 '] ' + ADS_INSTANCE_NAME=default + ADS_ACTION=start + ' [' -r /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/bin/setenv.sh '] ' + false + ' [' -z '' '] ' + ADS_INSTANCES=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances + RUN_JAVA= + ' [' -z '' '] ' ++ which java + RUN_JAVA=/usr/bin/java ++ JARS=("$ADS_HOME"/lib/*.jar) ++ IFS=: ++ echo /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/lib/apacheds-service-2.0.0-M19.jar + CLASSPATH=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/lib/apacheds-service-2.0.0-M19.jar + ADS_INSTANCE=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default + ADS_OUT=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/log/apacheds.out + ADS_PID=/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid + false + ' [' -z '' '] ' + ADS_CONTROLS=-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory + ' [' -z '' '] ' + ADS_EXTENDED_OPERATIONS=-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory + ' [' 1 -eq 1 '] ' + echo 'Using ADS_HOME: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19' + echo 'Using JAVA_HOME: ' + echo '' + ' [' start = start '] ' + ' [' 1 -eq 1 '] ' + echo 'Starting ApacheDS instance '\''default'\''...' + ' [' -f /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid '] ' ++ cat /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/run/apacheds.pid + PID=15360 + kill -0 15360 + eval '"/usr/bin/java"' -Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory -Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory '-Dlog4j.configuration="file:/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/conf/log4j.properties"' '-Dapacheds.log.dir="/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default/log"' -classpath '"/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/lib/apacheds-service-2.0.0-M19.jar"' org.apache.directory.server.UberjarMain '"/home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19/instances/default"' '&' + echo 15392 And that was printed inside the logs.txt: Using ADS_HOME: /home/alvaro/ambienteDSI/servidores/apacheds-2.0.0-M19 Using JAVA_HOME: Starting ApacheDS instance 'default'...
        Hide
        elecharny Emmanuel Lecharny added a comment -

        At this point, I think the server has started, and you should be able to check that with :
        ps -eaf || grep 15392

        Also check if you can connect to the server using Studio.

        Last, not least, check the logs.

        Show
        elecharny Emmanuel Lecharny added a comment - At this point, I think the server has started, and you should be able to check that with : ps -eaf || grep 15392 Also check if you can connect to the server using Studio. Last, not least, check the logs.
        Hide
        feitais Alvaro Feitais added a comment -

        Ok.
        I could connect to the server using Studio.
        But, I think this is a workaround.

        Show
        feitais Alvaro Feitais added a comment - Ok. I could connect to the server using Studio. But, I think this is a workaround.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        This is not. Your server just work fine using /bin/bash apacheds.sh, which means, as Stefan suggested, that /bin/sh is pointing to some weird shell on your machine.You have three options here :

        • either you make /bin/bash the default bash
        • or you modify the apacheds.sh file to have /bin/bash on the first line instead of /bin/sh
        • or you use /bin/bash apacheds.sh to start the server
        Show
        elecharny Emmanuel Lecharny added a comment - This is not. Your server just work fine using /bin/bash apacheds.sh , which means, as Stefan suggested, that /bin/sh is pointing to some weird shell on your machine.You have three options here : either you make /bin/bash the default bash or you modify the apacheds.sh file to have /bin/bash on the first line instead of /bin/sh or you use /bin/bash apacheds.sh to start the server
        Hide
        elecharny Emmanuel Lecharny added a comment - - edited

        The user has a weird shell used.

        Show
        elecharny Emmanuel Lecharny added a comment - - edited The user has a weird shell used.
        Hide
        seelmann Stefan Seelmann added a comment -

        Changed shebang to bash: http://svn.apache.org/r1676058

        Show
        seelmann Stefan Seelmann added a comment - Changed shebang to bash: http://svn.apache.org/r1676058

          People

          • Assignee:
            seelmann Stefan Seelmann
            Reporter:
            feitais Alvaro Feitais
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development