Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716800 - app-emulation/libvirt-6.2.0-r1 openrc init scripts not working anymore
Summary: app-emulation/libvirt-6.2.0-r1 openrc init scripts not working anymore
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-09 12:14 UTC by Thomas Stein
Modified: 2020-04-11 10:40 UTC (History)
4 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 Thomas Stein 2020-04-09 12:14:35 UTC
Hello Devs.

After upgrading to libvirt-6.2.0-r1 this morning "/etc/init.d/libvirt start" is not working anymore. I took a closer look and i thought i had the solution because "/etc/init.d/virtlogd" isn't working anymore either. The virtlogd daemon is running but "/etc/init.d/virtlogd status" gives "stopped" The pidfile is correct and contains the right Pid Number:

https://nopaste.fluffycloud.de/?b611024d6b200d34#6caP5Dr1Ktt8JSbDWk1fVnsypuNrWkn78tPVXdoj4Jc9

If i commnt "need virtlogd" in /etc/init.d/livirtd i get the same result.

What puzzles me is even downgrading to libvirt-6.1.0 does not solve the issue so it must be some kind of openrc issue?

Here the output of "strace /etc/init.d/virtlogd status" if that helps.

https://nopaste.fluffycloud.de/?610bd59980cb90c6#26kshTfj3ojYJ9uWtzJwJ2ynU8raKYmEvuBMBgXfLAC7

Reproducible: Always




sys2 ~ # emerge --info
Portage 2.3.89 (python 3.6.10-final-0, default/linux/amd64/17.0, gcc-9.2.0, glibc-2.29-r7, 5.6.3 x86_64)
=================================================================
System uname: Linux-5.6.3-x86_64-Intel-R-_Xeon-R-_CPU_E3-1245_V2_@_3.40GHz-with-gentoo-2.6
KiB Mem:    32860028 total,  15092952 free
KiB Swap:    1048508 total,   1048508 free
Timestamp of repository gentoo: Thu, 09 Apr 2020 06:30:01 +0000
Head commit of repository gentoo: f3cd7bb0ae213f18e2436e00bc6681fcb9bf5880
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17-r2::gentoo, 3.6.10-r1::gentoo, 3.7.7-r1::gentoo
dev-util/cmake:           3.14.3::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo, 2.33.1-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli crypt dri fortran gdbm iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

sys2 ~ #
Comment 1 Jonas Stein gentoo-dev 2020-04-09 15:44:59 UTC
Please do not use paste bins, but attach all information as described on
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please reopen this ticket (Status:UNCONFIRMED) afterwards.
Comment 2 Thomas Stein 2020-04-09 16:31:22 UTC
It's not really necessary to read the paste bins. But ok. 

sys2 ~ # ps auxww | grep virtlogd
root     28361  0.0  0.0   8088   872 pts/0    S+   18:29   0:00 grep --colour=auto virtlogd

sys2 ~ # /etc/init.d/virtlogd status
 * status: stopped

sys2 ~ # /etc/init.d/virtlogd start
 * Caching service dependencies ...                                                                                                     [ ok ]
 * Starting virtlogd ...
 * start-stop-daemon: failed to start `/usr/sbin/virtlogd'
 * Failed to start virtlogd                                                                                                             [ !! ]
 * ERROR: virtlogd failed to start

sys2 ~ # ps auxww | grep virtlogd
root     28668  0.0  0.0  33384  7588 ?        S    18:30   0:00 /usr/sbin/virtlogd -d
root     28746  0.0  0.0   8088   876 pts/0    S+   18:30   0:00 grep --colour=auto virtlogd
sys2 ~ # cat /run/virtlogd.pid 
28668sys2 ~ #
Comment 3 Thomas Stein 2020-04-09 16:35:09 UTC
Running the start-stop-daemon command by hand i get:

sys2 ~ # start-stop-daemon -v --exec /usr/sbin/virtlogd --pidfile /run/virtlogd.pid
 * start-stop-daemon: fopen `/run/virtlogd.pid': No such file or directory
 * Detaching to start `/usr/sbin/virtlogd' ...
^C *   start-stop-daemon: caught SIGINT, aborting
sys2 ~ #

The pid file exists though.

sys2 ~ # ls -l /run/virtlogd.pid 
-rw-r--r-- 1 root root 5 Apr  9 18:32 /run/virtlogd.pid
sys2 ~ #

And it's gone after killing the daemon.

sys2 ~ # ps auxww | grep virtlogd
root     29388  0.0  0.0  33384 11692 ?        Ss   18:32   0:00 /usr/sbin/virtlogd
root     29849  0.0  0.0   8088   812 pts/0    R+   18:34   0:00 grep --colour=auto virtlogd
sys2 ~ # kill 29388
sys2 ~ # ls -l /run/virtlogd.pid 
ls: cannot access '/run/virtlogd.pid': No such file or directory
sys2 ~ #
Comment 4 Thomas Stein 2020-04-09 16:37:10 UTC
Putting this in the init file lets the daemon start nicely.

start() {
    
    start-stop-daemon -b --exec "${command}"
}


sys2 ~ # /etc/init.d/virtlogd start
 * Caching service dependencies ...                                                                                                     [ ok ]
sys2 ~ # /etc/init.d/virtlogd status
 * status: started
sys2 ~ # ps auxw | grep virtlogd
root     30590  0.0  0.0  33384 11692 ?        Ss   18:36   0:00 /usr/sbin/virtlogd
root     30692  0.0  0.0   8088   812 pts/0    S+   18:36   0:00 grep --colour=auto virtlogd
sys2 ~ # cat /run/virtlogd.pid 
30590sys2 ~ #
Comment 5 nivedita 2020-04-09 17:46:36 UTC
I have the same issue, but downgrading to 6.0.0-r3 (current stable keyworded) fixed it for me.
Comment 6 Stig Nielsen 2020-04-09 20:11:47 UTC
I can confirm this. I have the same problem.
Comment 7 Andreas 2020-04-10 20:14:51 UTC
Exactly same problem here
Comment 8 wippie 2020-04-10 21:59:15 UTC
Same problem here, downgrading to libvirt-6.1.0 works.
dev-python/libvirt-python will block downgrading from 6.2.0 but can be managed.
Comment 9 Matthias Maier gentoo-dev 2020-04-11 00:26:57 UTC
I see a number of upstream changes between 6.1.0 and 6.2.0 with respect to pidfile handling that likely broke our openrc init scripts.

I unfortunately missed thatn one, because I am not using openrc any more. Time to spin up the openrc lxc container I guess.

I will update the init scripts for 6.2.0-r2 in a moment.
Comment 10 Larry the Git Cow gentoo-dev 2020-04-11 01:54:33 UTC
The bug has been closed via the following commit(s):

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

commit ca0a61eed33d17d0bd434ea5ad5c7bf2f891621c
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2020-04-11 01:45:30 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2020-04-11 01:45:30 +0000

    app-emulation/libvirt: update openrc init scripts
    
    Upstream changes between 6.1.0 and 6.2.0 on pidfile handling break our
    openrc init script due to a race condition. Work around this issue by
    not using the "-d" option (keeping the daemon in foreground) and let
    start-stop-daemon do double-forking ("-b" option).
    
    Closes: https://bugs.gentoo.org/716800
    Package-Manager: Portage-2.3.98, Repoman-2.3.22
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 app-emulation/libvirt/files/libvirtd.init-r19      | 33 ++++++++++++++++++++++
 app-emulation/libvirt/files/virtlockd.init-r2      | 23 +++++++++++++++
 app-emulation/libvirt/files/virtlogd.init-r2       | 23 +++++++++++++++
 ...irt-6.2.0-r1.ebuild => libvirt-6.2.0-r2.ebuild} |  6 ++--
 app-emulation/libvirt/libvirt-9999.ebuild          |  6 ++--
 5 files changed, 85 insertions(+), 6 deletions(-)
Comment 11 Stig Nielsen 2020-04-11 08:14:24 UTC
@Matthias Maier, Thank you for the quick response. I can't talk for the others but if you need someone to test, please feel free to contact me.
Comment 12 Andreas 2020-04-11 10:25:24 UTC
Please do not hasten to close this bug.
I still get the same problem even after using the new configs in dispatch-conf.

start libvirtd
 * start-stop-daemon: /usr/sbin/virtlogd is already running
 * ERROR: virtlogd failed to start
 * ERROR: cannot start libvirtd as virtlogd would not start

start virtlogd
 * start-stop-daemon: /usr/sbin/virtlogd is already running
 * ERROR: virtlogd failed to start

cat /var/log/libvirt/virtlogd
2020-04-10 19:50:22.521+0000: 20488: info : libvirt version: 6.2.0
2020-04-10 19:50:22.521+0000: 20488: info : hostname: maha.sukha.dhatu
2020-04-10 19:50:22.521+0000: 20488: error : main:851 : Failed to fork as daemon: No such file or directory
2020-04-11 09:40:48.289+0000: 3920: info : libvirt version: 6.2.0
2020-04-11 09:40:48.289+0000: 3920: info : hostname: maha.sukha.dhatu
2020-04-11 09:40:48.289+0000: 3920: error : main:851 : Failed to fork as daemon: No such file or directory

cat /run/virtlogd.pid
3922maha /etc/init.d # 

For me downgrading to stable did NOT do the trick nod did it adding the start() function...
Am i doing anything wrong?
Comment 13 Andreas 2020-04-11 10:40:44 UTC
I resolved this by chown root:libvirt /run/virtlogd.pid
and 
by deleting the pid number inside this file.
I am not sure which one did the trick but i can confirm that BOTH virtlogd and libvirtd now WORK!
Thanks a lot