0

I'm probably doing something remarkably stupid, but I can't figure out what.

Running Ubuntu Server 12.04 on a cloud host (Digital Ocean, if it matters). All shell scripts do absolutely nothing and just return immediately to the prompt, without error, warning or even a wag of the middle finger.

  • start-stop-daemons scripts will not run from command line with "./script-name", not just cron

  • execute bit is set

  • shell is /bin/bash

  • user is root

  • tried changing #!/bin/sh to #!/bin/bash

  • tried not using dash by dpkg-reconfigure dash

  • scripts are being parsed -- if I edit it to something illegal, I get errors

Running out of ideas...

Is there some reason I just wouldn't be seeing the output?

  • 1
    Can you execute strace -f, its output might be useful. – Thor Sep 7 '12 at 17:25
2

Try to debug the shell script, here is how

Put that after the #!/bin/bash line

logfile=/tmp/script.log
exec > $logfile 2>&1

then execute the script with this command from shell prompt.

# bash -x script-name.sh 

See what happens next, check to see if the commands written in script are getting executed.

Also double check the path using this commnad.

echo $PATH
|improve this answer|||||
  • Thank you! That did it. My binaries had somehow migrated from /usr/local/bin to /usr/bin and all the scripts just happened to be failing without warning. – Greg Sep 7 '12 at 17:50

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.