Compare commits

...

13 Commits

Author SHA1 Message Date
William Hubbs
bd4cafbbf3 Update ChangeLog 2016-07-31 14:05:41 -05:00
William Hubbs
61e211c1c4 init.d: initial service adjustments for docker support
Add -docker keyword to the same scripts that have -lxc keyword.
2016-07-31 13:50:05 -05:00
William Hubbs
40d3795fba librc: fix Docker auto detection
The original auto detection of Docker containers assumed the presence of
a container environment variable. However, Docker-1.12 does not
implement this, and I'm not sure which versions of docker implemented
it.

The new test is for the presence of a file named .dockerenv in the
root directory.
2016-07-31 13:50:05 -05:00
Doug Freed
fa39271d7a rc-logger: refuse to cat TMPLOG into itself
This prevents an infinite loop in case somebody decides to set
rc_log_path to match TMPLOG.
2016-07-31 13:50:05 -05:00
Julian Ospald
0077e54146 Build: fix hardcoded pkg-config invocation
This fixes #89.
2016-07-31 13:50:05 -05:00
William Hubbs
871fa56baa version 0.21.3 2016-07-31 13:49:33 -05:00
William Hubbs
53f6bd3690 update changelog 2016-07-06 12:24:06 -05:00
William Hubbs
6074cbd651 hwclock: always use --noadjfile if available
When we use the --utc or --localtime switch, also use --noadjfile if it
is available. This means hwclock will not use a drift file.

X-Gentoo-Bug: 584722
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=584722
2016-07-06 12:22:49 -05:00
William Hubbs
8b9ea8b9e6 version 0.21.2 2016-07-06 12:20:32 -05:00
William Hubbs
c47b497483 update changelog 2016-06-28 16:34:42 -05:00
Benda Xu
977811563d Fix PATH for Prefix.
1. remove default /bin:/sbin:/usr/bin:/usr/sbin
2. PKG_PREFIX should be defaulted to $(PREFIX)/usr
3. LOCAL_PREFIX should be defaulted to $(PREFIX)/usr/local

X-Gentoo-Bug:583634
X-Gentoo-Bug-URL:https://bugs.gentoo.org/show_bug.cgi?id=583634
2016-06-28 14:37:47 -05:00
William Hubbs
47aa0b93cd fstabinfo/mountinfo: ensure /etc/fstab exists before calling setmntent
This is based on a patch by A. Wilcox <awilfox.gentoo@foxkit.us>.

X-Gentoo-Bug: 478226
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478226

X-Gentoo-Bug: 478226
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478226
2016-06-28 14:37:47 -05:00
William Hubbs
f680c89c26 version 0.21.1 2016-06-28 14:35:20 -05:00
32 changed files with 172 additions and 120 deletions

195
ChangeLog
View File

@@ -1,3 +1,117 @@
commit 61e211c1c4f51fdb8babb9a70ed7ce138d71c80b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
init.d: initial service adjustments for docker support
Add -docker keyword to the same scripts that have -lxc keyword.
commit 40d3795fbacc70349a52efc670a22458f4e2d7c4
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
librc: fix Docker auto detection
The original auto detection of Docker containers assumed the presence of
a container environment variable. However, Docker-1.12 does not
implement this, and I'm not sure which versions of docker implemented
it.
The new test is for the presence of a file named .dockerenv in the
root directory.
commit fa39271d7a979ec8c1cf9c694d256456528baaf8
Author: Doug Freed <dwfreed@mtu.edu>
Commit: William Hubbs <w.d.hubbs@gmail.com>
rc-logger: refuse to cat TMPLOG into itself
This prevents an infinite loop in case somebody decides to set
rc_log_path to match TMPLOG.
commit 0077e54146c0c6180769bb5fa2d8da2924038baa
Author: Julian Ospald <hasufell@posteo.de>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Build: fix hardcoded pkg-config invocation
This fixes #89.
commit 871fa56baaa0f1ae2b6531303f73f18acd74a71e
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
version 0.21.3
commit 53f6bd369057fd0f48c6ecfa813d35bfe47196cd
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
update changelog
commit 6074cbd651da7f27fc6fbc20a66f651c2577857b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
hwclock: always use --noadjfile if available
When we use the --utc or --localtime switch, also use --noadjfile if it
is available. This means hwclock will not use a drift file.
X-Gentoo-Bug: 584722
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=584722
commit 8b9ea8b9e6631d5cd987a7cb31560aa5a13c060b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
version 0.21.2
commit c47b497483040107263c9b9984474db5c569485b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
update changelog
commit 977811563dd93cab7a64caefa0e86f5b864fc04f
Author: Benda Xu <heroxbd@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Fix PATH for Prefix.
1. remove default /bin:/sbin:/usr/bin:/usr/sbin
2. PKG_PREFIX should be defaulted to $(PREFIX)/usr
3. LOCAL_PREFIX should be defaulted to $(PREFIX)/usr/local
X-Gentoo-Bug:583634
X-Gentoo-Bug-URL:https://bugs.gentoo.org/show_bug.cgi?id=583634
commit 47aa0b93cdf14253c3a75b4feefabe97c43cbf8a
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
fstabinfo/mountinfo: ensure /etc/fstab exists before calling setmntent
This is based on a patch by A. Wilcox <awilfox.gentoo@foxkit.us>.
X-Gentoo-Bug: 478226
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478226
X-Gentoo-Bug: 478226
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=478226
commit f680c89c26709164934ee72534af7a3960166cf3
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
version 0.21.1
commit 5bfb7d6c77ff533e34e2bbfe5b6e57410d961d70
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Update ChangeLog
commit 12c8248b5f53879935d4e62ef42023f703c7b636
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
@@ -1004,84 +1118,3 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
mountinfo: fix -e and -E options
Add the -e and -E options to getoptstring so they are recognized.
commit eeadca0b8a5b87c26e60a58563251604350a7a3b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Add EERROR_QUIET and EINFO_QUIET to environment whitelist
commit dde339070b4850dc1fadf4992cc01d3468992106
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Increment version
commit 1736be3bc3ebbc1440f87b49fc353e81fb0a6037
Author: Doug Freed <dwfreed@mtu.edu>
Commit: Doug Freed <dwfreed@mtu.edu>
savecache: Fix unable to create cache message
The cache is created in $RC_LIBEXECDIR, not $RC_SVCDIR, so fix the error
message when we fail to create it to match.
commit a36a635b016a7427dd1739a26c951fedf22f0dec
Author: Mike Gilbert <floppym@gentoo.org>
Commit: Doug Freed <dwfreed@mtu.edu>
tmpfiles: Recognize type 'v' (create btrfs subvol)
This change does NOT implement btrfs subvol creation. Instead, it
treats 'v' the same as 'd', which is an acceptable fallback
according to the manual.
Fixes #58
commit 9310ccc06bcadd8897aed51cd51c94fccb7d9c07
Author: Mike Gilbert <floppym@gentoo.org>
Commit: Doug Freed <dwfreed@mtu.edu>
Remove execute bit from tmpfiles.sh.in
commit 0c2e4eb3cd7935d375b74099a3a9a5fe519e6cab
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Update ChangeLog
commit d2ce07e227ec95370e8aee5f1199edc6ad61aff9
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Add rc-sstat script
The rc-sstat script is written to display status of s6 services and
run rc-status to display all services status.
This currently only works on Linux.
commit b209fe3859c05c286037843bb34058f849c54b15
Author: Mike Gilbert <floppym@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
bootmisc: Don't call dmesg in systemd-nspawn containers
This fixes #57.
commit c94c8288cd5217b01c24d6f048c64ebbc30bee02
Author: Mike Frysinger <vapier@gentoo.org>
Commit: Mike Frysinger <vapier@gentoo.org>
fix link to s6 website
commit bcb9c44e73ccf332c7c961a6f82520699c6e776d
Author: Mike Gilbert <floppym@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
man: Document the stopsig variable
This variable can be used to set the signal to send if the service is
using start-stop-daemon.
This fixes #56

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.21
VERSION= 0.21.3
PKG= ${NAME}-${VERSION}

View File

@@ -15,7 +15,7 @@ depend()
{
after procfs
use modules devfs
keyword -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -15,7 +15,7 @@ depend()
{
need localmount termencoding
after hotplug bootmisc modules
keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
}
start()

View File

@@ -15,7 +15,7 @@ depend()
{
provide dev-mount
before dev
keyword -prefix -systemd-nspawn -vserver -lxc
keyword -docker -lxc -prefix -systemd-nspawn -vserver
}
mount_dev()

View File

@@ -14,7 +14,7 @@ description="Set the dmesg level for a cleaner boot"
depend()
{
before dev modules
keyword -lxc -prefix -systemd-nspawn -vserver
keyword -docker -lxc -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -16,7 +16,7 @@ _IFS="
depend()
{
use dev clock modules
keyword -jail -openvz -prefix -systemd-nspawn -timeout -vserver -lxc -uml
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -timeout -vserver -uml
}
_abort() {

View File

@@ -12,7 +12,7 @@
description="Sets the hostname of the machine."
depend() {
keyword -prefix -systemd-nspawn -lxc
keyword -docker -lxc -prefix -systemd-nspawn
}
start()

View File

@@ -35,7 +35,7 @@ depend()
else
before *
fi
keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
}
setupopts()
@@ -69,6 +69,16 @@ _hwclock()
return 1
}
get_noadjfile()
{
if ! yesno $clock_adjfile; then
# Some implementations don't handle adjustments
if LC_ALL=C hwclock --help 2>&1 | grep -q "\-\-noadjfile"; then
echo --noadjfile
fi
fi
}
start()
{
local retval=0 errstr=""
@@ -91,16 +101,16 @@ start()
fi
# Always set the kernel's time zone.
_hwclock --systz $utc_cmd $clock_args
_hwclock --systz $utc_cmd $(get_noadjfile) $clock_args
: $(( retval += $? ))
if [ -e /etc/adjtime ] && yesno $clock_adjfile; then
_hwclock --adjust $utc_cmd
_hwclock --adjust $utc_cmd $(get_noadjfile)
: $(( retval += $? ))
fi
if yesno ${clock_hctosys:-YES}; then
_hwclock --hctosys $utc_cmd $clock_args
_hwclock --hctosys $utc_cmd $(get_noadjfile) $clock_args
: $(( retval += $? ))
fi
@@ -122,14 +132,7 @@ stop()
ebegin "Setting hardware clock using the system clock" "[$utc]"
if ! yesno $clock_adjfile; then
# Some implementations don't handle adjustments
if LC_ALL=C hwclock --help 2>&1 | grep -q "\-\-noadjfile"; then
utc_cmd="$utc_cmd --noadjfile"
fi
fi
_hwclock --systohc $utc_cmd $clock_args
_hwclock --systohc $utc_cmd $(get_noadjfile) $clock_args
retval=$?
eend $retval "Failed to sync clocks"
@@ -144,5 +147,5 @@ save()
show()
{
setupopts
hwclock --show "$utc_cmd" $clock_args
hwclock --show "$utc_cmd" $(get_noadjfile) $clock_args
}

View File

@@ -15,7 +15,7 @@ depend()
{
need localmount termencoding
after bootmisc
keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
}
start()

View File

@@ -16,7 +16,7 @@ depend()
need fsck
use lvm modules mtab
after lvm modules
keyword -jail -prefix -systemd-nspawn -vserver -lxc
keyword -docker -jail -lxc -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -14,7 +14,7 @@ description="Loads a user defined list of kernel modules."
depend()
{
use isapnp
keyword -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -14,7 +14,7 @@ description="Re-mount filesytems read-only for a clean reboot."
depend()
{
need killprocs savecache
keyword -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -15,7 +15,7 @@ depend()
{
after modules
need sysfs
keyword -jail -lxc -openvz -prefix -systemd-nspawn -uml -vserver
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -uml -vserver
}
get_interfaces()

View File

@@ -24,7 +24,7 @@ depend()
want $mywant
use afc-client amd openvpn
use dns
keyword -jail -prefix -systemd-nspawn -vserver -lxc
keyword -docker -jail -lxc -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -16,7 +16,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
depend()
{
need localmount
keyword -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
}
_setleds()

View File

@@ -15,7 +15,7 @@ depend()
{
use modules devfs
need localmount
keyword -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -14,7 +14,7 @@ description="Mount the root fs read/write"
depend()
{
need fsck
keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -12,7 +12,7 @@
depend()
{
before localmount
keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -12,7 +12,7 @@
depend()
{
need localmount
keyword -jail -openvz -prefix -systemd-nspawn -vserver -lxc
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -vserver
}
start()

View File

@@ -15,7 +15,7 @@ depend()
{
before *
provide clock
keyword -openvz -prefix -systemd-nspawn -uml -vserver -xenu -lxc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
}
# swclock is an OpenRC built in

View File

@@ -15,7 +15,7 @@ sysfs_opts=nodev,noexec,nosuid
depend()
{
keyword -lxc -prefix -systemd-nspawn -vserver
keyword -docker -lxc -prefix -systemd-nspawn -vserver
}
mount_sys()

View File

@@ -16,7 +16,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
depend()
{
keyword -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
use root
after bootmisc
}

View File

@@ -15,7 +15,7 @@ description="Initializes the random number generator."
depend()
{
need localmount
keyword -jail -lxc -openvz -prefix -systemd-nspawn
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn
}
save_seed()

View File

@@ -3,4 +3,6 @@
ifeq (${MKPREFIX},yes)
CPPFLAGS+= -DPREFIX
PKG_PREFIX?= $(PREFIX)/usr
SED_EXTRA= -e '/_PATH=.*usr.bin/d'
endif

View File

@@ -13,7 +13,7 @@
_OS_SH= uname -s | tr '/' '-'
_OS:= $(shell ${_OS_SH})
OS?= ${_OS}
include ${MK}/os-${OS}.mk
include ${MK}/os-prefix.mk
include ${MK}/os-${OS}.mk
RC_LIB= /$(LIBNAME)/rc

View File

@@ -11,6 +11,7 @@
AR?= ar
CP?= cp
PKG_CONFIG?= pkg-config
ECHO?= echo
INSTALL?= install
RANLIB?= ranlib
@@ -26,7 +27,7 @@ ifeq (${MKPREFIX},yes)
UPREFIX= ${PREFIX}/usr
endif
endif
LOCAL_PREFIX= /usr/local
LOCAL_PREFIX= $(UPREFIX)/local
PICFLAG?= -fPIC

View File

@@ -1,6 +1,6 @@
ifeq (${MKTERMCAP},ncurses)
TERMCAP_CFLAGS:= $(shell pkg-config ncurses --cflags 2> /dev/null)
LTERMCAP:= $(shell pkg-config ncurses --libs 2> /dev/null)
TERMCAP_CFLAGS:= $(shell ${PKG_CONFIG} ncurses --cflags 2> /dev/null)
LTERMCAP:= $(shell ${PKG_CONFIG} ncurses --libs 2> /dev/null)
ifeq ($(LTERMCAP),)
LIBTERMCAP?= -lncurses
else

View File

@@ -285,6 +285,9 @@ detect_container(const char *systype)
return RC_SYS_RKT;
else if (file_regex("/proc/1/environ", "container=systemd-nspawn"))
return RC_SYS_SYSTEMD_NSPAWN;
else if (exists("/.dockerenv"))
return RC_SYS_DOCKER;
/* old test, I'm not sure when this was valid. */
else if (file_regex("/proc/1/environ", "container=docker"))
return RC_SYS_DOCKER;
#endif

View File

@@ -178,6 +178,9 @@ int main(int argc, char **argv)
FILE *fp;
#endif
/* fail if there is no /etc/fstab */
if (!exists("/etc/fstab"))
eerrorx("/etc/fstab does not exist");
/* Ensure that we are only quiet when explicitly told to be */
unsetenv("EINFO_QUIET");

View File

@@ -297,6 +297,9 @@ getmntfile(const char *file)
struct mntent *ent = NULL;
FILE *fp;
if (!exists("/etc/fstab"))
return NULL;
fp = setmntent("/etc/fstab", "r");
while ((ent = getmntent(fp)))
if (strcmp(file, ent->mnt_dir) == 0)

View File

@@ -247,6 +247,10 @@ rc_logger_open(const char *level)
logfile = rc_conf_value("rc_log_path");
if (logfile == NULL)
logfile = DEFAULTLOG;
if (!strcmp(logfile, TMPLOG)) {
eerror("Cowardly refusing to concatenate a logfile into itself.");
eerrorx("Please change rc_log_path to something other than %s to get rid of this message", TMPLOG);
}
if ((plog = fopen(logfile, "ae"))) {
if ((log = fopen(TMPLOG, "re"))) {