Skip to content
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

add systemd service #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Deuchnord
Copy link

Hello, thanks for this incredible project!

As a regular user, I'd like UxPlay to start automatically as soon as I open my session, and I didn't want to keep a terminal open. Here I propose a minimal systemd service that allows to start UxPlay as a daemon.

This way, we can start uxplay with systemctl start --user uxplay. If we want to make it start at login, systemctl enable --user uxplay will do it.

Hope this will help!

@fduncanh
Copy link
Collaborator

fduncanh commented Jul 3, 2024

Thanks!

We will check this out, maybe next week.
There was already some discussion, see #80 and #269

@fduncanh fduncanh force-pushed the master branch 3 times, most recently from 89039da to 4d88240 Compare July 20, 2024 23:49
@fduncanh fduncanh force-pushed the master branch 2 times, most recently from 0f7948d to 1a77a9f Compare October 4, 2024 05:02
@fduncanh fduncanh force-pushed the master branch 4 times, most recently from 1772c17 to 6236f3d Compare November 5, 2024 12:22
@fduncanh fduncanh force-pushed the master branch 7 times, most recently from 966b9fa to 39e0d8a Compare December 13, 2024 17:08
@fduncanh fduncanh force-pushed the master branch 5 times, most recently from 7a14d4c to b1fb510 Compare December 20, 2024 23:19
@fduncanh fduncanh force-pushed the master branch 5 times, most recently from 95fe525 to 5e55669 Compare January 25, 2025 14:27
@fduncanh fduncanh force-pushed the master branch 2 times, most recently from f2d8c03 to 35b1e9e Compare January 25, 2025 14:37
@SaadBazaz
Copy link

This would be cool, even if as an example

@fduncanh
Copy link
Collaborator

fduncanh commented Feb 6, 2025

please experiment with this, and report on if it works well!

@SaadBazaz
Copy link

SaadBazaz commented Feb 6, 2025

I ran:

sudo nano /etc/systemd/system/uxplay.service

Pasted the following in it:

[Unit]
Description=AirPlay Unix mirroring server
Requires=avahi-daemon
After=avahi-daemon

[Service]
Type=simple
ExecStart=uxplay -o -fs -nofreeze -hls
Restart=on-failure

[Install]
WantedBy=default.target

But this crashes when trying to connect:

journalctl -u uxplay.service
Feb 06 11:14:07 shahbaz systemd[1]: Started uxplay.service - AirPlay Unix mirroring server.
Feb 06 11:14:09 shahbaz uxplay[6776]: error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Feb 06 11:14:23 shahbaz systemd[1]: uxplay.service: Main process exited, code=dumped, status=11/SEGV
Feb 06 11:14:23 shahbaz systemd[1]: uxplay.service: Failed with result 'core-dump'.
Feb 06 11:14:23 shahbaz systemd[1]: uxplay.service: Scheduled restart job, restart counter is at 1.
Feb 06 11:14:23 shahbaz systemd[1]: Started uxplay.service - AirPlay Unix mirroring server.
Feb 06 11:14:24 shahbaz uxplay[6915]: error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Feb 06 11:14:45 shahbaz systemd[1]: uxplay.service: Main process exited, code=dumped, status=11/SEGV
Feb 06 11:14:45 shahbaz systemd[1]: uxplay.service: Failed with result 'core-dump'.
Feb 06 11:14:45 shahbaz systemd[1]: uxplay.service: Scheduled restart job, restart counter is at 2.
Feb 06 11:14:45 shahbaz systemd[1]: Started uxplay.service - AirPlay Unix mirroring server.
Feb 06 11:14:46 shahbaz uxplay[7127]: error: XDG_RUNTIME_DIR is invalid or not set in the environment.

Side note: It works fine if I run the command directly on the Terminal.

@fduncanh
Copy link
Collaborator

fduncanh commented Feb 6, 2025

XDG_RUNTIME_ERROR is an X11 X-windows error
take a look at the earlier attempts #80 and #269 to see if you can figure anything out.

@fduncanh fduncanh force-pushed the master branch 4 times, most recently from bc2843a to f63a91c Compare February 16, 2025 01:15
@fduncanh fduncanh force-pushed the master branch 4 times, most recently from b20a41f to 79ff141 Compare February 19, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants