diff --git a/doc/autostart.html b/doc/autostart.html index 9d0d7555..9a194ce2 100644 --- a/doc/autostart.html +++ b/doc/autostart.html @@ -98,28 +98,28 @@ in that order, before and instead of Default.
For a synergy client, add the following to the first file: -
+
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc [<options>] synergy-server-hostname
-
+
Of course, the path to synergyc depends on where you installed it
so adjust as necessary.
Add to the second file: -
+
/usr/bin/killall synergyc
sleep 1
-
+
And to the third file: -
+
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc [<options>] synergy-server-hostname
-
+
Note that <options>
must not include
-f or --no-daemon or
@@ -152,7 +152,316 @@ would add to the third file above.
-TBD +[By Tor Slettnes] +
++There are three different ways to automatically start Synergy +(client or server) on Mac OS X: +
++
+
+
+
+
+
+The text below describes how to implement a Synergy client using +the first two methods simultaneously. This way, Synergy is +always running, and the clipboard is available when someone is +logged in. A Mac OS X Synergy server setup will be quite similar. +
++1. Create a System Level Startup Item +
++
+ +#!/bin/sh +. /etc/rc.common + +run=(/usr/local/bin/synergyc -n $(hostname -s) -1 -f synergy-server) + +KeepAlive () +{ + proc=${1##*/} + + while [ -x "$1" ] + do + if ! ps axco command | grep -q "^${proc}\$" + then + "$@" + fi + + sleep 3 + done +} + +StartService () +{ + ConsoleMessage "Starting Synergy" + KeepAlive "${run[@]}" & +} + +StopService () +{ + return 0 +} + +RestartService () +{ + return 0 +} + +RunService "$1" + +
++ However, replace synergy-server with the actual + name or IP address of your Synergy server. +
++ Note that this scripts takes care not to start + Synergy if another instance is currently running. This + allows it to run in the background even when synergy is also + started independently, e.g. from the LoginWindow + application as described below. +
+ +{ + Description = "Synergy Client"; + Provides = ("synergy-client"); + Requires = "Network"; + OrderPreference = "None"; +} + +
+That's it! If you want to test this setup, you can run the +startup script as follow: +
++ + # /Library/StartupItems/Synergy/Synergy start + +
++Any errors, as well as output from Synergy, will be shown in +your terminal window. +
++Next time you reboot, Synergy should start automatically. +
++2. Run Synergy When a User Logs In +
++Each time a user successfully logs in via the console, the +LoginWindow application creates a unique session +cookie and stores it in the environment variable +$SECURITYSESSIONID. For copy and paste operations +to work, Synergy needs access to this environment variable. In +other words, Synergy needs to be launched (directly or +indirectly) via the LoginWindow application. +
++However, in order to kill any synergy processes started at the +system level (as described above), we need root access. Thus, +launching Synergy within the User's environment (e.g. via the +Startup Items tab in System Preferences -> Accounts) is not an +option that work in conjunction with the method above. +
++Fortunately, the LoginWindow application provides +a "hook" for running a custom program (as root, with the username provided as +the first and only argument) once a user has authenticated, but +before the user is logged in. +
++Unfortunately, only one such hook is available. If you have +already installed a Login Hook, you may need to add the text +from below to your existing script, rather than creating a new +one. +
++
+
+ This will either show the full path to a script or + executable file, or the text: + + The domain/default pair of (/Library/Preferences/com.apple.loginwindow, LoginHook) does not exist + + In the former case, you need to modify your existing script, + and/or create a "superscript" which in turn calls your + existing script plus the one we will create here. +
++ The rest of this text assumes that this item did not already + exist, and that we will create a new script. +
+
+
+ +#!/bin/sh +prog=(/usr/local/bin/synergyc -n $(hostname -s) --camp ip-address-of-server) + +### Stop any currently running Synergy client +killall ${prog[0]##*/} + +### Start the new client +exec "${prog[@]}" + +
+
+When running the Synergy client, you may need to use the IP +address of the Synergy server rather than its host name. +Specifically, unless you have listed the server in your +local /etc/hosts file or in your local NetInfo +database, name services (i.e. DNS) may not yet be available by the +time you log in after power-up. synergyc will +quit if it cannot resolve the server name. +
++(This is not an issue with the previous method, because the +StartupItems.plist file specifies that this +script should not be run until "network" is available). +
++3. Good Luck! +
++Remember to look in your system log on both your server and your +client(s) for clues to any problems you may have +(/var/log/system.log on your OS X box, typically +/var/log/syslog on Linux boxes).