[ 
https://issues.apache.org/jira/browse/JENA-1735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16890440#comment-16890440
 ] 

Colin Gross commented on JENA-1735:
-----------------------------------

[~andy.seaborne] thanks for the quick turn around in responding to this issue.  
Allow me to explain a bit more about this issue.

Downloading and running fuseki server requires running it from either the 
directory installed e.g. `./fuseki-server --mem --update /ds > fuseki.out 
2>&1`, or using the path to the directory it was installed in, e.g. 
`/path/to/fuseki-server --mem --update /ds > fuseki.out 2>&1`.  In either event 
`fuseki-server` is not available on the PATH.

To add it to the PATH, a common practice is to add a symlink in /usr/bin or 
/usr/local/bin that points to wherever it was installed 
(/opt/fuseki/fuseki-version).  In this way, updating the version just involves 
upacking a new archive and updating a symlink.  Using Debian alternatives is a 
similar situation.

Currently, if you attempt to run fuseki-server via a symlink, you'll get the 
error: "Can't find jarfile to run"  This is because it's referencing the jar 
based off of FUSEKI_HOME, which if not specified, is $PWD.  When calling via a 
symlink, $PWD is going to be whatever the current working directory is.  It's 
not going to be the directory in which the jar files are located.

To solve this, the script needs to recognize when it's being called from a 
symlink and resolve that.  The resolved non-link path should be where the 
script actually resides along with the jars.

> Allow symlinking to fuseki-server script
> ----------------------------------------
>
>                 Key: JENA-1735
>                 URL: https://issues.apache.org/jira/browse/JENA-1735
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: Fuseki
>    Affects Versions: Fuseki 2.5.0
>         Environment: Ubuntu 18.04 (bionic)
> Debian 9 (stretch)
>            Reporter: Colin Gross
>            Priority: Minor
>              Labels: easyfix
>   Original Estimate: 1h
>          Time Spent: 10m
>  Remaining Estimate: 50m
>
> Symlinking to executables or scripts from a PATH directory is a common 
> practice.  This is some sysadmins perfered method as it makes updating the 
> fuseki version just redirecting a symlink.
> This needs to run on both GNU and BSD based systems (e.g. OSX), so using 
> readlink is a tricky wicket.  It it doesn't behave the same on both, nor are 
> the meaning of the flags consistent between systems.
> Similar to issue JENA-1297



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to