Have a Chandler install that worked fine for a number of months, but recently when I went to connect to the server, I noticed it wasn't running.

SSHing in, confirmed it isn't running, so I go to manually restart via my chandler startup script (/etc/init.d/chandler) that worked perfectly for months and months through various reboots, etc and I get the following error:

/chandler/bin/osafsrvctl: 24: Syntax error: "(" unexpected

Now, if I go directly to /chandler/bin/osafsrvctl an run the following as root /chandler/bin/osafsrvctl start, it starts without error.

Some searching online led me to believe this is something to do with Chandler needing /bin/bash to start properly as the startup script is Bash. Fine. Check the /chandler/bin/osafsrvctl file and it is indeed using /bin/bash. Changing the init.d startup script to also use /bin/bash did nothing, get the same error. Here is the /etc/init.d/chandler script that generates the error:

#!/bin/sh -e
# Provides:          chandler
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop chandler server
# chandler              This init.d script is used to start chandler.
#                       It basically just calls osafsrvctl.

# set environment variables
. /etc/default/chandler

# set local variables

# check input
case "$1" in
        if [ -f $CHANDLER_HOME/bin/osafsrvctl ];
                /bin/su chandler $CHANDLER_HOME/bin/osafsrvctl start
        if [ -f $CHANDLER_HOME/bin/osafsrvctl ];
                /bin/su chandler $CHANDLER_HOME/bin/osafsrvctl stop
        echo "Usage: /etc/init.d/osafsrvctl {start|stop}"
        exit 1

exit $RETVAL

Keep in mind that the above worked fine until some point where they didn't - no idea what has changed and why this is as it is now.

Any ideas?

  • Is /chandler/bin/osafsrvctl a shell script? And if so, post the its content. – quanta Sep 21 '11 at 3:39

If this script runs with /bin/bash, check that the symlink /bin/sh is poiting to /bin/bash and not another shell (/bin/dash for instance). I had a similar problem transfering a bash script from an old Debian system to a newer one.

Try to change the first line by #!/bin/bash -e.

  • That did it... sh was linked to dash, changed it to bash, must have happened when I recently did a dist-upgrade, thanks! – Paul Mennega Sep 23 '11 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.