-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting barrerc on boot using systemd on Ubuntu system #540
Comments
I get the following error Feb 04 20:23:22 sirius systemd[1]: barrier.service: Control process exited, code=killed, status=6/ABRT
Feb 04 20:23:22 sirius systemd[1]: barrier.service: Failed with result 'signal'.
Feb 04 20:23:22 sirius systemd[1]: Failed to start Barrier mouse/keyboard share.
Feb 04 20:23:27 sirius systemd[1]: barrier.service: Service RestartSec=5s expired, scheduling restart.
Feb 04 20:23:27 sirius systemd[1]: barrier.service: Scheduled restart job, restart counter is at 10.
Feb 04 20:23:27 sirius systemd[1]: Stopped Barrier mouse/keyboard share.
Feb 04 20:23:27 sirius systemd[1]: Starting Barrier mouse/keyboard share...
Feb 04 20:23:27 sirius barrierc[25997]: [2020-02-04T20:23:27] DEBUG: XOpenDisplay(":0.0")
Feb 04 20:23:27 sirius barrierc[25997]: /home/michael/tools/barrier/src/lib/platform/XWindowsScreen.cpp,888
Feb 04 20:23:27 sirius barrierc[25997]: No protocol specified
Feb 04 20:23:27 sirius barrierc[25997]: [2020-02-04T20:23:27] WARNING: secondary screen unavailable: unable to open screen
Feb 04 20:23:27 sirius barrierc[25997]: /home/michael/tools/barrier/src/lib/barrier/ClientApp.cpp,404
Feb 04 20:23:27 sirius barrierc[25997]: [2020-02-04T20:23:27] DEBUG: retry in 60 seconds
Feb 04 20:23:27 sirius barrierc[25997]: /home/michael/tools/barrier/src/lib/barrier/ClientApp.cpp,275
Feb 04 20:23:27 sirius barrierc[25997]: [2020-02-04T20:23:27] DEBUG: event queue is ready
Feb 04 20:23:27 sirius barrierc[25997]: /home/michael/tools/barrier/src/lib/base/EventQueue.cpp,117
Feb 04 20:23:27 sirius barrierc[25997]: barrierc: /home/michael/tools/barrier/src/lib/base/NonBlockingStream.cpp:56: bool NonBlockingStream::try_read_char(char&) const: Assertion `result == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)' failed. Looks like it cannot open the screen when its started from a service. https://unix.stackexchange.com/a/486095 |
I just want to do the Ubuntu equivalent of Windows "run on startup" (which works flawlessly on for Barrier). |
https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en |
I was not aware of that, when I looked for starting barrier with ubuntu I got a lot of systemd guides. I'll give it a shot, but it looks like it's going to work. |
I seem to be getting the same issue on Fedora when I start the client from a screen session with it immediately detached ( |
@Karlovsky120 I found your issue looking for something else. I realize this is old, but I noticed that your service had
If Also, I have a pull request in for some systemd service configurations #694 if you want to try them out. |
Interesting, does the systemd unit also launch without the assertion failure? I seem to be able to use the Debian 10 distribution package on those systems fine with screen detached immediately, and I believe the systemd unit as well. However on both Fedora 31 and Devuan ASCII (Debian 9 like) where I had to build from source, I was never able to get either detached screen (or on Fedora the systemd unit) to work properly. Always it was that assertion failure. No idea why though, my systemd unit even had the environment set with the DISPLAY=:0 variable and everything. Very strange... |
@toloveru It should launch without the above mentioned assertion failure as long as your X11 display is Systemd doesn't know what the $DISPLAY variable is for the current X11 session, the only way I know to make it work is explicitly set it with Edit: That might also be what's happening in your screen session if you're using ssh and don't have $DISPLAY set or if you have X11 forwarding on. |
@simons-public Thanks for the reply. I've just built Barrier from the current master (dbd1082) on Fedora 31, adjusted to include your systemd units. It appears that the client starts as expected over SSH even with |
Looking at that systemd output, my hunch is that its not able to find |
Using unbuffer (from the
|
[Unit] [Service] [Install] I just get into Linux, i try to start Barrier at Startup without Login. Barrier is starting but it ignores the Login Screen and the User is loged in. How can i avoid the login |
Operating Systems
Server: Windows 10 1903
Client: Ubuntu 18.04
Barrier Version
2.1.0-RELEASE-0b2dfd80
Steps to reproduce bug
I'm trying to get the barrierc to start on boot. System is set to auto logon and I have a systemd service that looks like this:
[Unit]
Description=Barrier mouse/keyboard share
Requires=display-manager.service
After=display-manager.service network.target
[Service]
Type=forking
ExecStart=/usr/bin/barrierc -f 192.168.12.96
Restart=always
RestartSec=2
User=karlovsky120
[Install]
WantedBy=default.target
I can run '/usr/bin/barrier -f 192.168.12.96 manually from the terminal and barrier will start normally and connect to the server.
If I attempt to systemctl start barrier.service, it says that the job failed because a fatal signal was delivered causing control process to dump code. I've spent last several days trying to get this to work and nothing I tried works.
Can someone tell me the minimal Ubuntu systemd service file that will work for barrierc, assuming that the service starts on boot and that auto logon is enabled?
The text was updated successfully, but these errors were encountered: