Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533828 - sys-apps/openrc should provide a default "nonetwork" runlevel
Summary: sys-apps/openrc should provide a default "nonetwork" runlevel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-28 16:04 UTC by Toralf Förster
Modified: 2016-05-12 22:55 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2014-12-28 16:04:30 UTC
as root run the command :
$> init 2
at the console (or pass the appropriate kernel command line parameter to the grub menu) and you get the error 'nonetwork" not found'
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-29 07:54:03 UTC
Please post your `emerge --info sys-apps/sysvinit' output in a comment.
Comment 2 Toralf Förster gentoo-dev 2014-12-29 09:26:08 UTC
tfoerste@t44 ~ $ emerge --info sys-apps/sysvinit
Portage 2.2.14 (python 3.3.5-final-0, hardened/linux/amd64, gcc-4.8.3, glibc-2.19-r1, 3.17.7-hardened-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.17.7-hardened-r1-x86_64-Intel-R-_Core-TM-_i5-4300U_CPU_@_1.90GHz-with-gentoo-2.2
KiB Mem:    12033700 total,   6780656 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of tree: Sun, 28 Dec 2014 17:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.9-r1, 3.3.5-r1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.6
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo toralf
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --nospinner --tree --quiet-build --deep --autounmask --autounmask-unrestricted-atoms"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.mirror.dkm.cz/pub/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X acl aes-ni amd64 apache2 avx avx2 berkdb bzip2 cli corefonts cracklib crypt cups cxx dbus dnssec dri drmkms dvd ecc ffmpeg fontconfig fortran fpm gdbm git gtk gudev gui hardened iconv isag jpeg justify libvirtd logrotate macvtap mbox mmx modules multilib mysql ncurses nls nptl ogg opengl openmp pam pax_kernel pcre plasma png policykit qemu qt3support qt4 readline session spice sse sse2 sse4 sse4_1 sse4_2 ssh-askpass ssl ssse3 tcpd theora thinkpad threads tk tls truetype uml unicode urandom usb usbredir uxa v4l v4l2 vaapi video vorbis xa xattr xmp xscreensaver xtpax xvfb xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/sysvinit-2.88-r7 was built with the following:
USE="(-ibm) (-selinux) -static" ABI_X86="64"
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
Comment 3 Anthony Basile gentoo-dev 2016-05-12 13:58:29 UTC
It depends who you want to blame here.  all versions of sysvinit have

   l2:2:wait:/sbin/openrc nonetwork

while no version of openrc has

   /usr/share/openrc/runlevels/nonetwork


Does anyone use nonetwork?  I would just drop runlevel2 to single.  Is this a problem for anyone?
Comment 4 SpanKY gentoo-dev 2016-05-12 15:06:23 UTC
runlevel 2 is commonly "multi-user w/no networking", so seems like we should have openrc define it nominally at least
Comment 5 Toralf Förster gentoo-dev 2016-05-12 15:16:42 UTC
(In reply to SpanKY from comment #4)
at least it was common 1 or 2 decades ago when I started with Linux ;)
Comment 6 Anthony Basile gentoo-dev 2016-05-12 17:00:52 UTC
(In reply to SpanKY from comment #4)
> runlevel 2 is commonly "multi-user w/no networking", so seems like we should
> have openrc define it nominally at least

(In reply to Toralf Förster from comment #5)
> (In reply to SpanKY from comment #4)
> at least it was common 1 or 2 decades ago when I started with Linux ;)

i'm pretty ancient myself having used unix since the late 80's.  i have lots of nostalgia for the traditional runlevels, but i wonder if that's all it is, nostalgia.

i can prepare a patch for openrc.  but i'd rather not have this block stabilization of the latest sysvinit though since i think is pretty corner case.
Comment 7 SpanKY gentoo-dev 2016-05-12 17:17:30 UTC
(In reply to Anthony Basile from comment #6)

all openrc has to do is provide a runlevel with "local" in it and it's done.

as for stabilization blocker, i don't see why it would ... stable has this bug already, so it's not a regression
Comment 8 Anthony Basile gentoo-dev 2016-05-12 18:13:49 UTC
(In reply to SpanKY from comment #7)
> (In reply to Anthony Basile from comment #6)
> 
> all openrc has to do is provide a runlevel with "local" in it and it's done.

i was thinking of just duplicating the stuff we do for RC_LEVEL_DEFAULT, but i was going to call it RC_LEVEL_NONETWORK.  are you suggesting we call it RC_LEVEL_LOCAL?

> 
> as for stabilization blocker, i don't see why it would ... stable has this
> bug already, so it's not a regression
Comment 9 Anthony Basile gentoo-dev 2016-05-12 18:29:14 UTC
(In reply to Anthony Basile from comment #8)
> (In reply to SpanKY from comment #7)
> > (In reply to Anthony Basile from comment #6)
> > 
> > all openrc has to do is provide a runlevel with "local" in it and it's done.
> 
> i was thinking of just duplicating the stuff we do for RC_LEVEL_DEFAULT, but
> i was going to call it RC_LEVEL_NONETWORK.  are you suggesting we call it
> RC_LEVEL_LOCAL?
> 

oh never mind, i know what you mean. to be clear, i think you mean add something in runlevels/Makefile like


diff --git a/runlevels/Makefile b/runlevels/Makefile
index 682d6e1..ac6f6bc 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -3,6 +3,7 @@ include ../mk/net.mk
 BOOT=          bootmisc fsck hostname localmount loopback \
                root swap swapfiles sysctl urandom ${BOOT-${OS}}
 DEFAULT=       local netmount
+NONETWORK=     local
 SHUTDOWN=      savecache ${SHUTDOWN-${OS}}
 SYSINIT=       ${SYSINIT-${OS}}
 
@@ -10,6 +11,7 @@ LEVELDIR=     ${DESTDIR}/${SYSCONFDIR}/runlevels
 SYSINITDIR=    ${LEVELDIR}/sysinit
 BOOTDIR=       ${LEVELDIR}/boot
 DEFAULTDIR=    ${LEVELDIR}/default
+NONETWORKDIR=  ${LEVELDIR}/nonetwork
 SHUTDOWNDIR=   ${LEVELDIR}/shutdown
 
 ifeq (${MKNET},yes)
@@ -72,6 +74,14 @@ install:
                        fi; \
                        ln -snf ${INITDIR}/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; done \
        fi
+       if ! test -d "${NONETWORKDIR}"; then \
+               ${INSTALL} -d ${NONETWORKDIR} || exit $$?; \
+               for x in ${NONETWORK}; do \
+                       if test "${MKPREFIX}" = yes; then \
+                               grep -q "keyword .*-prefix" ${INITFILES}/"$$x" && continue; \
+                       fi; \
+                       ln -snf ${INITDIR}/"$$x" ${NONETWORKDIR}/"$$x" || exit $$?; done \
+       fi
        if ! test -d "${SHUTDOWNDIR}"; then \
                ${INSTALL} -d ${SHUTDOWNDIR} || exit $$?; \
                for x in ${SHUTDOWN}; do \
Comment 10 SpanKY gentoo-dev 2016-05-12 19:25:30 UTC
(In reply to Anthony Basile from comment #9)

yeah, something along those lines
Comment 11 Anthony Basile gentoo-dev 2016-05-12 21:56:04 UTC
after discussions with William, it doesn't look like we need any man page updating or anything else.  i tested the patch and it works so i pushed it to the repo.

we should add something to the ebuild though which checks if /etc/runlevels is already  installed, but /etc/runlevels/nonetwork is not, then cp -a /usr/share/openrc/runlevels/nonetwork /etc/runlevels/nonetwork.
Comment 12 William Hubbs gentoo-dev 2016-05-12 22:29:47 UTC
https://github.com/openrc/openrc/commit/b3a04e7

This will be in openrc-0.21, and the ebuild is updated as well.
Comment 13 Anthony Basile gentoo-dev 2016-05-12 22:55:24 UTC
William also fixed the ebuild

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=184de04dd4f2599ca2d04502195f12737527f13d

so I think we're done here.