Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Since the update of the System on my Synology NAS (x86), I have some problems with my startup scripts.

The Bash scripts are stored in /usr/local/etc/rc.d. The scripts were executed for sure, because I have a Server running on root and it's starting without any problems.

But my other server executables doesn't start properly if I put them in the "su" command to start it with another user.

The commands that are executed in the scripts are following:

su admin -c /volume1/homes/admin/subsonic/

The Bash script is running without any problems, but the script starts java with the specific commands and there it can't find the path of java.

su admin -c "screen -dmS ncdc ncdc"

On this line the problem is that the system can't find screen's path. If I start it without su so that it will be running as root, then it works.


If I start the command with a minus, then I also get this behaviour:

root@schreda-NAS:~ # su - admin -c "screen -dmS test test"
-bash: screen: command not found

The path value will be set by /etc/profile. I don't override the path on ~/.bash_profile

share|improve this question
Have you tried inheriting admin's environment, with su - admin -c "screen yadda yadda"? – MadHatter Mar 14 '14 at 17:01
sure. but with the minus (-) it doesn't work even if the system is running and i start it manualy via ssh. then i get: root@schreda-NAS:~ # su - admin -c "screen -dmS test test" -bash: screen: command not found – schreda Mar 14 '14 at 17:05
Fair enough. Is there any reason not to just invoke screen with its absolute path? – MadHatter Mar 14 '14 at 17:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.