Page 1 of 1

xrdp.sh error

Posted: Fri Sep 21, 2012 2:25 pm
by gromit4x4
Hi, I have installed xrdp via yum. I can start the service manually and it is working well but I want xrdp to run at boot

when I do:

Code: Select all

/sbin/chkconfig --add xrdp.sh
I get the message "error reading information on service xrdp.sh: Bad file descriptor"

Any ideas on how best to resolve this?
Thanks

Re: xrdp.sh error

Posted: Fri Sep 21, 2012 2:52 pm
by bigfoot65
chkcfg is only for init scripts. You will need to create a cron job to start it on boot.

Do this (may need to be root user):

Code: Select all

/usr/bin/crontab -l > apache-crontab;
Create a file called apache-crontab and add this text to it:
@reboot /path/to/xrdp.sh
Finally do this:

Code: Select all

/usr/bin/crontab apache-crontab; rm -rf apache-crontab;
This will ensure it starts on reboot.

Re: xrdp.sh error

Posted: Fri Sep 21, 2012 11:30 pm
by gromit4x4
Thanks Bigfoot, I was following the instructions from here:
http://www.xrdp.org/index.php?option=co ... s&Itemid=7

Te path of xrdp is: /etc/init.d/xrdp, to run I have to ssh to the HDA and then:

Code: Select all

su -c '/etc/init.d/xrdp start'
I will give your method a try, thanks again.
gromit.

Re: xrdp.sh error

Posted: Sat Sep 22, 2012 6:26 am
by bigfoot65
That's not what you indicated in your initial post. Since that is an init script, do this as root user:

Code: Select all

chkconfig xrdp on

Re: xrdp.sh error

Posted: Sat Sep 22, 2012 6:58 am
by gromit4x4
Thanks Bigfoot, that last code worked fine.

I didn't mean to confuse, perhaps I should of mentioned the path in the original post. Sorry.
I meant to say, to run manually I do

Code: Select all

su -c '/etc/init.d/xrdp start'
which works.

But when I try to run automatically at boot using

Code: Select all

/sbin/chkconfig --add xrdp.sh
I get the error

I still don't understand why

Code: Select all

/sbin/chkconfig --add xrdp.sh
did not work and gave the error.

Regards
gromit.

Re: xrdp.sh error

Posted: Sat Sep 22, 2012 7:18 am
by bigfoot65
No problem. When enabling an init script to start on boot, you only do as I instructed in the previous post.

There is no .sh on the end of the init script name. There is no need to run the script as

Code: Select all

su -c
as that is telling it to run as root. The chkconfig will do that automatically, so following the guidance I posted will be sufficient.