Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 536822 - eselect-1.4.3: "eselect rc show boot" shows no output (with sys-apps/openrc-0.13.7)
Summary: eselect-1.4.3: "eselect rc show boot" shows no output (with sys-apps/openrc-0...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo eselect Team
URL:
Whiteboard: eselect-1.4.4
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2015-01-17 09:48 UTC by charles17
Modified: 2015-01-24 12:30 UTC (History)
0 users

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


Attachments
emerge --info (emerge_info,5.39 KB, text/plain)
2015-01-17 10:50 UTC, charles17
Details
Patch for eselect-1.4.3 (0001-Be-compatible-with-new-OpenRC-in-rc-module.patch,1.61 KB, patch)
2015-01-17 16:53 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description charles17 2015-01-17 09:48:08 UTC
Both 
"app-admin/eselect rc show boot"
"app-admin/eselect rc list boot"
no longer show anything since upgdating to sys-apps/openrc-0.13.7
Comment 1 charles17 2015-01-17 10:50:24 UTC
Created attachment 394146 [details]
emerge --info
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2015-01-17 11:14:15 UTC
Which version of app-admin/eselect is that?
Comment 3 charles17 2015-01-17 13:40:24 UTC
app-admin/eselect-1.4.3
Comment 4 Don O 2015-01-17 15:34:51 UTC
The problem is eselect rc (rc-config) looks for /sbin/runscript
and openrc changed from /sbin/runscript to /sbin/openrc-run,
so doing a grep doesn't find it.

From /usr/share/eselect/modules/rc.eselect
40c40,41
< 		&& grep "^#\!/sbin/runscript" "${file}" &>/dev/null
---
> 		&& ((grep "^#\!/sbin/runscript" "${file}" &>/dev/null;)
> 		 || (grep "^#\!/sbin/openrc-run" "${file}" &>/dev/null;))

Will temporarily fix it so that both work.

I copied /usr/share/eselect/modules/rc.eselect into my ~/.eselect/modules dir
and made the changes and it works fine.
Comment 5 Ulrich Müller gentoo-dev 2015-01-17 16:53:15 UTC
Created attachment 394170 [details, diff]
Patch for eselect-1.4.3

Please test if attached patch fixes the problem.
Comment 6 Don O 2015-01-17 23:16:12 UTC
Patch works for me
Comment 7 Ulrich Müller gentoo-dev 2015-01-17 23:55:04 UTC
Fixed in git, commit 783374a7d24e310fcf0a49e16c10687bd515d66a.
Comment 8 Don O 2015-01-18 12:31:14 UTC
A more generic way probably would have been

head -1 "${file}" | grep "^#\!" &>/dev/null

as ONLY the first line should be being looked at and if it has a shebang then add it, that way it wouldn't matter if even /bin/sh or <whatever binary> was being used. That's a special directory that shouldn't be used other than to start daemon style processes.
Comment 9 Ulrich Müller gentoo-dev 2015-01-18 15:57:51 UTC
(In reply to Don O from comment #8)
> A more generic way probably would have been
> 
> head -1 "${file}" | grep "^#\!" &>/dev/null
> 
> as ONLY the first line should be being looked at and if it has a shebang
> then add it,

Right, how about the following? Works in pure bash, without any external tools:

    [[ -n ${file} \
             && ${file%%.sh} = "${file}" \
             && ${file%%\~} = "${file}" \
             && -x ${file} ]] \
        && read line <"${file}" \
        && [[ ${line} =~ ^#!.*(runscript|openrc-run) ]]

> that way it wouldn't matter if even /bin/sh or <whatever binary> was being
> used. That's a special directory that shouldn't be used other than to start
> daemon style processes.

I want to keep that test somewhat strict. Otherwise, we could simply use "rc-service --list" to obtain the list of services, without any filtering.
Comment 10 William Hubbs gentoo-dev 2015-01-18 19:03:54 UTC
(In reply to Ulrich Müller from comment #9)
> I want to keep that test somewhat strict. Otherwise, we could simply use
> "rc-service --list" to obtain the list of services, without any filtering.

Using rc-service --list would probably be the best way to go for this.

Using rc-service/openrc/rc-update/rc-status etc is the way I recommend working with OpenRC rather than trying to guess what is going on in the filesystem yourself.
Comment 11 Ulrich Müller gentoo-dev 2015-01-24 12:30:28 UTC
Fixed in version 1.4.4.
Thank you for reporting.