public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-man@vger.kernel.org
Subject: [Bug 217547] New: The shell example in time_namespaces doesn't behave as documented
Date: Tue, 13 Jun 2023 15:00:48 +0000	[thread overview]
Message-ID: <bug-217547-11311@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=217547

            Bug ID: 217547
           Summary: The shell example in time_namespaces doesn't behave as
                    documented
           Product: Documentation
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: man-pages
          Assignee: documentation_man-pages@kernel-bugs.osdl.org
          Reporter: goeran@uddeborg.se
        Regression: No

Trying the shell example in the manual page for time_namespaces(7) does not
behave for me the way the manual page says it should. From what I can tell, it
appears that the new shell ITSELF immediately enters the new namespace, rather
than allowing for children to enter. This makes it impossible to write anything
to the time_for_children file.

Using the --boottime flag to unshare gives the expected behavior. Does an
exec() trigger entering the new time namespace nowadays? 

This was tested on a Fedora 38 system running kernel 6.2.14-300.fc38.

Example session:

kalle$$ readlink /proc/$$/ns/time
time:[4026531834]
kalle$$ LANG=en_US.utf8 PS1="ns2# " sudo unshare -T -- bash --norc
[sudo] password for göran: 
bash-5.2# echo "monotonic $((2*24*60*60)) 0" > /proc/$$/timens_offsets
bash: echo: write error: Permission denied
bash-5.2# readlink /proc/$$/ns/time
time:[4026532249]
bash-5.2# readlink /proc/$$/ns/time_for_children
time:[4026532249]

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

             reply	other threads:[~2023-06-13 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 15:00 bugzilla-daemon [this message]
2023-06-25 12:06 ` [Bug 217547] The shell example in time_namespaces doesn't behave as documented bugzilla-daemon
2023-06-25 15:59 ` bugzilla-daemon

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=bug-217547-11311@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-man@vger.kernel.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