You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "metatech (JIRA)" <ji...@apache.org> on 2014/11/12 14:42:33 UTC

[jira] [Commented] (ZOOKEEPER-2078) zkServer.sh uses pattern unsupported by "grep" on Solaris

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

metatech commented on ZOOKEEPER-2078:
-------------------------------------

A second problem under Solaris is that the following command
{code}
/bin/echo -n 999 > mypid.txt
{code}
will write "-n 999" into the "mypid.txt" file.

When issuing a "zkServer.sh stop", the following message is displayed :
{code}
Stopping zookeeper ... bin/zkServer.sh: line 145: kill: 24152: invalid signal specification
{code}
But fortunately the "stop" is performed anyway, it is only a warning.

The following code writes only the PID in the file : 
{code}
echo -n 999 > mypid.txt
{code}


> zkServer.sh uses pattern unsupported by "grep" on Solaris
> ---------------------------------------------------------
>
>                 Key: ZOOKEEPER-2078
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2078
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.4.5
>         Environment: Solaris 11
>            Reporter: metatech
>            Priority: Minor
>
> The script "zkServer.sh" contains a pattern (POSIX "character class syntax") which is not supported by "grep" on Solaris (both versions 10 and 11).
> {code}
> ZOO_DATADIR="$(grep "^[[:space:]]*dataDir" "$ZOOCFG" | sed -e 's/.*=//')"
> {code}
> This results into the environment variable being set with an empty value, which later gives the following error : 
> {code}
> Starting zookeeper ... bin/zkServer.sh: line 114: /zookeeper_server.pid: Permission denied
> {code}
> The workaround is to simplify the pattern used by "grep" :
> {code}
> ZOO_DATADIR="$(grep "^dataDir" "$ZOOCFG" | sed -e 's/.*=//')"
> {code}
> The same pattern is also used in the "status" command, which fails to read the "clientPort", which results into the following error :
> {code}
> Error contacting service. It is probably not running.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)