Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stale services dependencies cache while editing /etc/rc.conf #85

Closed
NP-Hardass opened this issue Mar 30, 2016 · 3 comments
Closed

Stale services dependencies cache while editing /etc/rc.conf #85

NP-Hardass opened this issue Mar 30, 2016 · 3 comments

Comments

@NP-Hardass
Copy link

Steps to reproduce:
echo 'rc_need="zram-init"' >> /etc/rc.conf
reboot
Observe that no services start because all now depend on zram-init
mount -o remount,rw / (required because mount fails)
sed -i 's/rc_need="zram-init"//' /etc/rc.conf
reboot
Observe that services still fail to start

rc-update -u
Updates cache, and all returns to normal.

Let me know if I can provide any more information

emerge --info

Portage 2.2.26 (python 2.7.10-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.21-r2, 4.2.8-tuxonice x86_64)
=================================================================
System uname: Linux-4.2.8-tuxonice-x86_64-Intel-R-_Core-TM-_i7-2620M_CPU_@_2.70GHz-with-gentoo-2.2
KiB Mem:    16323664 total,  14344928 free
KiB Swap:   10485756 total,  10485756 free
Timestamp of repository gentoo: Sat, 26 Mar 2016 00:45:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
ccache version 3.1.9 [disabled]
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/ccache:          3.1.9-r4::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r2::gentoo
Repositories:

R_Overlay
    location: /var/lib/repos/R_Overlay
    sync-type: laymansync
    sync-uri: rsync://roverlay.dev.gentoo.org/roverlay
    masters: gentoo
    priority: 50

bumblebee
    location: /var/lib/repos/bumblebee
    sync-type: laymansync
    sync-uri: git://github.com/Bumblebee-Project/bumblebee-gentoo
    masters: gentoo
    priority: 50

haskell
    location: /var/lib/repos/haskell
    sync-type: laymansync
    sync-uri: git://github.com/gentoo-haskell/gentoo-haskell.git
    masters: gentoo
    priority: 50

java
    location: /var/lib/repos/java
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/java.git
    masters: gentoo
    priority: 50

mate
    location: /var/lib/repos/mate
    sync-type: laymansync
    sync-uri: git://github.com/Sabayon/mate-overlay.git
    masters: gentoo
    priority: 50

mate-community
    location: /var/lib/repos/mate-community
    sync-type: laymansync
    sync-uri: git://github.com/infirit/mate-community.git
    masters: gentoo
    priority: 50

mv
    location: /var/lib/repos/mv
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/user/mv.git
    masters: gentoo
    priority: 50

pentoo
    location: /var/lib/repos/pentoo
    sync-type: laymansync
    sync-uri: git://github.com/pentoo/pentoo-overlay.git
    masters: gentoo
    priority: 50

printer-drivers
    location: /var/lib/repos/printer-drivers
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/printer-drivers.git
    masters: gentoo
    priority: 50

rion
    location: /var/lib/repos/rion
    sync-type: laymansync
    sync-uri: git://github.com/rion-overlay/rion-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/repos/steam-overlay
    sync-type: laymansync
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

tox-overlay
    location: /var/lib/repos/tox-overlay
    sync-type: laymansync
    sync-uri: git://github.com/Tox/gentoo-overlay-tox.git
    masters: gentoo
    priority: 50

wine-a-holics
    location: /var/lib/repos/wine-a-holics
    sync-type: laymansync
    sync-uri: git://github.com/NP-Hardass/wine-a-holics.git
    masters: gentoo
    priority: 50

x11
    location: /var/lib/repos/x11
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/x11
    masters: gentoo
    priority: 50

gentoo
    location: /var/lib/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://Portage/gentoo-repo
    priority: 75

gentoo-mate
    location: /var/lib/repos/gentoo-mate
    masters: gentoo
    priority: 80

local
    location: /var/lib/repos/local
    masters: gentoo
    priority: 80

np-hardass-overlay
    location: /var/lib/repos/np-hardass-overlay
    sync-type: git
    sync-uri: https://github.com/NP-Hardass/np-hardass-overlay.git
    masters: gentoo
    priority: 90

wine-overlay
    location: /var/lib/repos/wine-overlay
    sync-type: git
    sync-uri: https://github.com/NP-Hardass/wine-overlay.git
    masters: gentoo
    priority: 90

cvs-workdir
    location: /var/lib/repos/cvs-workdir
    masters: gentoo
    priority: 100

Installed sets: @archive-formats
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/var/lib/distfiles"
EMERGE_DEFAULT_OPTS=" --verbose=y --quiet-build=y --buildpkg-exclude "virtual/* sys-kernel/*-sources""
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 split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="rsync://mirrors.rit.edu/gentoo/ ftp://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/var/lib/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"
USE="7zip X aac acl acpi aes alsa amd64 avahi avx bash-completion berkdb bluetooth branding bzip2 cairo caja cleartype cli consolekit corefonts cracklib crypt cuda cups curl cxx dbus dell dhcp directfb djvu dri dvb dvd eap-tls epub exif fbcon ffmpeg flac fortran ftp gdbm gif git gnome-keyring gpg gpm gstreamer gtk gtk3 iconv icu ieee1394 ipv6 jpeg jpeg2k kerberos lame laptop lcdfilter ldap libnotify lm_sensors lzma mate mate-keyring matroska mmx mmxext modules mp3 mp4 mpeg multilib ncurses nls nptl nvidia ogg opencl opengl openmp openrc openssl openvpn pam pcre pdf png policykit polkit popcnt postscript qt qt4 qt5 quicktime rar rdesktop readline rtsp samba sasl seccomp session smpeg sse sse2 sse3 sse4_1 sse4_2 ssh ssl ssse3 steamruntime svg tcpd theora threads tiff truetype twolame type1 udev unicode upnp upower v4l v4l2 vaapi vdpau vim-syntax vorbis vpnc wavepack win32codecs x264 x265 xattr xinerama xscreensaver xvid zeroconf zip zlib zsh-completion" ABI_X86="64" ALSA_CARDS="hda-intel usb-audio" 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" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB en_US ja" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="nvidia intel i915 i965 modesetting vmware" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
@williamh
Copy link
Contributor

williamh commented Sep 9, 2016

The /etc/init.d/savecache service saves the dependency cache during shutdown and the cache is restored by /lib*/rc/init.sh during the reboot. This is why the issue exists after the second reboot.
Should we stop saving and restoring the dependency cache?

williamh added a commit to williamh/openrc that referenced this issue Sep 9, 2016
@heroxbd
Copy link
Contributor

heroxbd commented Feb 17, 2018

This commit should be reverted. Because 1. it tries to solve a fake problem 2. it introduces new bug.

  1. This is an extreme case,
Steps to reproduce:
echo 'rc_need="zram-init"' >> /etc/rc.conf
reboot
Observe that no services start because all now depend on zram-init
mount -o remount,rw / (required because mount fails)
sed -i 's/rc_need="zram-init"//' /etc/rc.conf
reboot
Observe that services still fail to start

Because the system is in a fucked state, when reboot-ing, savecached is not called to overwrite the deptree cache with the new state. The case will never happen in a normal system.

  1. Not saving deptree cache causes parallel boot to be very noisy and unreliable: All the services tries to regenerate the deptree at once.

@williamh
Copy link
Contributor

All services generating the deptree at once is a separate issue, so I will treat it as such. I would rather not revert the commit, but I can generate the deptree before attempting to start services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants