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

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?

share|improve this question
1  
Can you execute strace -f, its output might be useful. –  Thor Sep 7 '12 at 17:25

1 Answer 1

up vote 2 down vote accepted

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
share|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

 
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.