Executing command "eselect rc show primary" results in (hopefully) harmless error message: /usr/share/eselect/modules/rc.eselect: line 39: read: read error: 0: Is a directory Quick check revealed it's caused by calling function is_script on link to parent runlevel: lrwxrwxrwx 1 root root 10 Apr 22 13:14 /etc/runlevels/primary/default -> ../default Reproducible: Always Steps to Reproduce: 1. create stacked runlevel, i.e. mkdir /etc/runlevels/stacked && rc-update -s add default stacked 2. run eselect rc show stacked
Hm, I guess it should have an additional test for the script being a regular file: --- a/modules/rc.eselect +++ b/modules/rc.eselect @@ -35,6 +35,7 @@ is_script() { [[ -n ${file} \ && ${file%%.sh} = "${file}" \ && ${file%%\~} = "${file}" \ + && -f ${file} \ && -x ${file} ]] \ && read line <"${file}" \ && [[ ${line} =~ ^#!.*(runscript|openrc-run) ]]
That works just fine.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/eselect.git/commit/?id=e757ab1145cc4c6ce7b2c2005220ae59792e218e commit e757ab1145cc4c6ce7b2c2005220ae59792e218e Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2020-04-23 12:40:28 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2020-04-23 12:40:28 +0000 rc.eselect: Test for regular file. * modules/rc.eselect (is_script): Test whether the script is a regular file, bug 718920. Bug: https://bugs.gentoo.org/718920 Signed-off-by: Ulrich Müller <ulm@gentoo.org> ChangeLog | 5 +++++ modules/rc.eselect | 1 + 2 files changed, 6 insertions(+)
Thanks for testing. This doesn't affect behaviour (other than output of the error message), so it will have to wait for the next release.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1021d268b8b73b06b4409115af18655ea42dd7ff commit 1021d268b8b73b06b4409115af18655ea42dd7ff Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2020-12-16 12:03:58 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2020-12-16 12:09:12 +0000 app-admin/eselect: Version bump to 1.4.17. Closes: https://bugs.gentoo.org/718920 Closes: https://bugs.gentoo.org/760081 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Ulrich Müller <ulm@gentoo.org> app-admin/eselect/Manifest | 1 + app-admin/eselect/eselect-1.4.17.ebuild | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+)
Fixed in eselect-1.4.17. Thank you for reporting.