Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: How do i learn runit? (Read 884 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How do i learn runit?

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

Re: How do i do a runnit servie file?

Reply #1
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.


Re: How do i do a runnit servie file?

Reply #3
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).


Re: How do i do a runnit servie file?

Reply #5
I bet it is this one. 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