Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
root@mountain-lion:/opt/smartfox# ls -lha
total 180K
drwxr-xr-x 8 root root 4.0K 2012-06-01 14:09 .
drwxr-xr-x 4 root root 4.0K 2012-06-01 09:41 ..
drwxr-xr-x 8 root root 4.0K 2009-05-17 21:57 lib
lrwxrwxrwx 1 root root   22 2012-06-01 09:41 logs -> /var/opt/smartfox/logs
-rwxr-xr-x 1 root root 1.4K 2012-06-01 14:28

root@mountain-lion:/opt/smartfox# cat 
java -cp "./:./sfsExtensions/:lib/activation.jar:lib/commons-beanutils.jar:lib/commons-collections-3.2.jar:lib/commons-dbcp-1.2.1.jar:lib/commons-lang-2.3.jar:lib/commons-logging-1.1.jar:lib/commons-pool-1.2.jar:lib/concurrent.jar:lib/ezmorph-1.0.3.jar:lib/h2.jar:lib/js.jar:lib/json-lib-2.1-jdk15.jar:lib/json.jar:lib/jsr173_1.0_api.jar:lib/jysfs.jar:lib/jython.jar:lib/nanoxml-2.2.1.jar:lib/wrapper.jar:lib/xbean.jar:lib/javamail/imap.jar:lib/javamail/mailapi.jar:lib/javamail/pop3.jar:lib/javamail/smtp.jar:lib/jetty/jetty.jar:lib/jetty/jetty-util.jar:lib/jetty/jstl.jar:lib/jetty/multipartrequest.jar:lib/jetty/servlet-api.jar:lib/jetty/standard.jar:lib/jsp-2.1/commons-el-1.0.jar:lib/jsp-2.1/core-3.1.0.jar:lib/jsp-2.1/jsp-2.1.jar:lib/jsp-2.1/jsp-api-2.1.jar:lib/jsp-2.1/jstl.jar:lib/jsp-2.1/standard.jar:lib/lsc.jar:lib/commons-io-1.4.jar" \
it.gotoandplay.smartfoxserver.SmartFoxServer > logs/smartfox.out 2>&1 &
echo "Started Smartfox. JVM PID = $JAVAPID"
trap "echo Stopping Smartfox.; kill $JAVAPID" INT TERM
echo "Smartfox stopped."

root@mountain-lion:/opt/smartfox# start-stop-daemon --start --make-pidfile --pidfile /var/opt/smartfox/ --exec ./
start-stop-daemon: unable to start ./ (No such file or directory)

Why can't start-stop-daemon find the script?

share|improve this question

2 Answers 2

I find that it's better to avoid relative paths in starup scripts and the like. If things are getting confused, it's always best to be as explicit as possible - then you're not left guessing "I wonder what directory the process executing this script thinks is current".

This also goes for anything being run by cron. The environment cron is running under is different to the environment you are running in as a regular user.

share|improve this answer

Substituting ./ with pwd told me that it changes the directory to /. I suppose I need to change ./ into /opt/smartfox/ and update the script to set its own directory.

share|improve this answer

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.