Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 611846 - sys-process/runit-2.1.2-r1: several issues with ebuild
Summary: sys-process/runit-2.1.2-r1: several issues with ebuild
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
: 632174 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-06 05:04 UTC by Alex Efros
Modified: 2020-05-09 13:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
runit-2.1.2-r1.ebuild.patch (runit-2.1.2-r1.ebuild.patch,2.90 KB, patch)
2017-03-06 05:04 UTC, Alex Efros
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2017-03-06 05:04:31 UTC
Created attachment 466108 [details, diff]
runit-2.1.2-r1.ebuild.patch

I've sent this by email to ebuild maintainer a couple of weeks ago, but didn't get any reply, so I'm sending this here. I'll attach patch to the ebuild which fixes many issues.


Date: Fri, 24 Feb 2017 04:38:43 +0200
From: Alex Efros <powerman@powerman.name>
To: William Hubbs <williamh@gentoo.org>
Subject: question about runit-2.1.2-r1.ebuild

Hi!

It looks like migration procedure from runit-2.1.1 is broken. Is it was
tested at all?

The problem is there are two pkg_preinst(), so I suppose second one just
overwrite first one, but first one looks important and should not be
skipped.

Another possible issue is different configurations for first install and
for upgrade from runit-2.1.1: in first case /etc/service is a directory,
in second case /etc/service is a symlink to /etc/runit/runsvdir/current.

Also, in first install case when /etc/service is a directory there is a
note in ebuild:
       	einfo "If you need multiple runlevels, please see the documentation"
       	einfo "for how to set them up."
but runlevels are managed using /etc/runit/runsvdir/current and this won't
work if /etc/service is a directory instead of symlink to
/etc/runit/runsvdir/current.


Finally, I propose one big change to the ebuild: move files
/etc/runit/{1,2,3,ctrlaltdel} and directories for getty-* services into
separate ebuild(s), with dependency on that ebuild(s) through virtual/*.
This is required to provide alternative implementations for these files
and services. For example, on my system I boot using runit instead of
openrc, and thus my /etc/runit/1 is a real full-featured boot script.
Without such virtual/* packages I've to keep runit ebuild in own overlay
just to drop /etc/runit/{1,2,3,ctrlaltdel} files from it and thus avoid
conflict with my own ebuild providing alternative for these files.

If you like to I can proxy-maintain this ebuild or just create improved
version for this ebuild once and send it to you/bugzilla.

--
                       	WBR, Alex.
Comment 1 William Hubbs gentoo-dev 2018-01-04 15:21:10 UTC
I'm looking at this today.
It looks like the best way forward is going to be to separate the boot
scripts into their own package, so you will have runit then runit-openrc
or something similar.
Comment 2 William Hubbs gentoo-dev 2018-01-05 03:11:21 UTC
It looks like /etc/runit/2 and /etc/runit/ctrlaltdel can stay with
runit, because they should be the same regardless of how you boot your
system, But /etc/runit/1 and /etc/runit/3 will need to be able to be
customized easily, along with the contents of /etc/runit/runsvdir and
/etc/service.
Comment 3 Alex Efros 2018-01-05 13:00:57 UTC
(In reply to William Hubbs from comment #2)
> It looks like /etc/runit/2 and /etc/runit/ctrlaltdel can stay with
> runit, because they should be the same regardless of how you boot your
> system, But /etc/runit/1 and /etc/runit/3 will need to be able to be
> customized easily, along with the contents of /etc/runit/runsvdir and
> /etc/service.

Yes, but it's unlikely makes sense to split these files into different packages just because of this. Also, sometimes /etc/runit/2 also needs some modifications, for example here is mine:

---
#!/bin/bash
PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

exec 3<>/var/log/all/.log
exec &>/var/log/all/.log
exec env - PATH=$PATH \
runsvdir -P /etc/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
---

It looks this way because I'm using chain of log-services:
- most services write logs to their own svlogd, as usually
- some config files of these svlogd for some services are configured to duplicate some lines to svlogd's STDERR
- ./log/run which runs svlogd is configured to redirect svlogd's STDERR to /var/log/all/.log (which is a named PIPE file created with `mkfifo`)
- there is /etc/service/log-all/ service which runs svlogd reading from /var/log/all/.log and writing logs into /var/log/all/current

This way I've most interesting log lines from all services in one log file, which is usually always open with `tail -F`.
(Also this log is used to implement desktop notifications for most critical events with help of another one service.)

So, just like I've redirected STDERR of all svlogd of all services I've also redirected there STDERR of runsvdir itself, to see in this log messages which wasn't properly redirected in some service's ./run files.
Comment 4 William Hubbs gentoo-dev 2018-01-07 18:03:22 UTC
*** Bug 632174 has been marked as a duplicate of this bug. ***
Comment 5 SergeiMinaev 2020-05-09 13:18:02 UTC
runit-2.1.2-r1 doesn't start:

"start-stop-daemon: /usr/bin/runsvdir does not exist"

it's because of wrong path in /etc/init.d/runsvdir:

"command=/usr/bin/runsvdir"

while actual path is /bin/runsvdir