kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

rc.local command not running??

Mon Feb 09, 2015 3:37 pm

I have synergy set up on my laptop and I can get the pi to connect to it no problem. I cannot however get rc.local to run the command.

Code: Select all

sudo /usr/bin/synergyc 10.10.9.55

_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"

exit 0
The original IP bit still works so the command must have run but for some reason synergy does not connect.

Paradoxically if I run

Code: Select all

sh -e /etc/rc.local
synergy connects.

Whats going wrong? I suspect that synergy doesn't run for some reason but I cannot work out what.

User avatar
Paeryn
Posts: 2561
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: rc.local command not running??

Mon Feb 09, 2015 4:30 pm

It should report any errors to syslog (/var/log/syslog) so check there to see if it tells you anything - it should be near the end of the file. It may be something like X11 hasn't finished starting by the time synergyc is starting. If so have you tried running it from your .xsession ? That way it only runs when you've logged into X11.
Edit:
Just realised, you may not have a .xsession file in your home directory (it doesn't get created if there's nothing to put in it), if so and you want to try running synergyc from it just create .xsession in your home dir - it's a standard shell script - just make sure that anything you put in there either runs in the background or quits as X11 won't finish logging you in until the script ends.
She who travels light — forgot something.

User avatar
RaTTuS
Posts: 10304
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: rc.local command not running??

Mon Feb 09, 2015 5:21 pm

1) you don't need sudo in rc.local as that is run as root anyway
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: rc.local command not running??

Tue Feb 10, 2015 1:47 pm

I realised that. I took it out but still no dice.

User avatar
RaTTuS
Posts: 10304
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: rc.local command not running??

Tue Feb 10, 2015 1:50 pm

what about the log files ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: rc.local command not running??

Tue Feb 10, 2015 4:59 pm

Is there a specific log for rc.local or is it syslog or messages? I cant see any errors relating to it.

User avatar
Paeryn
Posts: 2561
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: rc.local command not running??

Tue Feb 10, 2015 11:37 pm

kghunt wrote:Is there a specific log for rc.local or is it syslog or messages? I cant see any errors relating to it.
The docs for synergyc say that it reports errors via syslog unless it's forced to run in the foreground (in which case they would be sent to the terminal like normal).
init.d (and hence anything run from /etc/rc.local) doesn't automatically redirect output anywhere (though most of the scripts and daemons do).
She who travels light — forgot something.

Return to “Raspbian”