xrdp will not start from script (Fedora 11)

I have computers meant for classrooms. I am sending them away and therefore want xrdp to work perfectly.

My problem is that using a script writing "su -c 'service xrdp start'" does not start the service, but if I log in as root and then write "service xrdp start" it starts.

I would prefer it if people could just run a script, write the root password and start the service.

What is the difference between running a script with su -c and actually logging in as su?
LVL 1
hke72Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

medveddCommented:
Try to put a full path for service:

su -c '/sbin/service xrdp start'
0
hke72Author Commented:
I tried that. No difference :(
I get xrdp is dead, but PID-file exists
sesman runs though!?
0
rkursemCommented:
It could be a missing X-server. Some programs need an X-display even though they are not really showing anything. xvfb solved these kind of problems for me.

Try http://en.wikipedia.org/wiki/Xvfb
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

hke72Author Commented:
But it seemes strange that a program is missing when the only difference between working and not is:
A: log in as su and write service xrdp restart - it works
B: Run a script with one line su -c 'service xrdp restart' - it does not work.
0
medveddCommented:
Found this on Ubuntu forum, but it'll probably work for Fedora too.
Put a little delay at the end of /etc/init.d/xrdp just before exit statement, for example,
'sleep 20'.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hke72Author Commented:
WOW :) Added sleep 3 and it worked like a charm :) Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.