You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by cl...@apache.org on 2015/07/04 18:27:37 UTC

jena git commit: Added chdir $FUSEKI_HOME when running in an environment without start-stop-daemon. Added a chdir to original directory after starting fuseki. Fixes bug JENA-984

Repository: jena
Updated Branches:
  refs/heads/master 255416a86 -> d58c1a1ab


Added chdir $FUSEKI_HOME when running in an environment without start-stop-daemon.
Added a chdir to original directory after starting fuseki.
Fixes bug JENA-984


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/d58c1a1a
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/d58c1a1a
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/d58c1a1a

Branch: refs/heads/master
Commit: d58c1a1abc7dfb2a58ce5b8c04e176940fecbb9a
Parents: 255416a
Author: Claude Warren <cl...@apache.org>
Authored: Sat Jul 4 17:25:47 2015 +0100
Committer: Claude Warren <cl...@apache.org>
Committed: Sat Jul 4 17:25:47 2015 +0100

----------------------------------------------------------------------
 jena-fuseki2/apache-jena-fuseki/fuseki | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/d58c1a1a/jena-fuseki2/apache-jena-fuseki/fuseki
----------------------------------------------------------------------
diff --git a/jena-fuseki2/apache-jena-fuseki/fuseki b/jena-fuseki2/apache-jena-fuseki/fuseki
index 62c2f16..814433a 100755
--- a/jena-fuseki2/apache-jena-fuseki/fuseki
+++ b/jena-fuseki2/apache-jena-fuseki/fuseki
@@ -371,6 +371,8 @@ start() {
       rm -f "$FUSEKI_PID"
     fi
 
+    OLD_DIR=`pwd`
+    cd $FUSEKI_HOME
     if [ "$FUSEKI_USER" ]
     then
       touch "$FUSEKI_PID"
@@ -386,7 +388,8 @@ start() {
       disown $!
       echo $! > "$FUSEKI_PID"
     fi
-
+    cd $OLD_DIR
+    
     log_end_msg 0
     print_started
   fi


Re: jena git commit: Added chdir $FUSEKI_HOME when running in an environment without start-stop-daemon. Added a chdir to original directory after starting fuseki. Fixes bug JENA-984

Posted by Andy Seaborne <an...@apache.org>.
Comments:

1/
Needs to cope spaces in directory names as well.
cd "$FUSEKI_HOME"

2/
A safer shell idiom is to use a subshell envirionment:

( cd "$FUSEKI_HOME"
   .. do stuff ..
)

the change of working directory is limited to the subshell.

No need to have OLD_DIR.

	Andy

On 04/07/15 17:27, claude@apache.org wrote:
> Repository: jena
> Updated Branches:
>    refs/heads/master 255416a86 -> d58c1a1ab
>
>
> Added chdir $FUSEKI_HOME when running in an environment without start-stop-daemon.
> Added a chdir to original directory after starting fuseki.
> Fixes bug JENA-984
>
>
> Project: http://git-wip-us.apache.org/repos/asf/jena/repo
> Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/d58c1a1a
> Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/d58c1a1a
> Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/d58c1a1a
>
> Branch: refs/heads/master
> Commit: d58c1a1abc7dfb2a58ce5b8c04e176940fecbb9a
> Parents: 255416a
> Author: Claude Warren <cl...@apache.org>
> Authored: Sat Jul 4 17:25:47 2015 +0100
> Committer: Claude Warren <cl...@apache.org>
> Committed: Sat Jul 4 17:25:47 2015 +0100
>
> ----------------------------------------------------------------------
>   jena-fuseki2/apache-jena-fuseki/fuseki | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/jena/blob/d58c1a1a/jena-fuseki2/apache-jena-fuseki/fuseki
> ----------------------------------------------------------------------
> diff --git a/jena-fuseki2/apache-jena-fuseki/fuseki b/jena-fuseki2/apache-jena-fuseki/fuseki
> index 62c2f16..814433a 100755
> --- a/jena-fuseki2/apache-jena-fuseki/fuseki
> +++ b/jena-fuseki2/apache-jena-fuseki/fuseki
> @@ -371,6 +371,8 @@ start() {
>         rm -f "$FUSEKI_PID"
>       fi
>
> +    OLD_DIR=`pwd`
> +    cd $FUSEKI_HOME
>       if [ "$FUSEKI_USER" ]
>       then
>         touch "$FUSEKI_PID"
> @@ -386,7 +388,8 @@ start() {
>         disown $!
>         echo $! > "$FUSEKI_PID"
>       fi
> -
> +    cd $OLD_DIR
> +
>       log_end_msg 0
>       print_started
>     fi
>