WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: AutoStart rdesktop  (Read 2967 times)

Offline pktmobrien

  • Newbie
  • *
  • Posts: 1
AutoStart rdesktop
« on: May 29, 2014, 05:03:57 PM »
I've done as much googling as I can for one night.

I've succesfully installed TinyCore and installed the package rdesktop.

I am able to successfully launch rdesktop using the terminal.  command is as follows "rdesktop -f ComputerName -d DomainName -u UserName"

What I need is for this to automatically launch when TinyCore is loaded.

I've tried these methods.

1st
The directory for that purpose is hidden directly in your user folder, e.g. /home/tc/.X.d
Create a file in there called rdesktop and put in it a command like
while x=0
do
sleep 5
/usr/local/bin/rdesktop -f ComputerName -d DomainName -u UserName
done
Remember to make file executable with chmod

2nd
vi home/tc/.X.d/remote
+#!/bin/sh
+rdesktop -f ComputerName -d DomainName -u UserName

Remember to make file executable with chmod

Outcomes of tried options.
I've tried a few other methods that were more involved, but none of them work. Nothing happens or the files that I create are deleted upon reboot.

I'm using TinyCore 5.3 on a Wyse v90. TinyCore is the only OS on the onboard flash drive. One partition using ext4.

Any help?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: AutoStart rdesktop
« Reply #1 on: May 29, 2014, 05:22:37 PM »
You need to do a backup if you want the contents of /home/tc/.X.d to survive a reboot.
The files in .X.d are sourced, so they do not need to be executable.
Your rdesktop script is a loop without exit.
.xsession will never finish running.
You need the script to exit so that the while loop in .xsession can complete.
Change it to

(
while x=0
do
sleep 5
/usr/local/bin/rdesktop -f ComputerName -d DomainName -u UserName
done
) &

This assumes /usr/local/bin/rdesktop does not immediately return,
but returns only when the rdesktop connection is terminated.
If it does return immediagtely, that script will not work as it will continuously start rdesktop.