openrc service file #48

Open
opened 2022-12-30 03:04:26 +00:00 by Holly · 3 comments

Can you please also add a service file for openrc?

postmarketOS uses openrc and is popular on PinePhone, which of course is a prime candidate for pairing with PineTime.

I've attempted to add the file myself, but it resulted in the OS being stuck on splash screen. Here's what I tried:

#!/sbin/openrc-run

name="ITD"
description="InfiniTime Daemon"
command="/usr/bin/itd"
pidfile="/var/run/itd.pid"

depend() {
        after bluetooth.target
}
Can you please also add a service file for openrc? postmarketOS uses openrc and is popular on PinePhone, which of course is a prime candidate for pairing with PineTime. I've attempted to add the file myself, but it resulted in the OS being stuck on splash screen. Here's what I tried: ``` #!/sbin/openrc-run name="ITD" description="InfiniTime Daemon" command="/usr/bin/itd" pidfile="/var/run/itd.pid" depend() { after bluetooth.target } ```
Owner

It doesn't seem that OpenRC has any support for user services. In order for ITD to work properly with DBus, it must be launched specifically as the user who is going to use it, and cannot run as root. Trying to run it as root would result in most of the functionality not working, because much of it (such as PureMaps, Notifications, MPRIS (for music controls), etc.) is exposed via a DBus user session. This problem is impossible to solve without OpenRC adding user services.

There is a draft proposal for user services in OpenRC here: https://github.com/OpenRC/openrc/pull/573. This would have to be merged for ITD to work properly under OpenRC. Failing that, the service file would have to be edited manually by each user in order to hard code their username.

It doesn't seem that OpenRC has any support for user services. In order for ITD to work properly with DBus, it must be launched specifically as the user who is going to use it, and cannot run as root. Trying to run it as root would result in most of the functionality not working, because much of it (such as PureMaps, Notifications, MPRIS (for music controls), etc.) is exposed via a DBus user session. This problem is impossible to solve without OpenRC adding user services. There is a draft proposal for user services in OpenRC here: https://github.com/OpenRC/openrc/pull/573. This would have to be merged for ITD to work properly under OpenRC. Failing that, the service file would have to be edited manually by each user in order to hard code their username.
Owner

What I may be able to do instead is provide a start-itd script that automatically starts ITD in the background. This script could maybe be used in the settings of your DE to make ITD start on login. I'm not sure if the DEs have such settings as I haven't had a need for them. If you could please look and see if such settings exist, I'd appreciate it.

What I may be able to do instead is provide a `start-itd` script that automatically starts ITD in the background. This script could maybe be used in the settings of your DE to make ITD start on login. I'm not sure if the DEs have such settings as I haven't had a need for them. If you could please look and see if such settings exist, I'd appreciate it.

I made a service file that doesn't stop postmarketos from booting. It is.under the pull requests.
Only issues that I have found with the openrc file is the initial connect needs to be started manually as the code needs to be endered. Also I'm not sure if it is the rc file is stopping music control as it starts before dbus is initalised. Might need tweeking to accomodate that.

I made a service file that doesn't stop postmarketos from booting. It is.under the pull requests. Only issues that I have found with the openrc file is the initial connect needs to be started manually as the code needs to be endered. Also I'm not sure if it is the rc file is stopping music control as it starts before dbus is initalised. Might need tweeking to accomodate that.
Sign in to join this conversation.
No description provided.