LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-27-2004, 03:00 PM   #1
MCSquared
LQ Newbie
 
Registered: Nov 2002
Distribution: RedHat
Posts: 7

Rep: Reputation: 0
Question auto start a program in XFree on Fedora?


I'm using Syngery2, which allows sharing of mouse and keyboard over the network. I absolutely love this utility, however I don't know how to automatically start the client on my fedora box (which sort of defeats the whole purpose of putting the keyboard and mouse for that box aside and out of the way, since I have to use them to start synergy).

On Synergy's site, they advise adding the calls to /etc/X11/xdm/Xsetup to accomplish this, however no such file existed on my fedora box.

Here is everything I tried to make this work (and all of them failed):

- There was Xsetup_0, so I put the calls to synergyc in there, at the end of the file.

- I went ahead and created a new file called Xsetup, added #!/bin/sh
to the top of the file, and chmodding it to +x. Then I put the call to synergyc (client) in it.

- I created a symlink in /etc/rc.d/rc5.d/ to my new Xsetup program.

Each of these things failed, and I would try the next thing on the list.

So I'm out of ideas. Can anybody point me in the right direction here?
 
Old 03-28-2004, 05:33 AM   #2
LordMorgul
Member
 
Registered: Sep 2003
Location: Ca
Distribution: Fedora, RH 7.1-9.0
Posts: 68

Rep: Reputation: 15
To start programs when you login try adding a script to:
$HOME/Desktop/Autostart

You can call it 'default' or anything else, and it will execute when you desktop environment is started.

#!/bin/bash
synergy &

in the file may do what you want. If you need to program running before loggin in then you will need to complete the full init scripts method (adding a script to init.d) or use the quick hack method of adding it to /etc/rc.d/rc.local.
 
Old 03-28-2004, 11:43 AM   #3
MCSquared
LQ Newbie
 
Registered: Nov 2002
Distribution: RedHat
Posts: 7

Original Poster
Rep: Reputation: 0
synergyc must run under X windows - aren't the things you listed only for shell?
 
Old 03-28-2004, 04:57 PM   #4
LordMorgul
Member
 
Registered: Sep 2003
Location: Ca
Distribution: Fedora, RH 7.1-9.0
Posts: 68

Rep: Reputation: 15
I'm not sure what the program is (exactly) or requires (a link to the site describing installation / setup would be useful).

scripts placed in $HOME/Desktop/Autostart are run when you login to X, therefore they are not for terminals only (yes, the commands in the script are run in a shell when you login.. but they "run" on your X desktop.
 
Old 03-28-2004, 05:18 PM   #5
MCSquared
LQ Newbie
 
Registered: Nov 2002
Distribution: RedHat
Posts: 7

Original Poster
Rep: Reputation: 0
I actually want it to run before login, and I was under the impression that those other scripts don't run in an X session (though I realize I barely understand what I'm talking about in the first place .

Anyway, here is a link to the site for the utility in question:
http://synergy2.sourceforge.net/about.html
 
Old 03-29-2004, 06:06 PM   #6
RHELL
Member
 
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 31
You might try editing /etc/X11/gdm/gdm.conf (or substitute kdm if using KDE) that might correlate to what Synergy's talking about for your display manager.
Also possible is to place a script in /etc/X11/xinit/xinitrc.d to start your application.
 
Old 03-29-2004, 06:58 PM   #7
MCSquared
LQ Newbie
 
Registered: Nov 2002
Distribution: RedHat
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by RHELL
Also possible is to place a script in /etc/X11/xinit/xinitrc.d to start your application.
I wasn't sure what you were talking about with the first suggestion (as I'm a total newb) but I tried what is in the above quote, still no dice.
 
Old 03-30-2004, 11:07 AM   #8
RHELL
Member
 
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 31
Sorry for the smoke, I thought perhaps the equivalent of the /etc/X11/xdm/Xsetup might be:
/etc/X11/gdm/gdm.conf
or
/etc/X11/kdm/kdm.conf (if running kde as your window manager)
So, possibly, making the changes suggested by Synergy in this file instead MIGHT work.
xdm is really a failover, so it tends not to get used if one of the other display managers is there.
 
Old 03-30-2004, 07:59 PM   #9
MCSquared
LQ Newbie
 
Registered: Nov 2002
Distribution: RedHat
Posts: 7

Original Poster
Rep: Reputation: 0
Okay, I took a look at the conf file for gdm (kdm is not there) and it has a parameter for the session setup. The file lists xdm/Xsession as its startup script. I had actually already added the calls to synergy at the end of this file, but still no dice. Maybe something is buggy with syngergy being started this way. Hard to tell.
 
Old 04-02-2004, 09:47 AM   #10
jbandley
LQ Newbie
 
Registered: Apr 2004
Posts: 1

Rep: Reputation: 0
Have you found a solution

I am having the exact same problem. Have you found the solution to auto start synergys?

Thanks, JB
 
Old 04-02-2004, 03:36 PM   #11
dav7500
Member
 
Registered: Feb 2004
Posts: 45

Rep: Reputation: 15
I have the same issue for RH9. There is no $HOME/Desktop/Autostart directory to place the script into.

FYI, Synergy allows sharing keybd/ms over TCP/IP between networked computers.

Anyway, in RH, inserting the lines in the Xsetup file works for the logon portion. After you logon however, the program is terminated since I'm guessing a new session is started. So the question (for me anyway) is how to have the program start after logging in?

I also tried inserting the commands in Xsession but that didn't work.

Thanks!
 
Old 04-03-2004, 07:37 PM   #12
NickInTulsa
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
Here is what I did. I am by no means an expert at modifying these scripts, nor am I even slightly qualified to give advice about them. That said, Here is what I did.

(My Redhat8 system is using gdm for logins)
in /etc/X11/gdm/Init/Default
add the lines
Code:
# Starts synergyc for login purposes
/usr/bin/killall synergyc
sleep 2
/usr/bin/synergyc [your synergy host]
in /etc/X11/gdm/PreSession/Default
add the lines
Code:
# Kills the login's synergyc process
# so that the user's script can restart it
/usr/bin/killall synergyc
sleep 1
in /etc/X11/xdm/Xsession
add the lines
Code:
# Runs synergyc as the user
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc [your synergy host]
You don't need to worry about killing the user's synergyc process, because gdm runs as root and therefore has authority to kill it. The real trick here is that gdm (running as root) needs to start synergyc, then it needs to stop synergyc itself before any script tries to start synergyc (as a user). I had fits trying to get this to work before I put the "sleep 1" lines in there. Apparently these scripts run so quickly that I was restarting synergyc (user) before it was actually killed (root).

If anyone has a slicker, less-hackish solution, I would love to see it.

PS - If this doesn't work, be sure that you are adding these lines near the tops of the scripts. I was modifying the bottom of the scripts for over an hour before I figured out that they often exit before reaching the bottom.

Last edited by NickInTulsa; 04-04-2004 at 10:47 AM.
 
Old 04-05-2004, 09:26 AM   #13
dav7500
Member
 
Registered: Feb 2004
Posts: 45

Rep: Reputation: 15
It's working well now - thanks!

FYI
I skipped step one since I didn't have the "etc/X11/gdm/Init" directory.
I added step 2 to kill the process.
I already have step 3 but I added the sleep line and moved it to the top of the script instead of the bottom - I think that did the trick.
 
Old 05-03-2004, 08:46 PM   #14
bohda29
LQ Newbie
 
Registered: May 2004
Location: NJ
Distribution: SUSE 9
Posts: 1

Rep: Reputation: 0
Thumbs up Auto Starting Suse 9

I installed Synergy on SUSE 9 I got it working but could not figure out how to get it to auto start, after alot of research and trial and error I ended upon this thread, I did what NickInTulsa (post #12) said to do. The only thing I did was step 3 in his post and it works great !! Thanks so much Nick, being a total newbie myself, your step by step instructions and basic explanations for us wanna be using Linux so we can break the Windoze strong hold worked great.
Thanks
 
Old 05-04-2004, 10:54 PM   #15
jtglux
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
I'd also like to thank NickInTulsa for the great post. However, I'm running Red Hat 9 and the instructions didn't quite work.

The problem is that on RH9, the file /etc/X11/gdm/Init/Default is actually a symlink to /etc/X11/xdm/Xsetup_0. This means that /etc/X11/xdm/Xsetup_0 is actually the first thing that happens; it is what is run before the user logs in.

Once I figured that out, I edited that file and got synergy to start pre-login. I was able to log in but, as noted previously, the client would get killed immediately after login. I had to figure out where to restart it and eventually got it to work by editing /etc/X11/gdm/Sessions/Default for this purpose. Being a newbie myself, I'm not sure that this is the "right" place for it, but it works. I suppose it will probably only work when you login using the "Default" Session from the login screen (as opposed to directly choosing GNOME), but it works for how I log in.

So here's how I edited my files to get this to work on RH9 with a gdm login:

Near the top of /etc/X11/xdm/Xsetup_0
add the lines:

Code:
#Start synergyc for login purposes.
#It will be killed after login and restarted in user space.
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc [your synergy host]
Near the top of /etc/X11/gdm/PreSession/Default
add the lines:

Code:
#Kill the login's synergyc process
#so that the users's script can restart it.
/usr/bin/killall synergyc
sleep 1
Near the top of /etc/X11/gdm/Sessions/Default
add the lines:

Code:
#Runs synergyc as the user.
#This is to restart it after the user logs in.
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc [your synergy host]
Hope that helps anyone with RH9...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I auto start modules that aren't auto loaded on boot? darkbluedrew Debian 2 09-18-2005 09:10 AM
eth0 Auto Connect, How to auto start on logon cornish Linux - Networking 2 05-09-2005 12:02 PM
XFree wont start pairadice Linux - General 2 11-26-2004 03:42 PM
Auto start a program in GNOME 2.6 rusty0412 Linux - Newbie 1 05-23-2004 02:47 AM
auto start a program jrockey Linux - Newbie 1 05-26-2001 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration