Scheduled PSN downtime tomorrow in Back Page News

Startup script on osx?


4 replies to this topic - - - - -

#1 Powelly

    sanity/insanity

  • 1,012 posts
  • Joined: 02-January 04
  • Location: Manchester, UK

Posted 13 November 2007 - 18:06

Ive just got synergy working accross my mac and pc and now I'd like to get synergy starting when I start up the machines.

The pc bit is easy and already sorted but Im a bit stuck on the mac, ive had a look at the instuctions here but Im not getting anywhere when I try to follow the steps.

Basically I need the following to run each time the mac boots up

/Applications/Utilities/synergy-1.3.1/synergyc -f 192.168.2.5

Can anyone point me in the right direction?


#2 Kardona

    Neowinian

  • 48 posts
  • Joined: 12-October 07

Posted 24 November 2007 - 20:37

View PostPowelly, on Nov 13 2007, 12:06, said:

The pc bit is easy and already sorted but Im a bit stuck on the mac, ive had a look at the instuctions here but Im not getting anywhere when I try to follow the steps.
Scroll to 1. Create a System Level Startup Item on that page.

Open up Terminal. According to http://www.macdevcenter.com/pub/a/mac/2001...rminal_one.html "Mac OS X’s Terminal application... sits in your Utilities folder"

Follow the directions outlined i1. Create a System Level Startup Itemi>

Using a text editor, such as nano -- or just use your favorite graphicatext editorb>, create a filSynergyi> in the folder specified. Copy the contents as described on the page.

All you need to do is edit the following line in that file
run=(/usr/local/bin/synergyc -n $(hostname -s) -1 -f synergy-server)
by replacinsynergy-serveri> with that of your own (it seems to be 192.168.2.5 from what you pasted). so:
run=(/usr/local/bin/synergyc -n $(hostname -s) -1 -f 192.168.2.5)
Most likely /Applications/Utilities/synergy-1.3.1/synergyc (from the line you pasted) is symlinked to /usr/local/bin/synergyc -- so don't worry about that.

Then just follow the rest of the Mac OS X directions (onl1. Create a System Level Startup Itemi> is necessary) on the page. Including making the shell script executable (chmod +x Synergy -- or do it their way) and creating and modifying StartupParameters.plist. Then start Synergy via the script that you just created (./Synergy start -- or do it their way). When you reboot Synergy will start automatically.

Since Mac OS X doesn't use init, like traditional Unices. It is more complicated to configure executables to run on start up. If you were using another operating system like Linux or BSD you wouldn't have to create two files to be able to start things automatically -- In fact, BSD systems don't even require you to create a new file. You can just append a line similar to that you pasted to /etc/rc.local (of course you'd want to drop root privileges --in some way-- afterwards.)

#3 runninwideopen

    Resident One Post Wonder

  • 1 posts
  • Joined: 31-July 08

Posted 31 July 2008 - 02:24

hi, I am somewhat new to mac as well. I am running the synergy server on the mac. when I try to run my startup script, I get the following error: line 37: $1: unbound variable

I copied and pasted the script on the synergy autostart page, and changed the run line to:

run=(/usr/local/bin/synergys -f --/usr/local/bin/synergy.conf)

Line 37, which it is saying is the error is the RunService line:

RunService "$1"


Can anyone help me? I can manually start the synergy server script and run a windows pc as the client and everything works great. But I need to get the server script to auto start on the mac for the sake of the other people who use this computer. Thanks!


BTW, I am running OSx 10.5.4.

#4 Jiriki

    Neowinian

  • 2 posts
  • Joined: 10-November 01

Posted 07 November 2008 - 21:36

View Postrunninwideopen, on Jul 31 2008, 02:24, said:

hi, I am somewhat new to mac as well. I am running the synergy server on the mac. when I try to run my startup script, I get the following error: line 37: $1: unbound variable

I copied and pasted the script on the synergy autostart page, and changed the run line to:

run=(/usr/local/bin/synergys -f --/usr/local/bin/synergy.conf)

Line 37, which it is saying is the error is the RunService line:

RunService "$1"


Can anyone help me? I can manually start the synergy server script and run a windows pc as the client and everything works great. But I need to get the server script to auto start on the mac for the sake of the other people who use this computer. Thanks!


BTW, I am running OSx 10.5.4.

Change '/usr/local/bin/synergys' portion of the run line to match where you've copied the synergy folder. The notes on the site say "Copy it anywere" for OSX, but fail to mention that you have to modify the script to match. Since there is no installer per say for OSX you have to specify the path. Otherwise you will have to create the folder /local and /bin in teh /usr directory as they do not exist in OSX by default.

#5 Barney

    Debian Linux: I'm Loving It!

  • 12,748 posts
  • Joined: 30-August 03
  • Location: Williamsburg, Virginia

Posted 09 November 2008 - 12:32

old thread closed