Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Is /chandler/bin/osafsrvctl a shell script? And if so, post the its content. – quanta Sep 21 '11 at 3:39
up vote 0 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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