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/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 screen
's path.
If I start it without su
so that it will be running as root, then it works.
UPDATE
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