Artix Linux Forum

Artix Linux => Package management => Topic started by: julianmarcos on 31 May 2021, 18:03:34

Title: How do i learn runit?
Post by: julianmarcos on 31 May 2021, 18:03:34
How can i convert a systemd system file to a runit one?
How can i make a runit runsv?
How do i configure a runit runsv to run under a specific user?
---
Manual pages/docs, or anyting that cloud help me understand runit
Title: Re: How do i do a runnit servie file?
Post by: capezotte on 31 May 2021, 18:40:48
Create a folder at /etc/runit/sv named after your service (eg: /etc/runit/sv/mydaemon)

Inside that folder, create a file named run. The simplest systemd files map to run file like this:

mydaemon.service
Code: [Select]
[Unit]
Description=My daemon

[Service]
Type=simple
ExecStart=/usr/bin/mydaemon --option

/etc/runit/sv/mydaemon/run
Code: [Select]
#!/bin/sh
exec /usr/bin/mydaemon --option

Then you enable with rsm, do the ln -s stuff, etc.

This will work only for very simple systemd units, and afaik there's nothing like http://openrc.run for runit, so you'll have to tell us what service you're trying to convert so we can help you make a proper, equivalent run file.
Title: Re: How do i do a runnit servie file?
Post by: strajder on 31 May 2021, 18:42:34
I bet it is this one (https://forum.artixlinux.org/index.php/topic,2661.msg17521/topicseen.html#msg17521). There was no need to create a separate thread, IMHO.
Title: Re: How do i do a runnit servie file?
Post by: capezotte on 31 May 2021, 19:01:06
If that's the case, here's a tentative, untested run file:
Code: [Select]
#!/bin/sh
[ -r /etc/default/tailscaled ] && . /etc/default/tailscaled
/usr/sbin/tailscaled --cleanup
exec /usr/sbin/tailscaled --state=/var/lib/tailscale/tailscaled.state \
  --socket=/run/tailscale/tailscaled.sock --port "$PORT" $FLAGS

But we have a problem. It's a type notify service, which means it tells systemd when it's ready using a systemd-specific API. Though my testing suggests it just falls back to not notifying systemd (or the fact that I have elogind tricks it).
Title: Re: How do i do a runnit servie file?
Post by: strajder on 31 May 2021, 19:22:37
I think it could be a s6/suite66 service (if it requires notification), though. They have notify services.
Title: Re: How do i do a runnit servie file?
Post by: julianmarcos on 31 May 2021, 19:37:13
I bet it is this one (https://forum.artixlinux.org/index.php/topic,2661.msg17521/topicseen.html#msg17521). There was no need to create a separate thread, IMHO.
I was thinking of using from the aur so... I whanted to know how...
Code: [Select]
ly
I will leave the source for this one, but i want to know where to find these infos
Code: [Select]
[Unit]
Description=TUI display manager
After=systemd-user-sessions.service plymouth-quit-wait.service
[email protected]

[Service]
Type=idle
ExecStart=/usr/bin/ly
StandardInput=tty
TTYPath=/dev/tty2
TTYReset=yes
TTYVHangup=yes

[Install]
Alias=display-manager.service
Title: Re: How do i do a runnit servie file?
Post by: strajder on 31 May 2021, 20:18:31
Also check out (if you haven't seen it):

https://wiki.archlinux.org/title/Xinit#Autostart_X_at_login

I'm using something like that. Basically, it is skipping the use of display manager in general.
Title: Re: How do i do a runnit servie file?
Post by: julianmarcos on 01 June 2021, 09:15:17
Also check out (if you haven't seen it):

https://wiki.archlinux.org/title/Xinit#Autostart_X_at_login

I'm using something like that. Basically, it is skipping the use of display manager in general.
I wanted to setup ly but i think i can live without it, as only i am on here. But i wanted to know how to setup it.