Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
### BEGIN INIT INFO
# 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
### END INIT INFO
#
# chandler              This init.d script is used to start chandler.
#                       It basically just calls osafsrvctl.

# set environment variables
. /etc/default/chandler

# set local variables
RETVAL=$?
CHANDLER_HOME="/chandler"

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

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

1 Answer 1

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

 
discard

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.