You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksandr (Jira)" <ji...@apache.org> on 2022/11/24 07:21:00 UTC

[jira] [Updated] (IGNITE-18238) Do not use readlink on start script

     [ https://issues.apache.org/jira/browse/IGNITE-18238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksandr updated IGNITE-18238:
-------------------------------
    Description: 
Some mac users could see this message on ./bin/ignite3db start 

readlink: illegal option -- f
usage: readlink [-n] [file ...]

which leads to the wrong IGNITE_HOME set. The reason is that the readlink on mac does not have a flag -f, it differs from vanilla readlink implementation. 

I propose not to use readlink at all.

  was:
Some mac users could see this message on ./bin/ignite3db start 

readlink: illegal option -- f
usage: readlink [-n] [file ...]

which leads to the wrong IGNITE_HOME set. The reason is that the readlink on mac does not have a flag -f, it differs from vanilla readlink implementation. 

I propose not to use readlink at all and do something like:


{code:java}
#!/bin/sh

TARGET_FILE=$1

cd `dirname $TARGET_FILE`
TARGET_FILE=`basename $TARGET_FILE`

# Iterate down a (possible) chain of symlinks
while [ -L "$TARGET_FILE" ]
do
    TARGET_FILE=`readlink $TARGET_FILE`
    cd `dirname $TARGET_FILE`
    TARGET_FILE=`basename $TARGET_FILE`
done

# Compute the canonicalized name by finding the physical path 
# for the directory we're in and appending the target file.
PHYS_DIR=`pwd -P`
RESULT=$PHYS_DIR/$TARGET_FILE
echo $RESULT
{code}



> Do not use readlink on start script
> -----------------------------------
>
>                 Key: IGNITE-18238
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18238
>             Project: Ignite
>          Issue Type: Bug
>          Components: build
>            Reporter: Aleksandr
>            Priority: Major
>              Labels: ignite-3
>
> Some mac users could see this message on ./bin/ignite3db start 
> readlink: illegal option -- f
> usage: readlink [-n] [file ...]
> which leads to the wrong IGNITE_HOME set. The reason is that the readlink on mac does not have a flag -f, it differs from vanilla readlink implementation. 
> I propose not to use readlink at all.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)