Startup script on osx?


Recommended Posts

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?

Link to comment
https://www.neowin.net/forum/topic/600655-startup-script-on-osx/
Share on other sites

  • 2 weeks later...
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.)

  • 8 months later...

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.

  • 3 months later...
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.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • 2 was a fun game but felt a bit shallow, like not enough there. I hope this expansion fixes that.
    • I haven't paid for windows since windows 8. So I guess I would be happy to pay for a new version if it meant seeing fewer adverts (none) or product pushes. But that applies to _any_ service or OS.
    • Save 35% on Sony's SS-CS5M2 3-way high-res bookshelf speakers by Taras Buria Sony is currently offering a big discount on its SS-CS5M2 bookshelf speaker, saving you 35% on a set of high-quality audio equipment. The SS-CS5M2 is a passive 3-way bookshelf speaker with a 5.12-inch woofer, a 25 mm soft-dome tweeter, and a 19 mm super tweeter. This design allows different drivers to handle different parts of the sound spectrum for a clearer, more detailed audio when watching movies or listening to music. The compact cabinet size allows you to place these speakers on shelves, desks, or stands, making them a practical choice for apartments, bedrooms, and small living rooms. Despite its compact size, the SS-CS5M2 delivers up to 100 W of power. Note that since the speakers are passive, you will need an amplifier to drive them. However, if you do, you can use them for high-resolution music, thanks to a claimed frequency response of 53 Hz - 50 kHz. It is able to extend so far high in the spectrum as a result of those super tweeters. While they will work with most amplifiers and AV receivers, Sony says this pair is a perfect match for its AV receivers, such as STRDH190, 590, 790, or 1000. Sony CS Bookshelf Speakers SS-CS5M2 3-Way 3-Driver Hi-res - $178 | 36% off on Amazon US This Amazon deal is US-specific and not available in other regions unless specified. This is a first-party seller link (at the time of article publishing); ensure that you also purchase from a first-party seller link only. If you don't like it or want to look at more options, check out the previous deals that we have covered, OR you can also visit Amazon US deals page. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • So they somehow expect Apple to easily make it so that if I install say DeepSeek that DS can then handle all the tasks that Siri would be doing while integrated in the OS? That sounds like just rediculous.
  • Recent Achievements

    • Rookie
      lamborghiniv10 went up a rank
      Rookie
    • One Month Later
      pinnclepd earned a badge
      One Month Later
    • First Post
      X-No-file earned a badge
      First Post
    • One Month Later
      johnjacobb40 earned a badge
      One Month Later
    • One Year In
      Primer1st earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      510
    2. 2
      PsYcHoKiLLa
      214
    3. 3
      +Edouard
      145
    4. 4
      Steven P.
      88
    5. 5
      ATLien_0
      83
  • Tell a friend

    Love Neowin? Tell a friend!