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.

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 its 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/subsonic.sh

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 screens path. If i start it without su so that it will be running as root, then it will work.

edit:

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 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 at 17:05
    
Fair enough. Is there any reason not to just invoke screen with its absolute path? –  MadHatter Mar 14 at 17:29

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.