public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Daniel Frey <djqfrey@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] silencing distcc with systemd
Date: Fri, 29 Mar 2024 22:38:42 -0700	[thread overview]
Message-ID: <3fe654a8-74eb-4ba3-a7c3-acf4f81f2060@gmail.com> (raw)

Hi all,

I've moved a couple of machines from openrc to systemd.

I have discovered this odd problem. On openrc, distcc was quiet during 
building packages. It would obey environment variable set in /etc/env.d:

DISTCC_DIR=/var/distcc
DISTCC_ENABLE_DISCREPANCY_EMAIL=
DISTCC_FALLBACK=1
DISTCC_SAVE_TEMPS=0
DISTCC_SSH=
DISTCC_TCP_CORK=
DISTCC_VERBOSE=0

This currently shows up in the enviroment (checked with `set`.)

However, on systemd it spams messages in build logs:

distccd[290662] (dcc_check_compiler_masq) Warning: 
x86_64-pc-linux-gnu-g++ on distccd's path is 
/usr/lib/distcc/bin/x86_64-pc-linux-gnu-g++ and really a link to 
/usr/bin/distcc
distcc[293558] (dcc_trace_version) distcc 3.4 x86_64-pc-linux-gnu; built 
Mar 28 2024 05:05:38
distcc[293558] (dcc_recursion_safeguard) safeguard: 1
distcc[293558] (dcc_recursion_safeguard) safeguard level=1
distcc[293558] (main) compiler name is "x86_64-pc-linux-gnu-g++"
distcc[293558] (dcc_set_path) setting 
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin:/usr/lib/llvm/17/bin
distcc[293558] exec on localhost: x86_64-pc-linux-gnu-g++ -O2 -pipe 
-march=znver3 -felide-constructors -fno-strict-aliasing -pie -fPIC 
-fstack-protector --param=ssp-buffer-size=4 -Wconversion 
-Wno-sign-conversion -fno-omit-frame-pointer -Wall -Wenum-compare 
-Wenum-conversion -Wextra -Wformat-security -Wmissing-braces 
-Wno-format-truncation -Wno-init-self -Wno-nonnull-compare 
-Wno-unused-parameter -Woverloaded-virtual -Wnon-virtual-dtor -Wvla 
-Wwrite-strings -std=gnu++11 -fvisibility=hidden -o 
/tmp/distccd_9988a064.o -c /tmp/distccd_998ea064.ii
distcc[293558] (dcc_mkdir) ERROR: mkdir '/dev/null/.distcc' failed: Not 
a directory
distcc[293558] (dcc_spawn_child) forking to execute: 
x86_64-pc-linux-gnu-g++ -O2 -pipe -march=znver3 -felide-constructors 
-fno-strict-aliasing -pie -fPIC -fstack-protector 
--param=ssp-buffer-size=4 -Wconversion -Wno-sign-conversion 
-fno-omit-frame-pointer -Wall -Wenum-compare -Wenum-conversion -Wextra 
-Wformat-security -Wmissing-braces -Wno-format-truncation -Wno-init-self 
-Wno-nonnull-compare -Wno-unused-parameter -Woverloaded-virtual 
-Wnon-virtual-dtor -Wvla -Wwrite-strings -std=gnu++11 
-fvisibility=hidden -o /tmp/distccd_9988a064.o -c /tmp/distccd_998ea064.ii
distcc[293558] (dcc_spawn_child) child started as pid293559
distcc[293559] (dcc_increment_safeguard) setting safeguard: 
_DISTCC_SAFEGUARD=2
/var/tmp/portage/dev-db/mariadb-10.6.17/work/mysql/storage/innobase/fsp/fsp0file.cc: 
In member function ‘dberr_t Datafile::validate_for_recovery()’:
/var/tmp/portage/dev-db/mariadb-10.6.17/work/mysql/storage/innobase/fsp/fsp0file.cc:419:16: 
warning: this statement may fall through [-Wimplicit-fallthrough=]
/var/tmp/portage/dev-db/mariadb-10.6.17/work/mysql/storage/innobase/fsp/fsp0file.cc:429:2: 
note: here
distcc[293558] (dcc_collect_child) cc child 293559 terminated with status 0
distcc[293558] (dcc_collect_child) cc times: user 0.000000s, system 
0.000000s, 0 minflt, 0 majflt
distcc[293558] compile (null) on localhost completed ok
distcc[293558] elapsed compilation time 1.651658s
distcc[293558] (dcc_exit) exit: code 0; self: 0.000832 user 0.000832 
sys; children: 1.523681 user 0.134703 sys
distcc[293558] (dcc_mkdir) ERROR: mkdir '/dev/null/.distcc' failed: Not 
a directory
distcc[293558] (dcc_cleanup_tempfiles_inner) deleted 0 temporary files


I was trying to solve this problem and it's normally set in the 
environment as above.

I read systemd uses a different mechanism, but it doesn't work.

I did set /etc/systemd/system/distccd.service.d/00gentoo.conf as per 
instructions I found on the wiki:
Environment="DISTCC_VERBOSE=0"
Environment="DISTCC_SAVE_TEMPS=0"
Environment="DISTCC_DIR=/var/distcc"

Reloaded using `systemctl daemon-reload` and restarted distccd - 
although this is happening on the client side and it's not really the 
daemon (as far as I can tell.) The output is showing up while compiling 
using emerge.

I can see it's sourcing this file:
distccd.service - Distccd: A Distributed Compilation Server
      Loaded: loaded (/etc/systemd/system/distccd.service; enabled; 
preset: disabled)
     Drop-In: /etc/systemd/system/distccd.service.d
              └─00gentoo.conf
      Active: active (running) since Fri 2024-03-29 22:04:12 PDT; 29min ago

Is there some other place that needs this environment set?

It clearly isn't getting the environment set somewhere in systemd as 
this error is solved with the DISTCC_DIR in the file sourced above:

distcc[293558] (dcc_mkdir) ERROR: mkdir '/dev/null/.distcc' failed: Not 
a directory

...and the DISTCC_VERBOSE=0 is supposed to silence build messages.

Any insight would be helpful... as this problem is easily solved in 
openrc but it seem to be rather difficult with systemd.

Dan


             reply	other threads:[~2024-03-30  5:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-30  5:38 Daniel Frey [this message]
2024-03-31 20:57 ` [gentoo-user] Re: silencing distcc with systemd Daniel Frey
2024-03-31 20:59   ` Alexandru N. Barloiu
2024-03-31 21:03     ` Daniel Frey
2024-03-31 21:08       ` Alexandru N. Barloiu
2024-03-31 21:32       ` Alexandru N. Barloiu
2024-04-01 14:46         ` Daniel Frey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fe654a8-74eb-4ba3-a7c3-acf4f81f2060@gmail.com \
    --to=djqfrey@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox