FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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 .
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.
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.
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.
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.
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
# 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.
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.
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
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]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.