Server: Windows 10
Client: Raspbian Buster
Server: 2.3.2-snapshot-210c2b70
Client: 2.3.2-snapshot-36ed253e
I would like to make Barrier automatically start on boot on my Raspberry Pi 4 running Raspbian Buster. Currently, I have to connect a second mouse/keyboard pair to my Raspberry Pi in order to start up Barrier, which kind of defeats the purpose. 馃檭 Is this possible? I tried adding barrier & to etc/rc.local and rebooting the Pi, but that didn't work.
I don't believe that Debian Buster uses sysvinit, and since Debian Jessie, it now uses systemd.
Could you confirm that Raspbian Buster uses systemd or sysvinit? You can check for systemd by running systemctl, and seeing if returns an error.
Thanks for the report!
@Shymega, wouldn't a systemd system service allow users to use barrier for accessing client computers' display manager/login?
@candeira Not sure. It could potentially work, but it wouldn't be per-user, and only for the root user, I'd imagine - so you'd need two Barrier configs.. on the same system. At least, that's how I understand it. I'd personally stick with a user service, but I can see the appeal of Barrier being available on the DM.
My personal situation is a PC where I don't have physical keyboards attached, and in come cases I find myself having to switch to TTY.
If the thing is running as a normal user.. Of course I cannot login into the console to begin with.
My solution for this is a set of scripts used on my Raspberry Pi 4 and couple another Linux boxes that I revision control in a gist over here:
https://gist.github.com/dayne/e3a7f31f0624bf299faf9fadfe510322
I see I have a note about fixing up my bash script stuff to make it work correctly in a mac... I'll loop back to that in the future but what I've linked above works for me on my RPi.
Before I go off and try to configure this from scratch, what is the expected way to initiate a Barrier connection with a headless client?
barrier &
to the end of /home/pi/.profile was enough to get it running automatically upon boot up into desktop mode for me
@rebroad In this context, "at boot" means before logging in.
@lornix This will start Barrier on login, not on boot. This issue is about starting Barrier before any user is logged in, so that on multi-user systems someone can enter credentials at the login screen.
@detly I put in a PR #694 that has systemd services if you want to give that a try.
@simons-public Amazing! I left a review comment, I hope you don't mind me jumping in.
barrier &to the end of /home/pi/.profile was enough to get it running automatically upon boot up into desktop mode for me
I am sorry, but could someone please explain to me how I am supposed to do this? I am completely starting from scratch with my Raspberry Pi and I want to connect my keyboard and mouse first. I don't have any other users but the main one so I don't need to log on. I just need to run Barrier on startup so I don't have to plug in my keyboard first. Can somebody please help me? Thanks in forward.
Adding:-
barrier &
to the end of /home/pi/.profile was enough to get it running automatically upon boot up into desktop mode for meI am sorry, but could someone please explain to me how I am supposed to do this? I am completely starting from scratch with my Raspberry Pi and I want to connect my keyboard and mouse first. I don't have any other users but the main one so I don't need to log on. I just need to run Barrier on startup so I don't have to plug in my keyboard first. Can somebody please help me? Thanks in forward.
If you visit the /home/pi folder in the file explorer and in the drop down menu beside the address bar select to show hidden files, you'll see the ".profile" file. You just need to add "barrier &" to the end of that.
EDIT: This is working for me now.
Thank you! adding barrier & to the end of the /home/pi/.profile file worked for me.
barrier &to the end of /home/pi/.profile was enough to get it running automatically upon boot up into desktop mode for me
Thank you! Was forever changing dongle to boot Barrier - worked perfectly
I've added "barrier & to the end of my " .profile" file
When screen boots I get a screen looking for Server IP: .
Is there a way to pass it the ip or did I miss something on setuo.
Thanks
@LRC32901 You may be able to change the line to barrierc <server ip> & but I haven't tested that.
This is working for me:
1) create a script (below) to start barrierc and connect to the local barrier server.
2) call that script from the end of ~/.profile
The script (change barrier_host to the correct ip address for your barrier server, i.e., the one with the keyboard and mouse):
export barrier_host=192.168.1.1 # CHANGE ME
export barrier_port=24800
export barrier_logfile="${HOME}/barrier.log"
if ! pgrep -af /usr/bin/barrierc; then
nohup /usr/bin/barrierc --no-tray --debug INFO --name raspberrypi --enable-crypto "[${barrier_host}]:${barrier_port}" <&- > "${barrier_logfile}" 2>&1 &
fi
Most helpful comment
Adding:-
barrier &to the end of /home/pi/.profile was enough to get it running automatically upon boot up into desktop mode for me