Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 377277 - /lib/rc/sh/runscript.sh: printf: not found after shutdown
Summary: /lib/rc/sh/runscript.sh: printf: not found after shutdown
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All FreeBSD
: Normal normal
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-01 12:42 UTC by Dmitri Bogomolov
Modified: 2011-08-13 03:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
freebsd-ubin-8.2.ebuild.patch (freebsd-ubin-8.2.ebuild.patch,389 bytes, patch)
2011-08-09 19:38 UTC, Dmitri Bogomolov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitri Bogomolov 2011-08-01 12:42:35 UTC
This message appear every time I shutdown g/fbsd (any version) in this context:

* Unmounting /usr
/lib/rc/sh/runscript.sh: printf: not found
* Unmounting
* in use but fuser finds nothing             [!!]

Maybe some script invokes `/usr/bin/printf' after /usr being unmounted. I suspect it is `/lib/rc/sh/rc-mount.sh'

Reproducible: Always
Comment 1 Naohiro Aota gentoo-dev 2011-08-04 10:43:37 UTC
Actually, "printf" is shell built-in command on bash. OpenRC default
to use /bin/sh to execute their scripts and /bin/sh is usually bash on
Linux, so there's no problem on Linux. OTOH on FreeBSD /bin/sh is not
bash. FreeBSD /bin/sh doesn't have shell built-in printf, so this
problem occur.

OpenRC team,

What this "printf" mean? I cannot get what this code want to do, so I
can't think of alternative ways.
Comment 2 William Hubbs gentoo-dev 2011-08-04 15:11:57 UTC
After looking at the code briefly, I'm wondering if "echo -n" is what we
want here.

Does anyone else on the team have any suggestions?
Comment 3 SpanKY gentoo-dev 2011-08-06 10:17:38 UTC
no.  `echo -n` is not portable.  `printf` however is required by POSIX to be available.  if g/fbsd is not providing it (either via the shell or a dedicated binary in $PATH), then it is broken.
Comment 4 Javier Villavicencio (RETIRED) gentoo-dev 2011-08-07 23:52:58 UTC
# equery b /usr/bin/printf
 * Searching for /usr/bin/printf ...
sys-freebsd/freebsd-ubin-8.2 (/usr/bin/printf)

Just move freebsd-ubin' printf to /bin and we should be good for that case when /usr is unmounted.
Comment 5 Dmitri Bogomolov 2011-08-09 19:38:31 UTC
Created attachment 282749 [details, diff]
freebsd-ubin-8.2.ebuild.patch

This simple change to freebsd-ubin-8.2.ebuild is to move printf to /bin.
Comment 6 SpanKY gentoo-dev 2011-08-11 04:11:07 UTC
makes sense to me
Comment 7 Javier Villavicencio (RETIRED) gentoo-dev 2011-08-13 03:07:53 UTC
Applied in cvs, thanks.