Other Starting synergy-core --client <server-ip> at boot.

freetobsd

New Member


Messages: 8

What is the best way to execute synergy-core --client <server-ip> at boot? I can run from the command line and it works perfect. I tried /etc/rc.local and I get command not found. I also tried a .sh file in /usr/local/etc/rc.d with the same result. I think I might just not understand how a pkg is executed?

Thanks
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,698
Messages: 30,639

Use the full path to the executable.

And regarding rc(8) scripts, look at the example at the end of rc(8).
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,698
Messages: 30,639

As it's a third-party application, most likely /usr/local/bin/ or /usr/local/sbin/. You can see which files are installed where by using pkg info -l <pkgname>. See pkg-info(8).
 

ralphbsz

Daemon

Reaction score: 1,169
Messages: 1,885

When running from the command line: "which synergy-core".

But beware: If that one executable is installed in /usr/local/..., and the path that is used when the rc scripts are running don't include /usr/local, then it is quite possible that synergy-core will start, and quickly fail: It may need to find other things (other executables, libraries, data file, ...) that are also not found on the restricted path at that time. As SirDice said, I think you're better off writing a new rc.d script, which carefully sets the correct environment. That would be the clean way, much more long-term maintainable than a one-off line in rc.local.
 
OP
OP
F

freetobsd

New Member


Messages: 8

I tried both /etc/rc.local with /usr/local/bin/synergy-core --client 192.168.1.151 and synergy.sh in /usr/local/etc/rc.d and both methods work but apparently ignore the --client <server-ip>, in other words it is running as a server not a client. At least that is what I think: top shows it as a running process and /var/log/messages keeps outputting: Synergy: secondary screen unavailable: unable to open screen, which I think is the server looking for clients?
 
OP
OP
F

freetobsd

New Member


Messages: 8

I noticed that synergy-core --client <server-ip> doesn't work as root but does as a regular user on the command line - if that adds to my issue.
 
OP
OP
F

freetobsd

New Member


Messages: 8

Thanks for all the help. I ended up going with the rc.d script and the following command:

su -m reguser -c '/usr/local/bin/synergy-core --client 192.168.1.151'
 
Top