On 2003.06.30 14:02, Ryan McDougall wrote:
Hello All,
FAH="/home/mcdougrs/folding/FAH3Console-LinuxB.exe"
.exe? On Linux?
su mcdougrs -c "$FAH >/dev/tty6 &"
I presume you have very good reason for (a) running a system process as yourself and (b) sending its output to /dev/tty6. Assuming that that is the case(*), then because you don't have permission to write to /dev/tty6, then this is clearly what is failing. This should work though:
su mcdougrs -c "$FAH" >/dev/tty6 2>&1 &
I've added a "2>&1" on the grounds that you probably want stderr redirected as well. Always trying to be vaguely helpful :-)
jch
(*) As someone else said, I don't like this idea. System processes should run as system users. It's OK to hack around like this for prototyping, but not for real systems. I prefer to use syslog() to do my logging, or have specially designed logging if syslog() isn't up to the job. If $FAH is supposed to run as a specific user rather than root, I would also be inclined to have it called setuid() near the beginning. And since you want it to run as a daemon, it might also be good to have it put itself in the background. As I said, your start up script is fine for prototyping and I assume that's what it's for, but it's rather inelegant and prone to failure for a production program.