Make einfo routines private

The libeinfo library has no consumers other than OpenRC, so there is no
reason for it to be maintained as a library. The einfo routines are now
an object that links with the rc binary.
fix cgroup_cleanup function

The yesno test for rc_cgroup_cleanup belongs at the point where this
function is called from runscript, not in the function itself.

X-Gentoo-Bug: 486210
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=486210
start-stop-daemon: fix eerorr calls in get_pid

The eerror calls in this function make it too verbose, so change them to
ewarnv() calls instead. This means that they will only print if the
--verbose option is used or EINFO_VERBOSE=yes is set in the environment.
librc: fix off-by-one bug

We need allocate space for both the added leading '-' and the trailing
'\0'.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
librc: fix a read off-by-one bug

We should first check if we are within bounds and then read rather than
the opposite.

This makes valgrind happy.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
FL-786: localmount: support filesystem mounting on openvz
start-stop-daemon: fix do_stop calls

Several calls to do_stop were forcing the test parameter to be true,
which was causing extra output to the terminal, such as:

* Would send signal 0 to pid xxxxx

This should only happen if the --test command line option was used.
netmount: add -lxc keyword

Netmount should not run on lxc, thanks to Mark van Dijk <funtoo@internecto.net>.
convert flock() messages to verbose warnings

Convert these messages to warnings that are only displayed if
EINFO_VERBOSE is set to yes in the environment.

This is based on a suggestion from Patrick Lauer <patrick@gentoo.org>.

X-Gentoo-Bug: 487588
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487588
Add uml keyword to fsck service.

Fix relevant an issue mentioned by Toralf Förster.

X-Gentoo-Bug: 481096.
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=481096
remove redundant sync calls

The localmount and mount-ro scripts were flushing pending disk writes by
calling sync twice in succession. This is no longer necessary; see the
bug report and blog post for reasons we were still doing this.

Reported-by: Patrick Lauer <patrick@gentoo.org>
X-Gentoo-Bug: 487382
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487382
Revert "Make einfo routines private"

This reverts commit de88aff0a839844526ae262f8961ec4372fed238.
I was advised that splashutils links to libeinfo, so we do have a
consumer for this library.
librc: do not allow "." and ".." as runlevel names

The rc_runlevel_exists function was attempting to treat "." and ".." as
valid runlevels; however, this should not be allowed.

X-Gentoo-Bug: 488710
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=488710
loopback: do not run in a prefix or vserver

X-Gentoo-Bug: 489370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489370
bootmisc: do not run clean_run on VSERVER systems

X-Gentoo-Bug: 489370
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489370
Begin port to GNU/kFreeBSD

This is just a minimal port to get Debian up and running; the rest will
be done later.
Fix the service-level rc_verbose setting

This commit fixes the rc_verbose setting so that it is honored if it is
set for an individual service.

Thanks to whissi@whissi.de for the original patch; this one is slightly
modified to be more posix.

X-Gentoo-Bug: 489358
X-Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=489358
functions.sh: yesno: (mostly) fix eval logic

We need to quote the expansion.

X-Gentoo-Bug: 475032
X-Gentoo-Bug: https://bugs.gentoo.org/475032
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
rc-update: make "service already installed" message informational

This message was being sent to stderr, and it should be sent to
stdout since it is informational. This change was requested by
zero_chaos.
remove type command

The posix equivalent of the type command is "command -v", so now we use
that. Thanks to Jonathan Callen <jcallen@gentoo.org> for informing me
wrt the fix.