Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 782808 - sys-apps/openrc-0.43.2 breaks some init scripts with checkpath
Summary: sys-apps/openrc-0.43.2 breaks some init scripts with checkpath
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: Normal major
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-14 09:28 UTC by Klemen Mihevc
Modified: 2021-05-11 05:33 UTC (History)
9 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 Klemen Mihevc 2021-04-14 09:28:16 UTC
new openrc breaks init scripts that are using checkpath if directory doesnt exist, for me those are mysql and dhcp server


For example, mysql init script checks if /var/run/mysqld exists with correct owners/permissions if it doesnt, openrc should fix the issues, but this isnt the case anymore in 0.43.2, works fine in 0.43.1. Obviously services fails to start, since it trys to create pid file inside directory that doesnt exist...

Reproducible: Always




mih ~ # emerge --info
Portage 3.0.18 (python 3.8.9-final-0, default/linux/amd64/17.1/hardened, gcc-10.3.0, glibc-2.33, 5.11.13-gentoo x86_64)
=================================================================
System uname: Linux-5.11.13-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_X5670_@_2.93GHz-with-glibc2.2.5
KiB Mem:    12268644 total,    176092 free
KiB Swap:   16777684 total,  16619476 free
Timestamp of repository gentoo: Wed, 14 Apr 2021 08:50:18 +0000
Head commit of repository gentoo: 1380ed9f5c981b2b856e534571c9f16010ab0340

sh bash 5.1_p4
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p4::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          3.8.9::gentoo
dev-util/cmake:           3.20.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/openrc:          0.43.1::gentoo
sys-apps/sandbox:         2.23::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.11::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: true

local
    location: /var/db/repos/local
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -pipe -O3 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -pipe -O3 -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH 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="-march=native -pipe -O3 -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install 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="-march=native -pipe -O3 -fomit-frame-pointer"
GENTOO_MIRRORS="https://mirror.netcologne.de/gentoo/ https://ftp.halifax.rwth-aachen.de/gentoo/ https://mirror.yandex.ru/gentoo-distfiles/"
LANG="sl_SI.utf8"
LDFLAGS="-Wl,-O3 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu"
LINGUAS="en sl"
MAKEOPTS="-j12 -l12"
PKGDIR="/var/cache/binpkgs"
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 acpi amd64 apache2 apng berkdb bittorrent btrfs bzip2 caps cgi cli client corefonts crypt curl dhcp dlz dovecot-sasl eap exif expat experimental extraengine fontconfig ftp gd gdbm glib gmp gssapi gzip hardened http2 iconv icu idn intl iptables ipv6 ithreads jpeg kerberos lcms libglvnd libtirpc lz4 lzma lzo managesieve mp3 multilib mysql mysqli ncurses nls nping nptl openmp openssl pam pci pcntl pcre pcre16 pcre32 pdo perl pie png posix python rar readline rpc rtmp samba seccomp server session sieve slang smtp soap sockets socks5 split-usr sqlite ssh ssl ssp suexec tcpd threads tiff tracepath truetype udev unicode urandom usb vhosts webui x264 x265 xattr xml xmlreader xmlrpc xmlwriter xslt xtpax xvid xz zip zlib zstd" 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 authn_dbd authn_socache authz_dbd cache_socache dbd http2 proxy proxy_html proxy_http proxy_http2 proxy_wstunnel xml2enc" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en sl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-0" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="geoip"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 kfm 2021-04-14 10:34:28 UTC
The summary references 0.43.2 but the emerge --info dump references 0.43.1. I take it that this is an artefact of having downgraded? If so, please install 0.43.2 again, then identify the checkpath command that is failing. For example, by executing "rc-service -d mysql start", which will emit the composed checkpath command to STDERR as part of a trace.
Comment 2 Klemen Mihevc 2021-04-14 10:40:01 UTC
Yes i downgraded. For mysql this one "fails":

+ checkpath -d --owner mysql:mysql --mode 0755 /var/run/mysqld

in version 0.43.1 if /var/run/mysqld doesnt exist you get that:
 * /var/run/mysqld: creating directory
 * /var/run/mysqld: correcting owner

in 0.43.2 it doesnt do anything and it acts like directory would exists (even if in fact it doesnt) and start-stop-daemon fails when it trys to create pid file inside non existing directory.
Comment 3 Klemen Mihevc 2021-04-14 10:55:27 UTC
For dhcp this one "fails":

+ checkpath -d -o dhcp:dhcp /var/run/dhcp /var/lib/dhcp
Comment 4 kfm 2021-04-14 11:18:01 UTC
Confirmed. In the case of mysql, it ends up creating /var/mysqld. This is somewhat embarrassing, given that 0.43.2 was released to address other issues with checkpath.

Here's a simple reproducer.

  path1=$(mktemp -u) path2=$(mktemp -d)
  ln -s "$path2" "$path1"
  /lib/rc/bin/checkpath -d "$path1/testdir"

It will report something like:-

 * /tmp/tmp.ymrlQTGr46/testdir: creating directory

However, it will have created /tmp/testdir instead. It will even exhibit this behaviour in the case of a dangling symlink.
Comment 5 Klemen Mihevc 2021-04-14 11:21:43 UTC
Yes now i see extra directorys where there shouldnt be :)
Comment 6 Larry the Git Cow gentoo-dev 2021-04-14 12:33:29 UTC
The bug has been referenced in the following commit(s):

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

commit 67b5f3cdb78af179e98c90e7a6d30937c683d6e2
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2021-04-14 12:30:55 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2021-04-14 12:32:53 +0000

    QA: package.mask sys-apps/openrc-0.43.2, bug 782808
    
    Bug: https://bugs.gentoo.org/782808
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 profiles/package.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 7 konsolebox 2021-04-14 23:58:39 UTC
(In reply to Kerin Millar from comment #4)
>   path1=$(mktemp -u) path2=$(mktemp -d)
>   ln -s "$path2" "$path1"
>   /lib/rc/bin/checkpath -d "$path1/testdir"

Why isn't -s needed here?
Comment 8 kfm 2021-04-15 00:31:11 UTC
(In reply to konsolebox from comment #7)
> (In reply to Kerin Millar from comment #4)
> >   path1=$(mktemp -u) path2=$(mktemp -d)
> >   ln -s "$path2" "$path1"
> >   /lib/rc/bin/checkpath -d "$path1/testdir"
> 
> Why isn't -s needed here?

As of https://github.com/OpenRC/openrc/commit/b6fef59, the -s option has no effect for GNU/Linux. Note the checks for the availability of O_PATH.
Comment 9 William Hubbs gentoo-dev 2021-04-15 16:08:35 UTC
The issue happens because /var/run is a symlink and the change between
0.43.1 and 0.43.2 broke this case, so I will work on this today.
Comment 10 Larry the Git Cow gentoo-dev 2021-04-16 02:31:14 UTC
The bug has been closed via the following commit(s):

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

commit 416ca4b2c4fb7f995a67fe75e878bbc6ddb05a70
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2021-04-16 02:28:25 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2021-04-16 02:30:33 +0000

    sys-apps/openrc-0.43.3 bump
    
    Closes: https://bugs.gentoo.org/782808
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 sys-apps/openrc/Manifest             |   1 +
 sys-apps/openrc/openrc-0.43.3.ebuild | 187 +++++++++++++++++++++++++++++++++++
 2 files changed, 188 insertions(+)
Comment 11 tka 2021-04-17 10:16:01 UTC
openrc-0.43.3 is masked by:

# Andreas K. Hüttel <dilfridge@gentoo.org> (2021-04-14)
# QA: Mask sys-apps/openrc-0.43 because of bug 782808
=sys-apps/openrc-0.43*

Please unmask the new version.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-17 23:56:07 UTC
(In reply to tka from comment #11)
> openrc-0.43.3 is masked by:
> 
> # Andreas K. Hüttel <dilfridge@gentoo.org> (2021-04-14)
> # QA: Mask sys-apps/openrc-0.43 because of bug 782808
> =sys-apps/openrc-0.43*
> 
> Please unmask the new version.

I’d suggest we wait a bit longer given recent issues.
Comment 13 Aisha Tammy 2021-05-06 12:23:46 UTC
Can it be unmasked now?
Comment 14 Klemen Mihevc 2021-05-06 12:24:57 UTC
Well im using it since a day it was fixed and works fine for me.
Comment 15 Larry the Git Cow gentoo-dev 2021-05-11 05:33:23 UTC
The bug has been referenced in the following commit(s):

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

commit ba4abe935aa276b78dbde37a4b4ab67fd117dc11
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2021-05-11 05:32:26 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-05-11 05:32:26 +0000

    profiles: unmask openrc-0.43*
    
     - the bug has been fixed, and broken version removed from the tree a long
       time ago.
    
    Bug: https://bugs.gentoo.org/782808
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 profiles/package.mask | 4 ----
 1 file changed, 4 deletions(-)