rc.local doesn't execute my line, but SSH does
Posted: Sat Nov 28, 2009 6:12 am
I have an application called fgs. In order to start it, I need to do the four following tasks:
(1) Log in as kresh (user who owns the fgs application)
(2) cd /home/kresh/fgs
(3) . setenv.sh (from inside /home/kresh/fgs)
(4) fgs start (from inside /home/kresh/fgs)
I want fgs to autostart, so I put the following line in rc.local:
But when I restart the server, fgs does not start. However, when I execute the above line as root:
fgs starts flawlessly.
I suspect it is a login problem, ie, rc.local fails at the su kresh part.
I have tried the following line as well:
Again, rc.local doesn't seem to execute that, but executing it after logged in as root succeeds.
What should I do? By the way, I'm using CentOS 4.2.
(1) Log in as kresh (user who owns the fgs application)
(2) cd /home/kresh/fgs
(3) . setenv.sh (from inside /home/kresh/fgs)
(4) fgs start (from inside /home/kresh/fgs)
I want fgs to autostart, so I put the following line in rc.local:
Code: Select all
su kresh -c "( cd /home/kresh/fgs/; . setenv.sh ; fgs start)"Code: Select all
[root@devserv ~]$ su kresh -c "( cd /home/kresh/fgs/; . setenv.sh ; fgs start)I suspect it is a login problem, ie, rc.local fails at the su kresh part.
I have tried the following line as well:
Code: Select all
sudo su kresh -c "( cd /home/kresh/fgs/; . setenv.sh ; fgs start)"What should I do? By the way, I'm using CentOS 4.2.