Compare commits
29 Commits
openrc-0.1
...
openrc-0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cd030e3f1 | ||
|
|
90ecf23310 | ||
|
|
55a3746d80 | ||
|
|
8f7351cf7f | ||
|
|
52220d5df1 | ||
|
|
d5dfc6d529 | ||
|
|
7f33410e5d | ||
|
|
56993950f2 | ||
|
|
e3999c15ad | ||
|
|
4a9c450ec2 | ||
|
|
bb4c14999c | ||
|
|
252422dcf0 | ||
|
|
a3a64ac94e | ||
|
|
1a2f45a4c5 | ||
|
|
34b55f31b3 | ||
|
|
e0c746e938 | ||
|
|
50329eee7a | ||
|
|
fb81028121 | ||
|
|
50e99aa30a | ||
|
|
b177b79242 | ||
|
|
7009f66872 | ||
|
|
2eb0ea9afb | ||
|
|
534031fc7a | ||
|
|
6b85d4288c | ||
|
|
dec899b946 | ||
|
|
c9f6e2a6c8 | ||
|
|
e1a4aef3e5 | ||
|
|
cb2c45a3c0 | ||
|
|
d92eca3988 |
@@ -1,3 +1,3 @@
|
|||||||
NAME= openrc
|
NAME= openrc
|
||||||
VERSION= 0.13.2
|
VERSION= 0.13.11
|
||||||
PKG= ${NAME}-${VERSION}
|
PKG= ${NAME}-${VERSION}
|
||||||
|
|||||||
@@ -69,7 +69,14 @@ seed_dev()
|
|||||||
# so udev can add its start-message to dmesg
|
# so udev can add its start-message to dmesg
|
||||||
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
|
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
|
||||||
|
|
||||||
# Mount required stuff as user may not have then in /etc/fstab
|
# extra symbolic links not provided by default
|
||||||
|
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
|
||||||
|
[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
|
||||||
|
[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
|
||||||
|
[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
|
||||||
|
[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
|
||||||
|
|
||||||
|
# Mount required directories as user may not have them in /etc/fstab
|
||||||
for x in \
|
for x in \
|
||||||
"mqueue /dev/mqueue 1777 ,nodev mqueue" \
|
"mqueue /dev/mqueue 1777 ,nodev mqueue" \
|
||||||
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
|
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ start()
|
|||||||
{
|
{
|
||||||
ebegin "Starting local"
|
ebegin "Starting local"
|
||||||
|
|
||||||
local file has_errors=0 retval
|
local file has_errors=0 redirect retval
|
||||||
|
yesno $rc_verbose || redirect='> /dev/null 2>&1'
|
||||||
eindent
|
eindent
|
||||||
for file in @SYSCONFDIR@/local.d/*.start; do
|
for file in @SYSCONFDIR@/local.d/*.start; do
|
||||||
if [ -x "${file}" ]; then
|
if [ -x "${file}" ]; then
|
||||||
vebegin "Executing \"${file}\""
|
vebegin "Executing \"${file}\""
|
||||||
"${file}" 2>&1 >/dev/null
|
"${file}" $redirect
|
||||||
retval=$?
|
retval=$?
|
||||||
if [ ${retval} -ne 0 ]; then
|
if [ ${retval} -ne 0 ]; then
|
||||||
has_errors=1
|
has_errors=1
|
||||||
@@ -52,12 +53,13 @@ stop()
|
|||||||
{
|
{
|
||||||
ebegin "Stopping local"
|
ebegin "Stopping local"
|
||||||
|
|
||||||
local file has_errors=0 retval
|
local file has_errors=0 redirect retval
|
||||||
|
yesno $rc_verbose || redirect='> /dev/null 2>&1'
|
||||||
eindent
|
eindent
|
||||||
for file in @SYSCONFDIR@/local.d/*.stop; do
|
for file in @SYSCONFDIR@/local.d/*.stop; do
|
||||||
if [ -x "${file}" ]; then
|
if [ -x "${file}" ]; then
|
||||||
vebegin "Executing \"${file}\""
|
vebegin "Executing \"${file}\""
|
||||||
"${file}" 2>&1 >/dev/null
|
"${file}" $redirect
|
||||||
retval=$?
|
retval=$?
|
||||||
if [ ${retval} -ne 0 ]; then
|
if [ ${retval} -ne 0 ]; then
|
||||||
has_errors=1
|
has_errors=1
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ description="Mounts network shares according to /etc/fstab."
|
|||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
config /etc/fstab
|
config /etc/fstab
|
||||||
use afc-client amd autofs openvpn
|
use afc-client amd nfsclient autofs openvpn
|
||||||
use dns
|
use dns
|
||||||
keyword -jail -prefix -vserver -lxc
|
keyword -jail -prefix -vserver -lxc
|
||||||
}
|
}
|
||||||
@@ -47,14 +47,7 @@ stop()
|
|||||||
eindent
|
eindent
|
||||||
fs=
|
fs=
|
||||||
for x in $net_fs_list $extra_net_fs_list; do
|
for x in $net_fs_list $extra_net_fs_list; do
|
||||||
case "$x" in
|
|
||||||
nfs|nfs4)
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
fs="$fs${fs:+|}$x"
|
fs="$fs${fs:+|}$x"
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
[ -n "$fs" ] && fs="^($fs)$"
|
[ -n "$fs" ] && fs="^($fs)$"
|
||||||
do_unmount umount ${fs:+--fstype-regex} $fs --netdev
|
do_unmount umount ${fs:+--fstype-regex} $fs --netdev
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ mount_cgroups()
|
|||||||
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
|
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
|
||||||
while read name hier groups enabled rest; do
|
while read name hier groups enabled rest; do
|
||||||
case "${enabled}" in
|
case "${enabled}" in
|
||||||
1) mkdir /sys/fs/cgroup/${name}
|
1) mountinfo -q /sys/fs/cgroup/${name} && continue
|
||||||
|
mkdir /sys/fs/cgroup/${name}
|
||||||
mount -n -t cgroup -o ${sysfs_opts},${name} \
|
mount -n -t cgroup -o ${sysfs_opts},${name} \
|
||||||
${name} /sys/fs/cgroup/${name}
|
${name} /sys/fs/cgroup/${name}
|
||||||
;;
|
;;
|
||||||
@@ -129,25 +130,13 @@ restorecon_sys()
|
|||||||
restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
|
restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
|
||||||
eend $?
|
eend $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
local retval
|
|
||||||
mount_sys
|
mount_sys
|
||||||
retval=$?
|
|
||||||
if [ $retval -eq 0 ]; then
|
|
||||||
mount_misc
|
mount_misc
|
||||||
retval=$?
|
|
||||||
fi
|
|
||||||
if [ $retval -eq 0 ]; then
|
|
||||||
mount_cgroups
|
mount_cgroups
|
||||||
retval=$?
|
|
||||||
fi
|
|
||||||
|
|
||||||
restorecon_sys
|
restorecon_sys
|
||||||
|
return 0
|
||||||
return $retval
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ depend()
|
|||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
ebegin "setting up tmpfiles.d entries for /dev"
|
ebegin "setting up tmpfiles.d entries for /dev"
|
||||||
@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create ${tmpfiles_opts}
|
@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create --boot ${tmpfiles_opts}
|
||||||
eend $?
|
eend $?
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,17 @@ DISTFILE?= ${DISTPREFIX}.tar.bz2
|
|||||||
|
|
||||||
CLEANFILES+= ${NAME}-*.tar.bz2
|
CLEANFILES+= ${NAME}-*.tar.bz2
|
||||||
|
|
||||||
|
CHANGELOG_LIMIT?= --after="1 year ago"
|
||||||
|
|
||||||
_SNAP_SH= date -u +%Y%m%d%H%M
|
_SNAP_SH= date -u +%Y%m%d%H%M
|
||||||
_SNAP:= $(shell ${_SNAP_SH})
|
_SNAP:= $(shell ${_SNAP_SH})
|
||||||
SNAP= ${_SNAP}
|
SNAP= ${_SNAP}
|
||||||
SNAPDIR= ${DISTPREFIX}-${SNAP}
|
SNAPDIR= ${DISTPREFIX}-${SNAP}
|
||||||
SNAPFILE= ${SNAPDIR}.tar.bz2
|
SNAPFILE= ${SNAPDIR}.tar.bz2
|
||||||
|
|
||||||
|
changelog:
|
||||||
|
git log ${CHANGELOG_LIMIT} --format=full > ChangeLog
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}
|
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# Copyright (c) 2012 Alexander Vershilov <qnikst@gentoo.org>
|
# Copyright (c) 2012 Alexander Vershilov <qnikst@gentoo.org>
|
||||||
# Released under the 2-clause BSD license.
|
# Released under the 2-clause BSD license.
|
||||||
extra_stopped_commands="${extra_stopped_commands} cgroup_cleanup"
|
extra_stopped_commands="${extra_stopped_commands} cgroup_cleanup"
|
||||||
|
description_cgroup_cleanup="Kill all processes in the cgroup"
|
||||||
|
|
||||||
cgroup_find_path()
|
cgroup_find_path()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -556,26 +556,24 @@ rc_service_daemons_crashed(const char *service)
|
|||||||
|
|
||||||
char *ch_root = rc_service_value_get(basename_c(service), "chroot");
|
char *ch_root = rc_service_value_get(basename_c(service), "chroot");
|
||||||
char *spidfile = pidfile;
|
char *spidfile = pidfile;
|
||||||
if (ch_root) {
|
if (ch_root && pidfile) {
|
||||||
spidfile = malloc(strlen(ch_root) + strlen(pidfile));
|
spidfile = xmalloc(strlen(ch_root) + strlen(pidfile) + 1);
|
||||||
strcpy(spidfile, ch_root);
|
strcpy(spidfile, ch_root);
|
||||||
strcat(spidfile, pidfile);
|
strcat(spidfile, pidfile);
|
||||||
|
free(pidfile);
|
||||||
|
pidfile = spidfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
pid = 0;
|
pid = 0;
|
||||||
if (spidfile) {
|
if (pidfile) {
|
||||||
retval = true;
|
retval = true;
|
||||||
if ((fp = fopen(spidfile, "r"))) {
|
if ((fp = fopen(pidfile, "r"))) {
|
||||||
if (fscanf(fp, "%d", &pid) == 1)
|
if (fscanf(fp, "%d", &pid) == 1)
|
||||||
retval = false;
|
retval = false;
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
free(spidfile);
|
|
||||||
spidfile = NULL;
|
|
||||||
if (ch_root) {
|
|
||||||
free(pidfile);
|
free(pidfile);
|
||||||
pidfile = NULL;
|
pidfile = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
/* We have the pid, so no need to match
|
/* We have the pid, so no need to match
|
||||||
on exec or name */
|
on exec or name */
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
|
|||||||
int u;
|
int u;
|
||||||
|
|
||||||
memset(&st, 0, sizeof(st));
|
memset(&st, 0, sizeof(st));
|
||||||
if (stat(path, &st) || trunc) {
|
if (lstat(path, &st) || trunc) {
|
||||||
if (type == inode_file) {
|
if (type == inode_file) {
|
||||||
einfo("%s: creating file", path);
|
einfo("%s: creating file", path);
|
||||||
if (!mode) /* 664 */
|
if (!mode) /* 664 */
|
||||||
@@ -133,6 +133,14 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode && (st.st_mode & 0777) != mode) {
|
if (mode && (st.st_mode & 0777) != mode) {
|
||||||
|
if ((type != inode_dir) && (st.st_nlink > 1)) {
|
||||||
|
eerror("%s: chmod: %s %s", applet, "Too many hard links to", path);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (S_ISLNK(st.st_mode)) {
|
||||||
|
eerror("%s: chmod: %s %s", applet, path, " is a symbolic link");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
einfo("%s: correcting mode", path);
|
einfo("%s: correcting mode", path);
|
||||||
if (chmod(path, mode)) {
|
if (chmod(path, mode)) {
|
||||||
eerror("%s: chmod: %s", applet, strerror(errno));
|
eerror("%s: chmod: %s", applet, strerror(errno));
|
||||||
@@ -141,6 +149,14 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chowner && (st.st_uid != uid || st.st_gid != gid)) {
|
if (chowner && (st.st_uid != uid || st.st_gid != gid)) {
|
||||||
|
if ((type != inode_dir) && (st.st_nlink > 1)) {
|
||||||
|
eerror("%s: chown: %s %s", applet, "Too many hard links to", path);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (S_ISLNK(st.st_mode)) {
|
||||||
|
eerror("%s: chown: %s %s", applet, path, " is a symbolic link");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
einfo("%s: correcting owner", path);
|
einfo("%s: correcting owner", path);
|
||||||
if (chown(path, uid, gid)) {
|
if (chown(path, uid, gid)) {
|
||||||
eerror("%s: chown: %s", applet, strerror(errno));
|
eerror("%s: chown: %s", applet, strerror(errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user