From: Vincent Stemen <zsh@hightek.org>
To: zsh-users@sunsite.dk
Subject: Possible bug in zsh
Date: Mon, 29 Dec 2003 02:02:22 -0600 [thread overview]
Message-ID: <20031229080222.GA75453@quark.localdomain> (raw)
I think I may have encountered a bug in Z shell. It began when I
tried linking /bin/sh to zsh on FreeBSD-5.1. When it reboots, I get a
lot of errors from the init scripts because the rootfs does not get
re-mounted read-writable. I have isolated the piece of init script
code and included a small script below, extracted from the init
scripts and modified for testing, that reproduces the problem. See
the comments in the script.
The problem goes away if I remove the [ -n "$_precmd" ] statement
which, so far as I can tell, should have no effect on the following if
statement where the problem is. I tested with zsh-4.0.9 and
zsh-4.1.0.dev5.
<script>
root_start()
{
# This function normally remounts / in rw mode
echo "<< Running root_start() >>"
}
_cmd=root_start
if [ -n "$_cmd" ]; then
# if the precmd failed and force
# isn't set, exit
#
# Remove or comment out these two lines and the problem goes away.
# ie. zsh does not return 1 in the next statement.
[ -n "$_precmd" ] &&
echo "run_rc_command: evaluating ${_precmd}()."
# $_precmd is null.
# zsh enters this if statement and returns 1, causing root_start() to
# never get run, thus leaving /
# mounted ro. FreeBSD's sh and bash do not.
if ! eval $_precmd && [ -z "$rc_force" ]; then
return 1
fi
[ -n "$_cmd" ] &&
echo "run_rc_command: evaluating ${_cmd}()."
if ! eval $_cmd && [ -z "$rc_force" ]; then
return 1
fi
return 0
fi
</script>
--
Vincent Stemen
Avoid the VeriSign/Network Solutions domain registration trap!
http://www.InetAddresses.net
next reply other threads:[~2003-12-29 8:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-29 8:02 Vincent Stemen [this message]
2003-12-29 9:21 ` Wayne Davison
2004-01-01 23:38 ` Wayne Davison
2004-01-02 1:32 ` James Devenish
2004-01-03 23:09 ` Vincent Stemen
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=20031229080222.GA75453@quark.localdomain \
--to=zsh@hightek.org \
--cc=zsh-users@sunsite.dk \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).