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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Try to put a full path for service:

su -c '/sbin/service xrdp start'
hke72Author Commented:
I tried that. No difference :(
I get xrdp is dead, but PID-file exists
sesman runs though!?
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
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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.
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'.

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!
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.