From: Petr Vorel <pvorel@suse.cz>
To: Torsten Hilbrich <torsten.hilbrich@secunet.com>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: v6.1-rc1: Regression in notification of sethostname changes
Date: Wed, 19 Oct 2022 14:31:18 +0200 [thread overview]
Message-ID: <Y0/uFkggIJMjxcpi@pevik> (raw)
In-Reply-To: <Y0/DlHMIPbRDG+fF@pevik>
> Hi Torsten,
> > Hello Petr,
> > your commit
> > commit bfca3dd3d0680fc2fc7f659a152234afbac26e4d
> > Author: Petr Vorel <pvorel@suse.cz>
> > Date: Thu Sep 1 21:44:03 2022 +0200
> > kernel/utsname_sysctl.c: print kernel arch
> > Print the machine hardware name (UTS_MACHINE) in /proc/sys/kernel/arch.
> > This helps people who debug kernel with initramfs with minimal environment
> > (i.e. without coreutils or even busybox) or allow to open sysfs file
> > instead of run 'uname -m' in high level languages.
> > broke the notification mechanism between the sethostname syscall and the pollers of /proc/sys/kernel/hostname.
> > The table uts_kern_table is addressed within uts_proc_notify by the enum value, however no new enum value was added in "enum uts_proc".
> > I noticed the problem when journald-systemd failed to detect hostname changes made with the sethostname syscall (as used by the hostname tool).
> > When setting the hostname through /proc/sys/kernel/hostname the poll notification was working.
> Thanks a lot for your report, working on a fix!
> Andrew, Greg, sorry for a regression.
Hi Torsten,
could you please post exact steps to reproduce the problem.
Although the required fix to add new enum into enum uts_proc is trivial,
I was not able to reproduce the problem with 6.1.0-rc1 (actually
6.1.0-rc1-4.g1d716d8-default which contains few extra patches).
# hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname
opensuse-tumbleweed.20221001
opensuse-tumbleweed.20221001
opensuse-tumbleweed.20221001
# hostnamectl set-hostname foo; echo $?
0
# hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname
foo
foo
foo
# hostname bar; echo $?
0
# hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname
bar
bar
bar
# echo "baz" > /proc/sys/kernel/hostname
# hostname; hostnamectl hostname; cat /proc/sys/kernel/hostname
baz
baz
baz
# hostnamectl set-hostname foo; reboot
After reboot it's 'foo'.
What am I missing?
BTW I originally tested the feature only on dracut initramfs (with rapido [1]),
which obviously bypass systemd. For a fix I'm creating rpm package (binrpm-pkg).
Kind regards,
Petr
[1] https://github.com/rapido-linux/rapido
> Kind regards,
> Petr
> > Torsten
next prev parent reply other threads:[~2022-10-19 12:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 8:29 v6.1-rc1: Regression in notification of sethostname changes Torsten Hilbrich
2022-10-19 9:29 ` Petr Vorel
2022-10-19 12:31 ` Petr Vorel [this message]
2022-10-19 12:50 ` Torsten Hilbrich
2022-10-20 10:30 ` Petr Vorel
2022-10-20 12:43 ` Thorsten Leemhuis
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=Y0/uFkggIJMjxcpi@pevik \
--to=pvorel@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torsten.hilbrich@secunet.com \
/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