[gentoo-commits] proj/openrc:master commit in: etc/

2014-03-09 Thread William Hubbs
commit: d0186d422c3bb75ac2977dfe7d1f8f97c3ce5c3b
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Mar  9 20:35:41 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Mar  9 20:37:38 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d0186d42

rc.conf: document rc_nocolor setting

---
 etc/rc.conf.in | 4 
 1 file changed, 4 insertions(+)

diff --git a/etc/rc.conf.in b/etc/rc.conf.in
index e90ad81..8abfd75 100644
--- a/etc/rc.conf.in
+++ b/etc/rc.conf.in
@@ -73,6 +73,10 @@
 #rc_crashed_stop=NO
 #rc_crashed_start=YES
 
+# Set rc_nocolor to yes if you do not want colors displayed in OpenRc
+# output.
+#rc_nocolor=NO
+
 ##
 # MISC CONFIGURATION VARIABLES
 # There variables are shared between many init scripts



[gentoo-commits] proj/openrc:master commit in: conf.d/

2014-03-13 Thread William Hubbs
commit: 7fb209a6fc3512d3437bbb175853f1f01393b74d
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Mar 13 20:27:40 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Mar 13 20:27:40 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=7fb209a6

conf.d/hwclock: typo fix

---
 conf.d/hwclock | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf.d/hwclock b/conf.d/hwclock
index 59bb732..fc65ac2 100644
--- a/conf.d/hwclock
+++ b/conf.d/hwclock
@@ -7,7 +7,7 @@ clock=UTC
 # If you want the hwclock script to set the system time (software clock)
 # to match the current hardware clock during bootup, leave this
 # commented out.
-# However, you can set this to NO ifyou are running a modern kernel
+# However, you can set this to NO if you are running a modern kernel
 # with CONFIG_RTC_HCTOSYS set to y and your hardware clock set to UTC.
 #clock_hctosys=YES
 



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-25 Thread William Hubbs
commit: 275714bdc74c363ca1612b2b6b97f74f7a62b50c
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Jul 25 16:04:57 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul 25 16:04:57 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=275714bd

checkpath: style fix

---
 src/rc/checkpath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index ecd845f..a65dbc2 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -281,7 +281,7 @@ int checkpath(int argc, char **argv)
gid = gr-gr_gid;
 
 #ifdef HAVE_SELINUX
-   if (1 == selinux_util_open())
+   if (selinux_util_open() == 1)
selinux_on = true;
 #endif
 



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-28 Thread William Hubbs
commit: 2624a8c8a7030180f9548a6e2fba5b0a82c5f046
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Jul 28 15:41:24 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Jul 28 15:41:24 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2624a8c8

checkpath: apply ownership to all paths given on command line

The stat structure was not being initialized correctly in do_check. This
was causing the owner adjustment to be skipped if the first path had the
correct owner.

Also, the correcting owner message should always be printed when the
owner is being changed.

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

---
 src/rc/checkpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index a65dbc2..94ab474 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -67,6 +67,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t 
mode,
int r;
int u;
 
+   memset(st, 0, sizeof(st));
if (stat(path, st) || trunc) {
if (type == inode_file) {
einfo(%s: creating file, path);
@@ -140,8 +141,7 @@ 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 (st.st_dev || st.st_ino)
-   einfo(%s: correcting owner, path);
+   einfo(%s: correcting owner, path);
if (chown(path, uid, gid)) {
eerror(%s: chown: %s, applet, strerror(errno));
return -1;



[gentoo-commits] proj/openrc:master commit in: sh/

2014-06-20 Thread William Hubbs
commit: 19cccb2e9416311b85fcad3c15d4d988fed2f954
Author: Robin H. Johnson robbat2 AT gentoo DOT org
AuthorDate: Mon May 26 06:51:37 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jun 20 21:19:25 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=19cccb2e

sh/tmpfiles.sh: license under 2-clause BSD

As the author of our tmpfiles.sh script, I hereby license it under
2-clause BSD, like the rest of openrc.

Signed-off-by: Robin H. Johnson robbat2 AT gentoo.org

---
 sh/tmpfiles.sh.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index a903163..6d4c614 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -3,10 +3,11 @@
 # Control creation, deletion, and cleaning of volatile and temporary files
 #
 # Copyright (c) 2012 Gentoo Foundation
+# Released under the 2-clause BSD license.
 #
-# This instance based on the Arch Linux version:
+# This instance is a pure-POSIX sh version, written by Robin H Johnson
+# robb...@gentoo.org, based on the Arch Linux version as of 2012/01/01:
 # http://projects.archlinux.org/initscripts.git/tree/arch-tmpfiles
-# As of 2012/01/01
 #
 # See the tmpfiles.d manpage as well:
 # http://0pointer.de/public/systemd-man/tmpfiles.d.html



[gentoo-commits] proj/openrc:master commit in: src/librc/

2014-06-20 Thread William Hubbs
commit: 9eb9b28d3e3b6725559fb38101ae869c1e4530ce
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Jun 20 21:01:47 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jun 20 21:01:47 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=9eb9b28d

librc: filter out container processes on OpenVZ host

Thanks to info and testing done by Daniel Robbins drobbins AT funtoo.org,
there is now a fix for this. Below is his description of the steps
OpenRC needed to use.

1) See if /proc/pid/status exists
2) If it does, see if it has a envID: field
3) If it does, see if envID: is set to 0
4) If so, then it's one of the host's processes and should be a
candidate for the list. Otherwise, it is one of the container's
processes and should be ignored.

This should fix the bug and allow start-stop-daemon to work properly on
OpenVZ hosts.

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

---
 src/librc/librc-daemon.c | 46 ++
 1 file changed, 46 insertions(+)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index e98b02c..a53e6e1 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -90,6 +90,11 @@ rc_find_pids(const char *exec, const char *const *argv, 
uid_t uid, pid_t pid)
 {
DIR *procdir;
struct dirent *entry;
+   FILE *fp;
+   bool container_pid = false;
+   bool openvz_host = false;
+   char *line = NULL;
+   size_t len = 0;
pid_t p;
char buffer[PATH_MAX];
struct stat sb;
@@ -117,6 +122,26 @@ rc_find_pids(const char *exec, const char *const *argv, 
uid_t uid, pid_t pid)
runscript_pid = 0;
}
 
+   /*
+   If /proc/self/status contains EnvID: 0, then we are an OpenVZ host,
+   and we will need to filter out processes that are inside containers
+   from our list of pids.
+   */
+
+   if (exists(/proc/self/status)) {
+   fp = fopen(/proc/self/status, r);
+   if (fp) {
+   while(! feof(fp)) {
+   rc_getline(line, len, fp);
+   if (strncmp(line, envID:\t0, 8) == 0) {
+   openvz_host = true;
+   break;
+   }
+   }
+   fclose(fp);
+   }
+   }
+
while ((entry = readdir(procdir)) != NULL) {
if (sscanf(entry-d_name, %d, p) != 1)
continue;
@@ -134,6 +159,25 @@ rc_find_pids(const char *exec, const char *const *argv, 
uid_t uid, pid_t pid)
if (argv 
!pid_is_argv(p, (const char *const *)argv))
continue;
+   /* If this is an OpenVZ host, filter out container processes */
+   if (openvz_host) {
+   snprintf(buffer, sizeof(buffer), /proc/%d/status, p);
+   if (exists(buffer)) {
+   fp = fopen(buffer, r);
+   if (! fp)
+   continue;
+   while (! feof(fp)) {
+   rc_getline(line, len, fp);
+   if (strncmp(line, envID:, 6) == 0) {
+   container_pid = ! 
(strncmp(line, envID:\t0, 8) == 0);
+   break;
+   }
+   }
+   fclose(fp);
+   }
+   }
+   if (container_pid)
+   continue;
if (!pids) {
pids = xmalloc(sizeof(*pids));
LIST_INIT(pids);
@@ -142,6 +186,8 @@ rc_find_pids(const char *exec, const char *const *argv, 
uid_t uid, pid_t pid)
pi-pid = p;
LIST_INSERT_HEAD(pids, pi, entries);
}
+   if (line != NULL)
+   free(line);
closedir(procdir);
return pids;
 }



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-06-20 Thread William Hubbs
commit: 6126700a0723efa4ef1e299da0f58498f742c3a1
Author: Sven Vermeulen sven.vermeulen AT siphos DOT be
AuthorDate: Sat Apr 19 19:18:18 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jun 20 23:37:33 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6126700a

SELinux filesystem is at /sys/fs/selinux

The SELinux filesystem has been moved to /sys/fs/selinux for quite some
time. We kept supporting /selinux for backwards compatibility, but it's
time to move forward on this.

X-Gentoo-Bug: 511718
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=511718
Signed-off-by: Sven Vermeulen sven.vermeulen AT siphos.be

---
 init.d/procfs.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/procfs.in b/init.d/procfs.in
index 0db5305..636cd20 100644
--- a/init.d/procfs.in
+++ b/init.d/procfs.in
@@ -61,10 +61,10 @@ start()
fi
 
# Setup Kernel Support for SELinux
-   if [ -d /selinux ]  ! mountinfo -q /selinux; then
+   if [ -d /sys/fs/selinux ]  ! mountinfo -q /sys/fs/selinux; then
if grep -qs selinuxfs /proc/filesystems; then
ebegin Mounting SELinux filesystem
-   mount -t selinuxfs selinuxfs /selinux
+   mount -t selinuxfs selinuxfs /sys/fs/selinux
eend $?
fi
fi



[gentoo-commits] proj/openrc:master commit in: sh/

2014-06-20 Thread William Hubbs
commit: 094bc17cb0ad75da189ebf1a8242a378928a1eef
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sat Jun 21 00:39:07 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Jun 21 00:39:07 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=094bc17c

tmpfiles.sh: fix comment processing

If you happened to format a comment with no white space after the '#',
it was not being processed.

Reported-by: consus AT gmx.com
X-Gentoo-Bug: 511804
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=511804

---
 sh/tmpfiles.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 6d4c614..66612fc 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -304,7 +304,7 @@ for FILE in $tmpfiles_d ; do
# whine about invalid entries
case $cmd in
f|F|w|d|D|p|L|c|b|x|X|r|R|z|Z) ;;
-   \#) continue ;;
+   \#*) continue ;;
*) warninvalid ; continue ;;
esac
 



[gentoo-commits] proj/openrc:master commit in: man/

2014-06-21 Thread William Hubbs
commit: 23cb55d843b165d5508f330287ed329358fc85dc
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sat Jun 21 06:53:17 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Jun 21 06:53:17 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=23cb55d8

man/start-stop-daemon.8: correct argument from --nice to --nicelevel

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

---
 man/start-stop-daemon.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/start-stop-daemon.8 b/man/start-stop-daemon.8
index a805232..b3405d5 100644
--- a/man/start-stop-daemon.8
+++ b/man/start-stop-daemon.8
@@ -139,7 +139,7 @@ option.
 Modifies the IO scheduling priority of the daemon.
 Class can be 0 for none, 1 for real time, 2 for best effort and 3 for idle.
 Data can be from 0 to 7 inclusive.
-.It Fl N , -nice Ar level
+.It Fl N , -nicelevel Ar level
 Modifies the scheduling priority of the daemon.
 .It Fl 1 , -stdout Ar logfile
 Redirect the standard output of the process to logfile when started with



[gentoo-commits] proj/openrc:master commit in: /

2014-06-23 Thread William Hubbs
commit: 09d81e86f210acf5270ea4bd0fa7319a49f88131
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Tue Jun 24 01:26:18 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Tue Jun 24 01:41:06 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=09d81e86

Make history a separate document

Move the additional history information from Daniel Robbins' wiki
page along with the history from README to a separate file,
README.history.

X-Gentoo-Bug: 513024
X-Gentoo-Bug-URL: https://bugs.gentoo.org/513024

---
 README | 22 --
 README.history | 55 +++
 2 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/README b/README
index 798ef4e..917704b 100644
--- a/README
+++ b/README
@@ -76,25 +76,3 @@ the Gentoo Bugzilla:
http://bugs.gentoo.org/
 They should be filed under the Gentoo Hosted Projects product and
 the openrc component.
-
-
-History - by Roy Marples
-
-I became a Gentoo/Linux developer in 2004 and wrote the modular network
-scripts for the Gentoo baselayout package. baselayout is a collection of
-bash scripts to bring up your computer and its services.
-Then towards the end of 2005 I found myself as the primary maintainer
-for baselayout.
-
-At the start of 2007, baselayout-2 is announced to the world, re-writing the
-core of baselayout in C and allowing POSIX sh init scripts instead of
-forcing the use of bash. By Mid 2007 I have re-written everything, including
-init scripts, and alpha and pre baselayout-2 snapshots where put into Gentoo.
-Towards the end of 2007 I retired as a Gentoo developer for reasons I won't
-go into here. baselayout-2 was still in the pre stage, and aside from the
-fbsd users, it was masked everywhere. However, I also desired to keep the
-baselayout-2 project alive, but outside of Gentoo and into other projects
-such as FreeBSD.
-
-As such, the Gentoo Council have allowed the creation of OpenRC under the
-2 clause BSD license, managed by me as an external project.

diff --git a/README.history b/README.history
new file mode 100644
index 000..2aeca1b
--- /dev/null
+++ b/README.history
@@ -0,0 +1,55 @@
+This history of OpenRC was written by Daniel Robbins, Roy Marples, William
+Hubbs and others.
+
+The Gentoo modular init scripts were developed by Daniel Robbins for Gentoo
+Linux 1.0_rc6 during most of 2001 and released in September 2001. After their
+development, the dependency-based init script system was maintained by a
+number of senior developers, starting with Azarah (Martin Schlemmer), with
+migration to the new init system assisted by Woodchip (Donnie Davies) who
+converted all ebuild init scripts to work with the new system. As Grant
+Goodyear notes: 
+
+My recollection is that one of woodchip's more impressive early feats
+was the complete replacement of all of the init scripts in Portage
+for Gentoo Linux 1.0_rc6. Through 1.0_rc5 Gentoo had used fairly
+standard rc scripts modified from Stampede Linux, but for 1.0_rc6 Daniel
+Robbins (drobbins) and Martin Schlemmer (azarah) had created a new
+dependency-based init script system that is still used today. Within a
+span of days Donny rewrote every single init script in the Portage tree
+and committed new masked packages to await the release of 1.0_rc6. Thanks to
+woodchip (and drobbins and azarah, of course) the
+transition to the new init scripts was nearly painless. [1] 
+
+Roy Marples became a Gentoo/Linux developer in 2004 and wrote the modular
+network scripts for the Gentoo baselayout package. Towards the end of 2005,
+he became the primary maintainer for baselayout and the init scripts. 
+
+At the start of 2007, He announced the ongoing development of
+baselayout-2, containing a rewritten core coded in C and allowing POSIX sh
+init scripts instead of forcing the use of bash. By mid 2007, He had
+re-implemented the Gentoo init script design created by Daniel Robbins,
+using an entirely new code base. Alpha and pre-release baselayout-2
+snapshots were added to Gentoo's Portage tree as an optional component.
+
+Toward the end of 2007, Roy retired as a Gentoo developer.
+Baselayout-2 was still in the pre stage, and aside from the gentoo-fbsd
+users, it was masked. However, He desired to keep the baselayout-2
+project moving forward as an independent project. The Gentoo Council
+permitted Him to release OpenRC under the 2-clause BSD license,
+managed by him as an external project. 
+
+Around mid-2010, Roy decided to no longer maintain OpenRC. At this
+point, he transferred development back to Gentoo.
+
+William Hubbs, and several other Gentoo developers,  started working on
+OpenRC around this point and brought OpenRC-0.8.x to Gentoo Linux's stable
+tree in 2011.
+
+In 2013 the OpenRC team became independent from Gentoo again and moved primary
+development to github.
+
+Daniel Robbins continues to maintain an independent

[gentoo-commits] proj/openrc:master commit in: init.d/

2014-06-30 Thread William Hubbs
commit: 56112a6f1f176696e5f39a86fe4b52017ccdd04c
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Tue Jul  1 01:30:39 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Tue Jul  1 01:30:39 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=56112a6f

sysfs: Do not mount openrc cgroup if it is already mounted

We were not checking to see if /sys/fs/cgroup/openrc was already mounted
before we mounted it. This fixes that issue.
Thanks to Robin Johnson robbat2 AT gentoo.org for pointing this out.

---
 init.d/sysfs.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 1dba73f..9edd915 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -100,6 +100,7 @@ mount_misc()
 mount_cgroups()
 {
mountinfo -q /sys/fs/cgroup || return 0
+   mountinfo -q /sys/fs/cgroup/openrc || return 0
 
local agent=@LIBEXECDIR@/sh/cgroup-release-agent.sh
mkdir /sys/fs/cgroup/openrc



[gentoo-commits] proj/openrc:master commit in: /

2014-07-01 Thread William Hubbs
commit: b4b34d909c36898095a0036f90a328838137e3a4
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Tue Jul  1 12:14:31 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Tue Jul  1 12:15:22 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=b4b34d90

Schedule removal of the opts variable from service scripts

---
 FEATURE-REMOVAL-SCHEDULE | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/FEATURE-REMOVAL-SCHEDULE b/FEATURE-REMOVAL-SCHEDULE
index 57814d3..a6258a0 100644
--- a/FEATURE-REMOVAL-SCHEDULE
+++ b/FEATURE-REMOVAL-SCHEDULE
@@ -38,3 +38,14 @@ Why: Deprecated in favor of openrc-run and openrc due to 
naming
 Who:
 
 ---
+
+What: support for the opts variable in service scripts
+
+When: 1.0
+
+Why: Depprecated in favor of extra_commands, extra_started_commands
+and extra_stopped_commands.
+
+Who:
+
+---



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-04 Thread William Hubbs
commit: 143f1c64c13e4930e3880a393b7253d6fbc0ed58
Author: Kaarle Ritvanen kaarle.ritvanen AT datakunkku DOT fi
AuthorDate: Wed Jul  2 08:45:14 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul  4 13:33:55 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=143f1c64

sysctl.Linux.in: remove -lxc from keywords

certain tunables can be set independently for each container

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

---
 init.d/sysctl.Linux.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init.d/sysctl.Linux.in b/init.d/sysctl.Linux.in
index 1ebce66..cda86b5 100644
--- a/init.d/sysctl.Linux.in
+++ b/init.d/sysctl.Linux.in
@@ -5,7 +5,7 @@
 depend()
 {
before bootmisc logger
-   keyword -lxc -prefix -vserver
+   keyword -prefix -vserver
 }
 
 start()



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-09 Thread William Hubbs
commit: 57b9e601a97fac3a044ec5d7e5f11b6219c892b7
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sat Jul  5 19:30:33 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul  9 20:33:48 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=57b9e601

init.d/local: bring functioning more in line with how sysctl works

- remove the has_executables variable since it isn't used.
- Convert the conditional calls to ewend/vewend to a single call to veend.
- Always call eend after all scripts are executed passing the appropriate
error code.

Because of this change, you will see only an overall status when
starting or stopping local unless you are using verbose mode.

---
 init.d/local.in | 22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/init.d/local.in b/init.d/local.in
index 06be25f..180735d 100644
--- a/init.d/local.in
+++ b/init.d/local.in
@@ -14,20 +14,17 @@ start()
 {
ebegin Starting local
 
-   local file has_errors retval
+   local file has_errors=0 retval
eindent
for file in @SYSCONFDIR@/local.d/*.start; do
if [ -x ${file} ]; then
-   has_executables=1
vebegin Executing \${file}\
${file} 21 /dev/null
retval=$?
if [ ${retval} -ne 0 ]; then
has_errors=1
-   ewend ${retval} Execution of \${file}\ 
failed.
-   else
-   vewend 0
fi
+   veend ${retval} Execution of \${file}\ failed.
fi
done
eoutdent
@@ -40,9 +37,7 @@ start()
local_start
fi
 
-   if [ -z ${has_errors} ]; then
-   eend 0
-   fi
+   eend ${has_errors}
 
# We have to end with a zero exit code, because a failed execution
# of an executable @SYSCONFDIR@/local.d/*.start file shouldn't result in
@@ -57,20 +52,17 @@ stop()
 {
ebegin Stopping local
 
-   local file has_errors retval
+   local file has_errors=0 retval
eindent
for file in @SYSCONFDIR@/local.d/*.stop; do
if [ -x ${file} ]; then
-   has_executables=1
vebegin Executing \${file}\
${file} 21 /dev/null
retval=$?
if [ ${retval} -ne 0 ]; then
has_errors=1
-   ewend ${retval} Execution of \${file}\ 
failed.
-   else
-   vewend 0
fi
+   veend ${retval} Execution of \${file}\ failed.
fi
done
eoutdent
@@ -83,9 +75,7 @@ stop()
local_stop
fi
 
-   if [ -z ${has_errors} ]; then
-   eend 0
-   fi
+   eend ${has_errors}
 
# An executable @SYSCONFDIR@/local.d/*.stop file which failed with a
# non-zero exit status is not a reason to mark this service



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-09 Thread William Hubbs
commit: c1de8c09bf4895c6108d297fcebd63046e49e614
Author: Thomas D whissi AT whissi DOT de
AuthorDate: Tue Jun 10 13:23:17 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Jul  5 18:12:30 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c1de8c09

Add support for verbose local service runscript

With this patch, the local service runscript will be verbose like the
sysctl service when 'rc_verbose=yes' is set.

Example output successful start:

 * Stopping local ...
 *   Executing /etc/local.d/00will-stop.stop ...  [ ok ]
 * Starting local ...
 *   Executing /etc/local.d/00will-start.start ...[ ok ]
 *   Executing /etc/local.d/01 test.start ... [ ok ]

Example output with failing executables:

 * Stopping local ...
 *   Executing /etc/local.d/00will-stop.stop ...  [ ok ]
 *   Executing /etc/local.d/will-fail.stop ...
mount: can't find foo in /etc/fstab
 *   Execution of /etc/local.d/will-fail.stop failed. [ !! ]
 * Starting local ...
 *   Executing /etc/local.d/00will-start.start ...[ ok ]
 *   Executing /etc/local.d/01 test.start ... [ ok ]
 *   Executing /etc/local.d/will-fail2.start ...
mount: can't find bar in /etc/fstab
 *   Execution of /etc/local.d/will-fail2.start failed.   [ !! ]
 *   Executing /etc/local.d/will-fail.start ...
mount: can't find foo in /etc/fstab
 *   Execution of /etc/local.d/will-fail.start failed.[ !! ]

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

---
 init.d/local.in | 73 +
 1 file changed, 58 insertions(+), 15 deletions(-)

diff --git a/init.d/local.in b/init.d/local.in
index 2f20568..06be25f 100644
--- a/init.d/local.in
+++ b/init.d/local.in
@@ -12,40 +12,83 @@ depend()
 
 start()
 {
-   einfo Starting local
+   ebegin Starting local
 
-   local file
-   for file in @SYSCONFDIR@/local.d/*.start ; do
-   [ -x $file ]  $file
+   local file has_errors retval
+   eindent
+   for file in @SYSCONFDIR@/local.d/*.start; do
+   if [ -x ${file} ]; then
+   has_executables=1
+   vebegin Executing \${file}\
+   ${file} 21 /dev/null
+   retval=$?
+   if [ ${retval} -ne 0 ]; then
+   has_errors=1
+   ewend ${retval} Execution of \${file}\ 
failed.
+   else
+   vewend 0
+   fi
+   fi
done
+   eoutdent
 
if command -v local_start /dev/null 21; then
-   ewarn @SYSCONFDIR@/conf.d/local should be removed.
+   ewarn \@SYSCONFDIR@/conf.d/local\ should be removed.
ewarn Please move the code from the local_start function
-   ewarn to scripts with an .start extension
-   ewarn in @SYSCONFDIR@/local.d
+   ewarn to executable scripts with an .start extension
+   ewarn in \@SYSCONFDIR@/local.d\
local_start
fi
 
-   eend 0
+   if [ -z ${has_errors} ]; then
+   eend 0
+   fi
+
+   # We have to end with a zero exit code, because a failed execution
+   # of an executable @SYSCONFDIR@/local.d/*.start file shouldn't result in
+   # marking the local service as failed. Otherwise we are unable to
+   # execute any executable @SYSCONFDIR@/local.d/*.stop file, because a 
failed
+   # marked service cannot be stopped (and the stop function would
+   # actually call the executable @SYSCONFDIR@/local.d/*.stop file(s)).
+   return 0
 }
 
 stop()
 {
-   einfo Stopping local
+   ebegin Stopping local
 
-   local file
+   local file has_errors retval
+   eindent
for file in @SYSCONFDIR@/local.d/*.stop; do
-   [ -x $file ]  $file
+   if [ -x ${file} ]; then
+   has_executables=1
+   vebegin Executing \${file}\
+   ${file} 21 /dev/null
+   retval=$?
+   if [ ${retval} -ne 0 ]; then
+   has_errors=1
+   ewend ${retval} Execution of \${file}\ 
failed.
+   else
+   vewend 0
+   fi
+   fi
done
+   eoutdent
 
if command -v local_stop /dev/null 21; then
-   ewarn @SYSCONFDIR@/conf.d/local should be removed.
+   ewarn \@SYSCONFDIR@/conf.d/local\ should be removed.
ewarn Please move the code from the local_stop function
-   ewarn to scripts with an .stop extension
-   ewarn in @SYSCONFDIR

[gentoo-commits] proj/openrc:master commit in: /

2014-07-10 Thread William Hubbs
commit: f265ddde971d0fdb97a4f14b4cc96140be7b4628
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Jul 10 14:04:04 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Jul 10 14:04:04 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=f265ddde

FEATURE_REMOVAL_SCHEDULE: add entry for local_start/stop

---
 FEATURE-REMOVAL-SCHEDULE | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/FEATURE-REMOVAL-SCHEDULE b/FEATURE-REMOVAL-SCHEDULE
index a6258a0..682bed8 100644
--- a/FEATURE-REMOVAL-SCHEDULE
+++ b/FEATURE-REMOVAL-SCHEDULE
@@ -49,3 +49,13 @@ Why: Depprecated in favor of extra_commands, 
extra_started_commands
 Who:
 
 ---
+
+What: support for local_start and local_stop
+
+When: 1.0
+
+Why: Depprecated in favor of executable scripts in @SYSCONFDIR@/local.d
+
+Who:
+
+---



[gentoo-commits] proj/openrc:master commit in: sh/

2014-07-10 Thread William Hubbs
commit: 1a44be0f16a7a1de8a176e7c656f8513494e0e64
Author: Alexander V Vershilov qnikst AT gentoo DOT org
AuthorDate: Sun Feb 16 00:27:52 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Jul 10 15:56:37 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1a44be0f

cgroups: only run cgroup setup when starting a service

Status call should not set limits as it requires root permissions,
also this is not safe, as current process may reach limitation.

Solution is to set limits and move process to service cgroup only
on start.

X-GENTOO-BUG: 500364
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500364

---
 sh/runscript.sh.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index ceb9ab4..c72a784 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -215,12 +215,14 @@ if yesno ${rc_verbose:-$RC_VERBOSE}; then
 fi
 
 # Apply cgroups settings if defined
+if [ $1 = start ] ; then
 if [ $(command -v cgroup_add_service) = cgroup_add_service ]; then
cgroup_add_service /sys/fs/cgroup/openrc
cgroup_add_service /sys/fs/cgroup/systemd/system
 fi
 [ $(command -v cgroup_set_limits) = cgroup_set_limits ]  \
cgroup_set_limits
+fi
 
 # Load our script
 sourcex $RC_SERVICE



[gentoo-commits] proj/openrc:master commit in: sh/

2014-07-10 Thread William Hubbs
commit: 75e06d85584fc3ebfa26fbca97ea60b687247bb0
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Jul 10 10:18:00 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Jul 10 15:57:56 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=75e06d85

Style Fixes

---
 sh/runscript.sh.in | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index c72a784..9b2ae0e 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -216,12 +216,12 @@ fi
 
 # Apply cgroups settings if defined
 if [ $1 = start ] ; then
-if [ $(command -v cgroup_add_service) = cgroup_add_service ]; then
-   cgroup_add_service /sys/fs/cgroup/openrc
-   cgroup_add_service /sys/fs/cgroup/systemd/system
-fi
-[ $(command -v cgroup_set_limits) = cgroup_set_limits ]  \
-   cgroup_set_limits
+   if [ $(command -v cgroup_add_service) = cgroup_add_service ]; then
+   cgroup_add_service /sys/fs/cgroup/openrc
+   cgroup_add_service /sys/fs/cgroup/systemd/system
+   fi
+   [ $(command -v cgroup_set_limits) = cgroup_set_limits ]  \
+   cgroup_set_limits
 fi
 
 # Load our script



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-11 Thread William Hubbs
commit: d0040aff0aa033fd5d5c40480008e98ee5e1f11a
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Jul 11 19:50:20 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul 11 20:04:06 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d0040aff

checkpath: report an error if required options were not specified

Before this commit, not specifying -d, -f, -p or -W in a checkpath
command meant the command exited successfully but actually did nothing.

This is an error condition, so report it as such.

---
 src/rc/checkpath.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 5aea597..6280fb6 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -267,6 +267,9 @@ checkpath(int argc, char **argv)
if (optind = argc)
usage(EXIT_FAILURE);
 
+   if (type == inode_unknown)
+   eerrorx(%s: -d -f or -p must be specified., applet);
+
if (pw) {
uid = pw-pw_uid;
gid = pw-pw_gid;



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-11 Thread William Hubbs
commit: d80482c2f4ec35a880ee099eeb3983b255d65e8f
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Jul 11 20:23:38 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul 11 20:23:38 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d80482c2

checkpath: fix error message in previous commit

---
 src/rc/checkpath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 6280fb6..3c6c5ca 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -268,7 +268,7 @@ checkpath(int argc, char **argv)
usage(EXIT_FAILURE);
 
if (type == inode_unknown)
-   eerrorx(%s: -d -f or -p must be specified., applet);
+   eerrorx(%s: -d, -f, -p, or -W must be specified., applet);
 
if (pw) {
uid = pw-pw_uid;



[gentoo-commits] proj/openrc:master commit in: man/

2014-07-11 Thread William Hubbs
commit: f66f41c4f03d8077bdaa047a7a93f6c92c0a69de
Author: Alexander V Vershilov qnikst AT gentoo DOT org
AuthorDate: Fri Jul 11 21:33:42 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul 11 21:36:35 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=f66f41c4

typo fix

---
 man/openrc-run.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/openrc-run.8 b/man/openrc-run.8
index c330e8c..0ce1f75 100644
--- a/man/openrc-run.8
+++ b/man/openrc-run.8
@@ -321,7 +321,7 @@ Mark the service as inactive.
 .Op Fl f , -file
 .Op Fl p , -pipe
 .Op Fl m , -mode Ar mode
-.Op Fl o , owner Ar owner
+.Op Fl o , -owner Ar owner
 .Ar path ...
 .Xc
 Checks to see if the path exists, is of the right type, owned by the right



[gentoo-commits] proj/openrc:master commit in: /

2014-04-09 Thread William Hubbs
commit: a817915632f7f2162e7c3740d204989f6cfde554
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Apr 10 00:27:12 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Apr 10 00:29:16 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a8179156

README.busybox: document incompatibility with built-in ip applet

---
 README.busybox | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/README.busybox b/README.busybox
index 61b5ffd..b084d42 100644
--- a/README.busybox
+++ b/README.busybox
@@ -8,21 +8,24 @@ counterparts. Since it is possible to configure busybox to 
not include
 these applets or to prefer the standalone counterparts, OpenRC does not
 attempt to support the busybox applets.
 
-All of these apply to busybox 1.20.2, which is the current version of
-busybox as of this writing.
+For now, it is recommended that you disable the following busybox
+configuration settings for best results with OpenRC.
 
-1. The start-stop-daemon applet is not compatible with start-stop-daemon
-in OpenRC. Please make sure CONFIG_START_STOP_DAEMON is not set to y in
-the configuration file you use to build busybox.
+CONFIG_START_STOP_DAEMON -- The start-stop-daemon applet is not compatible with
+start-stop-daemon in OpenRC.
 
-2. The -O option for the mount applet does not support the [no]_netdev
-options from util-linux for handling network file systems.
+CONFIG_MOUNT -- The mount applet does not support the -O [no]_netdev options to
+skip over or include network file systems when the -a option is present.
 
-3. The umount applet does not support the -O option from util-linux.
+CONFIG_UMOUNT -- The umount applet does not support the -O option along with 
-a.
 
-4. The swapon applet does not support the -e option from util-linux.
+CONFIG_SWAPONOFF -- The swapon applet does not support the -e option
+or recognize the nofail option in fstab.
 
-5. the setfont applet does not support the -u option from kbd.
+CONFIG_SETFONT -- The setfont applet does not support the -u option from kbd.
+
+CONFIG_IP -- The ip applet  doesn't support the scope modifier for
+ip route add and ip address add.
 
 There is work to get most of these supported by busybox, so this file
 will be updated as things change.



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/

2014-10-16 Thread William Hubbs
commit: 61fd8b29961650a0132b9cfece80bdf7d16cd05c
Author: Joe M joe9mail AT gmail DOT com
AuthorDate: Fri Aug 29 14:10:58 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 13 20:39:56 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=61fd8b29

savecache: check permissions on the correct directory

---
 init.d/savecache.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/savecache.in b/init.d/savecache.in
index 9040732..dde02dd 100644
--- a/init.d/savecache.in
+++ b/init.d/savecache.in
@@ -13,8 +13,8 @@ start()
return 1
fi
fi
-   if ! checkpath -W $RC_LIBEXECDIR; then
-   ewarn WARNING: ${RC_LIBEXECDIR} is not writable!
+   if ! checkpath -W $RC_LIBEXECDIR/cache; then
+   ewarn WARNING: ${RC_LIBEXECDIR}/cache is not writable!
if ! yesno ${RC_GOINGDOWN}; then
ewarn Unable to save deptree cache
return 1



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: src/rc/

2014-10-16 Thread William Hubbs
commit: 2c1051ad3fc6d39a6201b676f94b055d00265813
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sat Sep 20 21:51:30 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Oct 16 16:32:48 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2c1051ad

typo fix

---
 src/rc/rc-service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/rc-service.c b/src/rc/rc-service.c
index d35b36b..094848a 100644
--- a/src/rc/rc-service.c
+++ b/src/rc/rc-service.c
@@ -57,7 +57,7 @@ static const struct option longopts[] = {
 };
 static const char * const longopts_help[] = {
tests if the service exists or not,
-   if the service exsits then run the command,
+   if the service exists then run the command,
list all available services,
resolve the service name to an init script,
longopts_help_COMMON



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: man/

2014-10-16 Thread William Hubbs
commit: b964de828731b5989fb1117822016cacbfe1ad8a
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Sep 19 22:23:55 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Oct 16 16:42:38 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=b964de82

man: Document start_inactive and in_background_fake

---
 man/openrc-run.8 | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/man/openrc-run.8 b/man/openrc-run.8
index 3890f76..c8bf24d 100644
--- a/man/openrc-run.8
+++ b/man/openrc-run.8
@@ -131,6 +131,12 @@ timeout in seconds or multiple signal/timeout pairs (like 
SIGTERM/5).
 A list of directories which must exist for the service to start.
 .It Ar required_files
 A list of files which must exist for the service to start.
+.It Ar start_inactive
+Set to yes to have the service marked inactive when it starts. This is
+used along with in_background_fake to support re-entrant services.
+.It Ar in_background_fake
+Space separated list of commands which should always succeed when
+in_background is yes.
 .El
 .Sh DEPENDENCIES
 You should define a



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: /

2014-10-16 Thread William Hubbs
commit: 1a7af5bbde0108d5d997d96af7e513eb362d71c5
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Oct 13 16:43:20 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 13 20:39:12 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1a7af5bb

Start work on 0.13.2

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index c6dc0c1..a94811d 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,3 +1,3 @@
 NAME=  openrc
-VERSION=   0.13.1
+VERSION=   0.13.2
 PKG=   ${NAME}-${VERSION}



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: sh/

2014-10-16 Thread William Hubbs
commit: a2187e897e3c0fc9a29adb0b81a57f2b718e74c5
Author: Roy Marples roy AT marples DOT name
AuthorDate: Thu Sep 11 18:26:58 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Oct 16 16:09:36 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a2187e89

Use exception-based approach for cgroup/ulimit setup

Note from William Hubbs:
I spoke with Roy about this, and he pointed out that user-defined
functions may need the limits applied, so it is better to go with a
method that uses exceptions to determine which functions apply the
limits.

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

---
 sh/runscript.sh.in | 34 ++
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index d4c7c60..b89c460 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -209,19 +209,29 @@ unset _conf_d
 # Load any system overrides
 sourcex -e @SYSCONFDIR@/rc.conf
 
-# Apply any ulimit defined
-[ -n ${rc_ulimit:-$RC_ULIMIT} ]  ulimit ${rc_ulimit:-$RC_ULIMIT}
-
-# Apply cgroups settings if defined
-if [ $1 = start ] ; then
-   if [ $(command -v cgroup_add_service) = cgroup_add_service ]; then
-   cgroup_add_service /sys/fs/cgroup/openrc
-   cgroup_add_service /sys/fs/cgroup/systemd/system
+for _cmd; do
+   if [ $_cmd != status -a $_cmd != describe ]; then
+   # Apply any ulimit defined
+   [ -n ${rc_ulimit:-$RC_ULIMIT} ]  \
+   ulimit ${rc_ulimit:-$RC_ULIMIT}
+   # Apply cgroups settings if defined
+   if [ $(command -v cgroup_add_service) = \
+   cgroup_add_service ]
+   then
+   if [ -d /sys/fs/cgroup -a ! -w /sys/fs/cgroup ]; then
+   eerror No permission to apply cgroup settings
+   break
+   fi
+   cgroup_add_service /sys/fs/cgroup/openrc
+   cgroup_add_service /sys/fs/cgroup/systemd/system
+   fi
+   [ $(command -v cgroup_set_limits) = \
+   cgroup_set_limits ]  \
+   cgroup_set_limits
+   break
fi
-   [ $(command -v cgroup_set_limits) = cgroup_set_limits ]  \
-   cgroup_set_limits
-fi
-
+done
+ 
 # Load our script
 sourcex $RC_SERVICE
 



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: sh/

2014-10-16 Thread William Hubbs
commit: b8e52583ca590d0f956acea0ec558e84495e3818
Author: Andrew Gregory andrew.gregory.8 AT gmail DOT com
AuthorDate: Mon Aug 25 19:37:45 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 13 20:39:22 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=b8e52583

tmpfiles.sh: add support for + modifier

systemd added support for b+, c+, p+, and L+ in 2e78fa79 and 1554afae to
remove the target path if it already exists.

---
 sh/tmpfiles.sh.in | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 42a3639..41f86cf 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -304,6 +304,7 @@ for FILE in $tmpfiles_d ; do
# But IS allowed when globs are expanded for the x/r/R/z/Z types.
while read cmd path mode uid gid age arg; do
LINENUM=$(( LINENUM+1 ))
+   FORCE=0
 
# Unless we have both command and path, skip this line.
if [ -z $cmd -o -z $path ]; then
@@ -311,13 +312,20 @@ for FILE in $tmpfiles_d ; do
fi
 
case $cmd in
-   *!) [ $BOOT -eq 1 ] || continue; cmd=${cmd%!} ;;
+   \#*) continue ;;
esac
 
+   while [ ${#cmd} -gt 1 ]; do
+   case $cmd in
+   *!) cmd=${cmd%!}; [ $BOOT -eq 1 ] || 
continue 2 ;;
+   *+) cmd=${cmd%+}; FORCE=1; ;;
+   *) warninvalid ; continue 2 ;;
+   esac
+   done
+
# whine about invalid entries
case $cmd in
f|F|w|d|D|p|L|c|b|x|X|r|R|z|Z) ;;
-   \#*) continue ;;
*) warninvalid ; continue ;;
esac
 
@@ -338,6 +346,13 @@ for FILE in $tmpfiles_d ; do
 
[ -n $EXCLUDE ]  checkprefix $path $EXCLUDE  continue
[ -n $PREFIX ]  ! checkprefix $path $PREFIX  continue
+
+   if [ $FORCE -gt 0 ]; then
+   case $cmd in
+   p|L|c|b) [ -f $path ]  dryrun_or_real rm -f 
$path
+   esac
+   fi
+
[ $VERBOSE -eq 1 ]  echo _$cmd $@
_$cmd $@
rc=$?



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/

2014-10-16 Thread William Hubbs
commit: e8043fe378a410dfa78b1e14162a94cc859a5f69
Author: Rick Farina (ZeroChaos) sidhayn AT gmail DOT com
AuthorDate: Mon Oct  6 16:15:44 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 13 20:41:03 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e8043fe3

localmount: unmount aufs branches

---
 init.d/localmount.in | 25 +
 1 file changed, 25 insertions(+)

diff --git a/init.d/localmount.in b/init.d/localmount.in
index bf3dd0f..1335aa9 100644
--- a/init.d/localmount.in
+++ b/init.d/localmount.in
@@ -63,6 +63,31 @@ stop()
 
. $RC_LIBEXECDIR/sh/rc-mount.sh
 
+   if [ $RC_UNAME = Linux ]  [ -d /sys/fs/aufs ] ; then
+   #if / is aufs we remount it noxino during shutdown
+   if mountinfo -q -f '^aufs$' / ; then
+   mount -o remount,noxino,rw /
+   sync
+   fi
+
+   local aufs_branch aufs_mount_dir aufs_mount_point aufs_si_dir 
aufs_si_id
+   for aufs_si_dir in /sys/fs/aufs/*; do
+   aufs_mount_dir=${aufs_si_dir#/sys/fs/aufs/}
+   aufs_si_id=$(printf %s $aufs_mount_dir | sed 
's/_/=/g')
+   aufs_mount_point=$(mountinfo -o ${aufs_si_id})
+   for x in $aufs_si_dir/br[0-9][0-9][0-9]; do
+   aufs_branch=$(sed 's/=.*//g' $x)
+   eindent
+   if ! mount -o remount,del:$aufs_branch 
$aufs_mount_point  /dev/null 21; then
+   ewarn Failed to remove branch 
$aufs_branch from aufs \
+   $aufs_mount_point
+   fi
+   eoutdent
+   sync
+   done
+   done
+   fi
+
# Umount loop devices
einfo Unmounting loop devices
eindent



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: sh/

2014-10-16 Thread William Hubbs
commit: 43d727dc3f17bc9a1d020ed2a5684d4a26bb620a
Author: Andrew Gregory andrew.gregory.8 AT gmail DOT com
AuthorDate: Mon Aug 25 19:46:28 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 13 20:39:36 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=43d727dc

tmpfiles.sh: add support for C action

Recursively copies files or directories.  Added by systemd in 849958d1.

---
 sh/tmpfiles.sh.in | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 41f86cf..6e7be42 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -80,6 +80,17 @@ _c() {
fi
 }
 
+_C() {
+   # recursively copy a file or directory
+   local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
+   if [ ! -e $path ]; then
+   dryrun_or_real cp -r $arg $path
+   _restorecon $path
+   [ $uid != '-' ]  dryrun_or_real chown $uid $path
+   [ $gid != '-' ]  dryrun_or_real chgrp $gid $path
+   [ $mode != '-' ]  dryrun_or_real chmod $mode $path
+   fi
+}
 
 _f() {
# Create a file if it doesn't exist yet
@@ -325,7 +336,7 @@ for FILE in $tmpfiles_d ; do
 
# whine about invalid entries
case $cmd in
-   f|F|w|d|D|p|L|c|b|x|X|r|R|z|Z) ;;
+   f|F|w|d|D|p|L|c|C|b|x|X|r|R|z|Z) ;;
*) warninvalid ; continue ;;
esac
 
@@ -334,7 +345,7 @@ for FILE in $tmpfiles_d ; do
case $cmd in
p|f|F) mode=0644 ;;
d|D) mode=0755 ;;
-   z|Z|x|r|R|L) ;;
+   C|z|Z|x|r|R|L) ;;
esac
fi
 



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: sh/

2014-10-16 Thread William Hubbs
commit: 082fd53d9e634318e87e2cb1f2ccc7bf12bf09df
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Sep 11 17:02:51 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 13 20:40:54 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=082fd53d

runscript: move verbose mode setting near debug setting

---
 sh/runscript.sh.in | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index 9b2ae0e..d4c7c60 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -185,6 +185,10 @@ status()
 }
 
 yesno $RC_DEBUG  set -x
+if yesno ${rc_verbose:-$RC_VERBOSE}; then
+   EINFO_VERBOSE=yes
+   export EINFO_VERBOSE
+fi
 
 _conf_d=${RC_SERVICE%/*}/../conf.d
 # If we're net.eth0 or openvpn.work then load net or openvpn config
@@ -208,12 +212,6 @@ sourcex -e @SYSCONFDIR@/rc.conf
 # Apply any ulimit defined
 [ -n ${rc_ulimit:-$RC_ULIMIT} ]  ulimit ${rc_ulimit:-$RC_ULIMIT}
 
-# Set verbose mode
-if yesno ${rc_verbose:-$RC_VERBOSE}; then
-   EINFO_VERBOSE=yes
-   export EINFO_VERBOSE
-fi
-
 # Apply cgroups settings if defined
 if [ $1 = start ] ; then
if [ $(command -v cgroup_add_service) = cgroup_add_service ]; then



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-10-18 Thread William Hubbs
commit: 85da4a5e2621dc5f5356d440735aa058008a1b7e
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Oct  1 22:14:25 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Oct 16 21:41:02 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=85da4a5e

add back nfs and nfs4 file systems

Fix gentoo bug #427996 correctly.
We should attempt to mount the file systems, but not try to start the
daemons. The previous fix removed mounting the file systems as well as
starting the daemons.

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

---
 init.d/netmount.in | 19 ++-
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/init.d/netmount.in b/init.d/netmount.in
index 39ab0bc..f6145f0 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -2,10 +2,7 @@
 # Copyright (c) 2007-2009 Roy Marples r...@marples.name
 # Released under the 2-clause BSD license.
 
-description=Mounts network shares, other than NFS, according to /etc/fstab.
-# We skip all NFS shares in this script because they require extra
-# daemons to be running on the client in order to work correctly.
-# It is best to allow nfs-utils to handle all nfs shares.
+description=Mounts network shares according to /etc/fstab.
 
 depend()
 {
@@ -19,11 +16,6 @@ start()
 {
local x= fs= rc=
for x in $net_fs_list $extra_net_fs_list; do
-   case $x in
-   nfs|nfs4)
-   continue
-   ;;
-   esac
fs=$fs${fs:+,}$x
done
 
@@ -46,14 +38,7 @@ stop()
. $RC_LIBEXECDIR/sh/rc-mount.sh
 
for x in $net_fs_list $extra_net_fs_list; do
-   case $x in
-   nfs|nfs4)
-   continue
-   ;;
-   *)
-   fs=$fs${fs:+,}$x
-   ;;
-   esac
+   fs=$fs${fs:+,}$x
done
if [ -n $fs ]; then
umount -at $fs || eerror Failed to simply unmount filesystems



[gentoo-commits] proj/openrc:master commit in: src/librc/

2014-10-20 Thread William Hubbs
commit: f9acd65497c6e561fbf5420386a99d681fede859
Author: Alexander Vershilov alexander.vershilov AT gmail DOT com
AuthorDate: Mon Oct 20 00:41:36 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 20 20:44:19 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=f9acd654

librc:look for the pid file in a chroot if defined

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

---
 src/librc/librc-daemon.c | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 8793075..04f25b1 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -553,16 +553,28 @@ rc_service_daemons_crashed(const char *service)
}
fclose(fp);
 
+   char *ch_root = rc_service_value_get(basename_c(service), 
chroot);
+   char *spidfile = pidfile;
+   if (ch_root) {
+   spidfile = malloc(strlen(ch_root) + strlen(pidfile));
+   strcpy(spidfile, ch_root);
+   strcat(spidfile, pidfile);
+   }
+
pid = 0;
-   if (pidfile) {
+   if (spidfile) {
retval = true;
-   if ((fp = fopen(pidfile, r))) {
+   if ((fp = fopen(spidfile, r))) {
if (fscanf(fp, %d, pid) == 1)
retval = false;
fclose(fp);
}
-   free(pidfile);
-   pidfile = NULL;
+   free(spidfile);
+   spidfile = NULL;
+   if (ch_root) {
+   free(pidfile);
+   pidfile = NULL;
+   }
 
/* We have the pid, so no need to match
   on exec or name */



[gentoo-commits] proj/openrc:master commit in: /

2014-10-20 Thread William Hubbs
commit: 9bf789f78890c8b5879d29acb9fb0e23285baee4
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Oct 20 20:52:11 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 20 20:52:11 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=9bf789f7

Update news file wrt chroot variable

---
 NEWS | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NEWS b/NEWS
index 8858f46..aea5232 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ This file will contain a list of notable changes for each 
release.
 
 OpenRC-0.13.2
 =
+
+A chroot variable has been added to the service script variables.
+This fixes the support for running a service in a chroot.
+This is documented in man 8 openrc-run.
+
 The netmount service now mounts nfs file systems.
 This change was made to correct a fix for an earlier bug.
 



[gentoo-commits] proj/openrc:master commit in: sh/, man/

2014-10-20 Thread William Hubbs
commit: 8c7ea4e9e8da500877a514402bbe90aababda2d6
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Oct 20 00:36:57 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 20 20:44:19 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8c7ea4e9

runscript.sh: add chroot support

This adds support for a chroot variable which will be passed to the
start-stop-daemon --chroot switch to runscript.sh when starting a
daemon. This also needs to be saved so it can be used in locating the
pid file when stopping the daemon.

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

---
 man/openrc-run.8   | 3 +++
 sh/runscript.sh.in | 6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/man/openrc-run.8 b/man/openrc-run.8
index c8bf24d..3308f24 100644
--- a/man/openrc-run.8
+++ b/man/openrc-run.8
@@ -120,6 +120,9 @@ Set this to true, yes or 1 (case-insensitive) to 
force the daemon into
 the background. This implies the --make-pidfile and --pidfile option of
 .Xr start-stop-daemon 8
 so the pidfile variable must be set.
+.It Ar chroot
+.Xr start-stop-daemon 8
+will chroot into this path before writing the pid file or starting the daemon.
 .It Ar pidfile
 Pidfile to use for the above defined command.
 .It Ar name

diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index b89c460..06d51d0 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -142,12 +142,14 @@ start()
fi
eval start-stop-daemon --start \
--exec $command \
+   ${chroot:+--chroot} $chroot \
${procname:+--name} $procname \
${pidfile:+--pidfile} $pidfile \
$_background $start_stop_daemon_args \
-- $command_args
if eend $? Failed to start $RC_SVCNAME; then
service_set_value command ${command}
+   [ -n ${chroot} ]  service_set_value chroot ${chroot}
[ -n ${pidfile} ]  service_set_value pidfile ${pidfile}
[ -n ${procname} ]  service_set_value procname 
${procname}
return 0
@@ -163,9 +165,11 @@ start()
 stop()
 {
local startcommand=$(service_get_value command)
+   local startchroot=$(service_get_value chroot)
local startpidfile=$(service_get_value pidfile)
local startprocname=$(service_get_value procname)
command=${startcommand:-$command}
+   chroot=${startchroot:-$chroot}
pidfile=${startpidfile:-$pidfile}
procname=${startprocname:-$procname}
[ -n $command -o -n $procname -o -n $pidfile ] || return 0
@@ -174,7 +178,7 @@ stop()
${retry:+--retry} $retry \
${command:+--exec} $command \
${procname:+--name} $procname \
-   ${pidfile:+--pidfile} $pidfile \
+   ${pidfile:+--pidfile} $chroot$pidfile \
${stopsig:+--signal} $stopsig
eend $? Failed to stop $RC_SVCNAME
 }



[gentoo-commits] proj/openrc:master commit in: /

2014-10-20 Thread William Hubbs
commit: 5f1439f1aac14618592789042e05daaf80f55a15
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Oct 20 20:28:13 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Oct 20 20:38:51 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5f1439f1

Add NEWS file

---
 NEWS   | 39 +++
 README | 28 
 2 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/NEWS b/NEWS
new file mode 100644
index 000..8858f46
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,39 @@
+OpenRC NEWS
+
+This file will contain a list of notable changes for each release.
+
+OpenRC-0.13.2
+=
+The netmount service now mounts nfs file systems.
+This change was made to correct a fix for an earlier bug.
+
+OpenRC-0.13
+===
+
+/sbin/rc was renamed to /sbin/openrc and /sbin/runscript was renamed to
+/sbin/openrc-run due to naming conflicts with other software.
+
+Backward compatible symbolic links are currently in place so your
+system will keep working if you are using the old names; however, it is
+strongly advised that you migrate to the new names because the symbolic
+links will be removed in the future.
+Warnings have been added to assist with this migration; however, due to the
+level of noise they produce, they only appear in verbose mode in this release.
+
+The devfs script now handles the initial mounting and setup of the
+/dev directory. If /dev has already been mounted by the kernel or an
+initramfs, devfs will remount /dev with the correct mount options
+instead of mounting a second /dev over the existing mount point.
+
+It attempts to mount /dev from fstab first if an entry exists there. If
+it doesn't it attempts to mount devtmpfs if it is configured in the
+kernel. If not, it attempts to mount tmpfs.
+If none of these is available, an error message is displayed and static
+/dev is assumed.
+
+OpenRC-0.12
+===
+
+The net.* scripts, originally from Gentoo Linux, have
+been removed. If you need these scripts, look for a package called
+netifrc, which is maintained by them.

diff --git a/README b/README
index 12eb50c..91e5935 100644
--- a/README
+++ b/README
@@ -57,34 +57,6 @@ init.d.misc is not installed by default as the scripts will 
need
 tweaking on a per distro basis. They are also non essential to the operation
 of the system.
 
-As of OpenRC-0.12, the net.* scripts, originally from Gentoo Linux, have
-been removed. If you need these scripts, look for a package called
-netifrc, which is maintained by them.
-
-As of OpenRC-0.13, two binaries have been renamed due to naming
-conflicts with other software. The /sbin/rc binary was renamed to
-/sbin/openrc, and /sbin/runscript was renamed to /sbin/openrc-run.
-
-Backward compatible symbolic links are currently in place so your
-system will keep working if you are using the old names; however, it is
-strongly advised that you migrate to the new names because the symbolic
-links will be removed in the future.
-
-Warnings have been added to assist with this migration; however, they
-only show in verbose mode in this release due to the level of noise they
-produce.
-
-Also, the devfs script now handles the initial mounting and setup of the
-/dev directory. If /dev has already been mounted by the kernel or an
-initramfs, devfs will remount /dev with the correct mount options
-instead of mounting a second /dev over the existing mount point.
-
-It attempts to mount /dev from fstab first if an entry exists there. If
-it doesn't it attempts to mount devtmpfs if it is configured in the
-kernel. If not, it attempts to mount tmpfs.
-If none of these is available, an error message is displayed and static
-/dev is assumed.
-
 Reporting Bugs
 --
 Since Gentoo Linux is hosting OpenRC development, Bugs should go to



[gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/

2014-12-03 Thread William Hubbs
commit: 4a106494f2d0c42ca191412ad5903e728334c5c1
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Dec  4 00:53:47 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Dec  4 00:53:47 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=4a106494

add provide for dev-settle

---
 init.d/udev-settle | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init.d/udev-settle b/init.d/udev-settle
index dd3fe4b..f5253f5 100644
--- a/init.d/udev-settle
+++ b/init.d/udev-settle
@@ -6,6 +6,7 @@ depend()
 {
 need udev
 after udev-trigger
+provide dev-settle
keyword -vserver -lxc
 }
 



[gentoo-commits] proj/openrc:master commit in: mk/, src/rc/, /

2014-12-05 Thread William Hubbs
commit: 7a92eb888794819a339babd0ee220b6aa3993db1
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Dec  5 17:55:16 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Dec  5 17:55:45 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=7a92eb88

rename git.mk to gitver.mk

This is a more descriptive name since this file only sets the gitver
variable.

---
 Makefile | 2 +-
 mk/{git.mk = gitver.mk} | 0
 src/rc/Makefile  | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 119a27e..6e9198c 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ include ${MK}/sys.mk
 include ${MK}/os.mk
 include ${MK}/subdir.mk
 include ${MK}/dist.mk
-include ${MK}/git.mk
+include ${MK}/gitver.mk
 
 _installafter:
 ifeq (${MKPREFIX},yes)

diff --git a/mk/git.mk b/mk/gitver.mk
similarity index 100%
rename from mk/git.mk
rename to mk/gitver.mk

diff --git a/src/rc/Makefile b/src/rc/Makefile
index bd8b942..d2b2ac5 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -42,7 +42,7 @@ LDADD+=   -lutil -lrc -leinfo
 include ../../Makefile.inc
 MK=../../mk
 include ${MK}/prog.mk
-include ${MK}/git.mk
+include ${MK}/gitver.mk
 include ${MK}/cc.mk
 
 include ${MK}/termcap.mk



[gentoo-commits] proj/openrc:master commit in: mk/

2014-12-07 Thread William Hubbs
commit: 3647db7a27f7a5ca14b33b14effeb945fd986210
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Dec  7 23:16:48 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Dec  7 23:16:48 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=3647db7a

Add target to create ChangeLog

This was added by request because some users are requesting a ChangeLog.

This fixes #29.

---
 mk/dist.mk | 5 +
 1 file changed, 5 insertions(+)

diff --git a/mk/dist.mk b/mk/dist.mk
index 82fb8cb..6c37dc8 100644
--- a/mk/dist.mk
+++ b/mk/dist.mk
@@ -8,12 +8,17 @@ DISTFILE?=${DISTPREFIX}.tar.bz2
 
 CLEANFILES+=   ${NAME}-*.tar.bz2
 
+CHANGELOG_LIMIT?= --after=$(shell date --utc --date=1 year ago +%Y-%m-%d)
+
 _SNAP_SH=  date -u +%Y%m%d%H%M
 _SNAP:=$(shell ${_SNAP_SH})
 SNAP=  ${_SNAP}
 SNAPDIR=   ${DISTPREFIX}-${SNAP}
 SNAPFILE=  ${SNAPDIR}.tar.bz2
 
+changelog:
+   git log ${CHANGELOG_LIMIT} --format=medium  ChangeLog
+
 dist:
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2  ${DISTFILE}
 



[gentoo-commits] proj/openrc:master commit in: etc/

2014-12-07 Thread William Hubbs
commit: 72186ea3bbbf0b09b88a6f3e1fb23bf04ce1ddad
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Dec  8 01:06:51 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Dec  8 01:07:11 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=72186ea3

etc/rc and etc/rc.shutdown: change references from rc to openrc

---
 etc/rc.in  | 6 +++---
 etc/rc.shutdown.in | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/etc/rc.in b/etc/rc.in
index 864bd1b..e6fb38b 100644
--- a/etc/rc.in
+++ b/etc/rc.in
@@ -10,9 +10,9 @@
 trap : SIGINT
 trap echo 'Boot interrupted'; exit 1 SIGQUIT
 
-/sbin/rc sysinit || exit 1
-/sbin/rc boot || exit 1
-/sbin/rc default
+/sbin/openrc sysinit || exit 1
+/sbin/openrc boot || exit 1
+/sbin/openrc default
 
 # We don't actually care if rc default worked or not, we should exit 0
 # to allow logins

diff --git a/etc/rc.shutdown.in b/etc/rc.shutdown.in
index 216e2f8..88c7b93 100644
--- a/etc/rc.shutdown.in
+++ b/etc/rc.shutdown.in
@@ -14,4 +14,4 @@ LD_LIBRARY_PATH=/lib${LD_LIBRARY_PATH:+:}${LDLIBRARY_PATH} 
; export LD_LIBRARY
 [ -z $TERM -o $TERM = dumb ]  TERM=@TERM@  export TERM
 
 action=${1:-shutdown}
-exec /sbin/rc ${action}
+exec /sbin/openrc ${action}



[gentoo-commits] proj/openrc:master commit in: mk/

2014-12-08 Thread William Hubbs
commit: 6a9679377f4de257f02de1d16a513df14b4c25ba
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Dec  8 15:47:42 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Dec  8 15:47:42 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6a967937

Do not call the shell to evaluate CHANGELOG_LIMIT

The git log command understands dates such as 1 year ago, so there is
no need to use the date command.

---
 mk/dist.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/dist.mk b/mk/dist.mk
index 6c37dc8..4f7babb 100644
--- a/mk/dist.mk
+++ b/mk/dist.mk
@@ -8,7 +8,7 @@ DISTFILE?=  ${DISTPREFIX}.tar.bz2
 
 CLEANFILES+=   ${NAME}-*.tar.bz2
 
-CHANGELOG_LIMIT?= --after=$(shell date --utc --date=1 year ago +%Y-%m-%d)
+CHANGELOG_LIMIT?= --after=1 year ago
 
 _SNAP_SH=  date -u +%Y%m%d%H%M
 _SNAP:=$(shell ${_SNAP_SH})



[gentoo-commits] proj/openrc:master commit in: man/

2014-07-13 Thread William Hubbs
commit: d59737afb159d993916836903d9e670a1334c93a
Author: Alexander V Vershilov qnikst AT gentoo DOT org
AuthorDate: Sun Feb 16 00:08:23 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Jul 13 13:50:36 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d59737af

man/openrc.8: update checkpath documentation

X-GENTOO-BUG: 500606
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606

---
 man/openrc-run.8 | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/man/openrc-run.8 b/man/openrc-run.8
index 0ce1f75..07f3527 100644
--- a/man/openrc-run.8
+++ b/man/openrc-run.8
@@ -322,10 +322,25 @@ Mark the service as inactive.
 .Op Fl p , -pipe
 .Op Fl m , -mode Ar mode
 .Op Fl o , -owner Ar owner
+.Op Fl q , -quiet
 .Ar path ...
 .Xc
 Checks to see if the path exists, is of the right type, owned by the right
 people and has the correct access modes. If not, then it corrects the path.
+
+Type.
+File, directory and pipe types are supported, if type is not provided then
+directory is used
+
+Mode.
+Mode should be provided as a three (644) or four digit string (0644). If mode
+is argument is not provided then default value is used: 0644 - for files, and
+0775 for directories.
+
+Truncate variant of options create empty directory or file, or clears contents
+if it exists.
+
+Quiet argument suppress normal output, repeat quiet argument to suppress 
errors.
 .It Ic checkpath
 .Op Fl W , -writable
 .Ar path



[gentoo-commits] proj/openrc:master commit in: man/

2014-07-13 Thread William Hubbs
commit: 40141244e349e6e1d2dfb9ebfbcbf62f68d33a9d
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Jul 13 16:15:26 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Jul 13 16:23:43 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=40141244

man/openrc-run.8: more updates and clarifications for checkpath

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

---
 man/openrc-run.8 | 39 ++-
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/man/openrc-run.8 b/man/openrc-run.8
index 07f3527..3890f76 100644
--- a/man/openrc-run.8
+++ b/man/openrc-run.8
@@ -322,30 +322,35 @@ Mark the service as inactive.
 .Op Fl p , -pipe
 .Op Fl m , -mode Ar mode
 .Op Fl o , -owner Ar owner
+.Op Fl W , -writable
 .Op Fl q , -quiet
 .Ar path ...
 .Xc
-Checks to see if the path exists, is of the right type, owned by the right
-people and has the correct access modes. If not, then it corrects the path.
+If -d, -f or -p is specified, checkpath checks to see if the path
+exists, is the right type and has the correct owner and access modes. If
+any of these tests fail, the path is created and set up as specified. If
+more than one of -d, -f or -p are specified, the last one will be used.
 
-Type.
-File, directory and pipe types are supported, if type is not provided then
-directory is used
+The argument to -m is a three or four digit octal number. If this option
+is not provided, the value defaults to 0644 for files and 0775 for
+directories.
 
-Mode.
-Mode should be provided as a three (644) or four digit string (0644). If mode
-is argument is not provided then default value is used: 0644 - for files, and
-0775 for directories.
+The argument to -o is a representation of the user and/or group which
+should own the path. The user and group can be represented numerically
+or with names, and are separated by a colon.
 
-Truncate variant of options create empty directory or file, or clears contents
-if it exists.
+The truncate options (-D and -F) cause the directory or file to be
+cleared of all contents.
 
-Quiet argument suppress normal output, repeat quiet argument to suppress 
errors.
-.It Ic checkpath
-.Op Fl W , -writable
-.Ar path
-.Xc
-checks to see if the path is writable.
+If -W is specified, checkpath checks to see if the first path given on
+the command line is writable.  This is different from how the test
+command in the shell works, because it also checks to make sure the file
+system is not read only.
+
+Also, the -d, -f or -p options should not be specified along with this option.
+
+The -q option suppresses all informational output. If it is specified
+twice, all error messages are suppressed as well.
 .It Ic yesno Ar value
 If
 .Ar value



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-13 Thread William Hubbs
commit: 71d6d61b28c4c0f285ec51459551d900dfa4ea71
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Jul 13 19:12:36 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Jul 13 19:12:36 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=71d6d61b

checkpath: fix logic for the writable option

The -W option does not need an argument of its own; it can take the
first path after all other options are processed on the command line.

Also, move the processing for the -W option out of the switch so it will
be in the same loop as the other processing.

---
 src/rc/checkpath.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 3c6c5ca..6a0f893 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -187,7 +187,7 @@ parse_owner(struct passwd **user, struct group **group, 
const char *owner)
 
 #include _usage.h
 #define extraopts path1 [path2] [...]
-#define getoptstring dDfFpm:o:W: getoptstring_COMMON
+#define getoptstring dDfFpm:o:W getoptstring_COMMON
 static const struct option longopts[] = {
{ directory,  0, NULL, 'd'},
{ directory-truncate, 0, NULL, 'D'},
@@ -196,7 +196,7 @@ static const struct option longopts[] = {
{ pipe,   0, NULL, 'p'},
{ mode,   1, NULL, 'm'},
{ owner,  1, NULL, 'o'},
-   { writable,   1, NULL, 'W'},
+   { writable,   0, NULL, 'W'},
longopts_COMMON
 };
 static const char * const longopts_help[] = {
@@ -225,6 +225,7 @@ checkpath(int argc, char **argv)
int retval = EXIT_SUCCESS;
bool trunc = false;
bool chowner = false;
+   bool writable = false;
 
while ((opt = getopt_long(argc, argv, getoptstring,
longopts, (int *) 0)) != -1)
@@ -255,9 +256,7 @@ checkpath(int argc, char **argv)
applet, optarg);
break;
case 'W':
-   if (argv[optind] != NULL)
-   ewarn(-W/--writable takes only one path, 
everything else will be ignored);
-   exit(!is_writable(optarg));
+   writable = true;
break;
 
case_RC_COMMON_GETOPT
@@ -267,8 +266,8 @@ checkpath(int argc, char **argv)
if (optind = argc)
usage(EXIT_FAILURE);
 
-   if (type == inode_unknown)
-   eerrorx(%s: -d, -f, -p, or -W must be specified., applet);
+   if (writable  type != inode_unknown)
+   eerrorx(%s: -W cannot be specified along with -d, -f or -p, 
applet);
 
if (pw) {
uid = pw-pw_uid;
@@ -278,6 +277,8 @@ checkpath(int argc, char **argv)
gid = gr-gr_gid;
 
while (optind  argc) {
+   if (writable)
+   exit(!is_writable(argv[optind]));
if (do_check(argv[optind], uid, gid, mode, type, trunc, 
chowner))
retval = EXIT_FAILURE;
optind++;



[gentoo-commits] proj/openrc:master commit in: mk/

2014-07-16 Thread William Hubbs
commit: 4a1afa694cd8ebd6591d5a825ee35e4f57c98469
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Tue Jul 15 16:38:02 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Tue Jul 15 16:38:19 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=4a1afa69

Add SELinux support to the build system

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

---
 mk/os-Linux.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk
index 40d9c34..dc76b96 100644
--- a/mk/os-Linux.mk
+++ b/mk/os-Linux.mk
@@ -6,3 +6,9 @@ PKG_PREFIX?=/usr
 
 CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700
 LIBDL= -Wl,-Bdynamic -ldl
+
+ifeq (${MKSELINUX},yes)
+CPPFLAGS+= -DHAVE_SELINUX
+LIBSELINUX= -lselinux
+LDADD += $(LIBSELINUX)
+endif



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-16 Thread William Hubbs
commit: 9c689542c3246e793310db938374bc97600435e6
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Tue Jul 15 18:27:34 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 18:09:38 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=9c689542

checkpath: restore the SELinux context

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

---
 src/rc/Makefile  |   6 ++-
 src/rc/checkpath.c   |  28 ---
 src/rc/rc-selinux-util.c | 126 +++
 src/rc/rc-selinux-util.h |  33 +
 4 files changed, 186 insertions(+), 7 deletions(-)

diff --git a/src/rc/Makefile b/src/rc/Makefile
index 5f5aa63..fb5265c 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -4,7 +4,11 @@ SRCS=  checkpath.c fstabinfo.c mountinfo.c 
start-stop-daemon.c \
rc-misc.c rc-plugin.c rc-service.c rc-status.c rc-update.c \
runscript.c rc.c swclock.c
 
-CLEANFILES=version.h
+ifeq (${MKSELINUX},yes)
+SRCS+= rc-selinux-util.c
+endif
+
+CLEANFILES=version.h rc-selinux-util.o
 
 BINDIR=${PREFIX}/bin
 SBINDIR=   ${PREFIX}/sbin

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 6a0f893..6945b67 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -46,6 +46,10 @@
 #include einfo.h
 #include rc-misc.h
 
+#ifdef HAVE_SELINUX
+#include rc-selinux-util.h
+#endif
+
 typedef enum {
inode_unknown = 0,
inode_file = 1,
@@ -55,13 +59,9 @@ typedef enum {
 
 extern const char *applet;
 
-/* TODO: SELinux
- * This needs a LOT of SELinux loving
- * See systemd's src/label.c:label_mkdir
- */
 static int
 do_check(char *path, uid_t uid, gid_t gid, mode_t mode, inode_t type,
-   bool trunc, bool chowner)
+   bool trunc, bool chowner, bool selinux_on)
 {
struct stat st;
int fd, flags;
@@ -149,6 +149,11 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode, 
inode_t type,
}
}
 
+#ifdef HAVE_SELINUX
+   if (selinux_on)
+   selinux_util_label(path);
+#endif
+
return 0;
 }
 
@@ -226,6 +231,7 @@ checkpath(int argc, char **argv)
bool trunc = false;
bool chowner = false;
bool writable = false;
+   bool selinux_on = false;
 
while ((opt = getopt_long(argc, argv, getoptstring,
longopts, (int *) 0)) != -1)
@@ -276,13 +282,23 @@ checkpath(int argc, char **argv)
if (gr)
gid = gr-gr_gid;
 
+#ifdef HAVE_SELINUX
+   if (1 == selinux_util_open())
+   selinux_on = true;
+#endif
+
while (optind  argc) {
if (writable)
exit(!is_writable(argv[optind]));
-   if (do_check(argv[optind], uid, gid, mode, type, trunc, 
chowner))
+   if (do_check(argv[optind], uid, gid, mode, type, trunc, 
chowner, selinux_on))
retval = EXIT_FAILURE;
optind++;
}
 
+#ifdef HAVE_SELINUX
+   if (selinux_on)
+   selinux_util_close();
+#endif
+
return retval;
 }

diff --git a/src/rc/rc-selinux-util.c b/src/rc/rc-selinux-util.c
new file mode 100644
index 000..6cbb5db
--- /dev/null
+++ b/src/rc/rc-selinux-util.c
@@ -0,0 +1,126 @@
+/*
+  rc-selinux.c
+  SELinux helpers to get and set contexts.
+*/
+
+/*
+ * Copyright (c) 2014 Jason Zaman ja...@perfinion.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include stddef.h
+#include errno.h
+
+#include sys/stat.h
+
+#include selinux/selinux.h
+#include selinux/label.h
+
+#include rc-selinux-util.h

[gentoo-commits] proj/openrc:master commit in: sh/

2014-07-16 Thread William Hubbs
commit: 4f784bd46923486773edcd7749246a21bd419e6b
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Tue Jul 15 18:27:32 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 15:53:25 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=4f784bd4

tmpfiles: set the proper SELinux context

Restore the label on the created file / dir based on the policy
fcontexts.

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

---
 sh/tmpfiles.sh.in | 16 
 1 file changed, 16 insertions(+)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 66612fc..da64011 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -52,12 +52,20 @@ relabel() {
done
 }
 
+_restorecon() {
+local path=$1
+if [ -x /sbin/restorecon ]; then
+dryrun_or_real restorecon -F $path
+fi
+}
+
 _b() {
# Create a block device node if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
if [ ! -e $path ]; then
dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:}
dryrun_or_real chown $uid:$gid $path
+   _restorecon $path
fi
 }
 
@@ -67,6 +75,7 @@ _c() {
if [ ! -e $path ]; then
dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:}
dryrun_or_real chown $uid:$gid $path
+   _restorecon $path
fi
 }
 
@@ -80,6 +89,7 @@ _f() {
if [ ! -e $path ]; then
dryrun_or_real install -m$mode -o$uid -g$gid /dev/null 
$path
[ -z $arg ] || _w $@
+   _restorecon $path
fi
 }
 
@@ -91,6 +101,7 @@ _F() {
 
dryrun_or_real install -m$mode -o$uid -g$gid /dev/null $path
[ -z $arg ] || _w $@
+   _restorecon $path
 }
 
 _d() {
@@ -101,6 +112,7 @@ _d() {
 
if [ ! -d $path ]; then
dryrun_or_real install -d -m$mode -o$uid -g$gid $path
+   _restorecon $path
fi
 }
 
@@ -110,10 +122,12 @@ _D() {
 
if [ -d $path ]  [ $REMOVE -gt 0 ]; then
dryrun_or_real find $path -mindepth 1 -maxdepth 1 -xdev -exec 
rm -rf {} +
+   _restorecon $path
fi
 
if [ $CREATE -gt 0 ]; then
dryrun_or_real install -d -m$mode -o$uid -g$gid $path
+   _restorecon $path
fi
 }
 
@@ -121,6 +135,7 @@ _L() {
# Create a symlink if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
[ ! -e $path ]  dryrun_or_real ln -s $arg $path
+   _restorecon $path
 }
 
 _p() {
@@ -132,6 +147,7 @@ _p() {
if [ ! -p $path ]; then
dryrun_or_real mkfifo -m$mode $path
dryrun_or_real chown $uid:$gid $path
+   _restorecon $path
fi
 }
 



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-16 Thread William Hubbs
commit: 525d7140b12a8e259f9d919f24148e369e9ff7d1
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Tue Jul 15 18:27:33 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 16:58:11 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=525d7140

devfs: fix SELinux contexts

SELinux contexts in /dev need to be fixed after it is mounted

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

---
 init.d/devfs.in | 12 
 1 file changed, 12 insertions(+)

diff --git a/init.d/devfs.in b/init.d/devfs.in
index ae5f03b..196bc57 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -92,9 +92,21 @@ seed_dev()
done
 }
 
+restorecon_dev()
+{
+   if [ -x /sbin/restorecon ]; then
+   ebegin Set SELinux labels in /dev
+   restorecon -rF /dev /dev/null 21
+   eend $?
+   fi
+
+   return 0
+}
+
 start()
 {
mount_dev
seed_dev
+   restorecon_dev
return 0
 }



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-16 Thread William Hubbs
commit: 010c2ab18b4be2068237cf0db97e9348bba65ac6
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Jul 16 19:14:37 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 19:14:37 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=010c2ab1

Rename SELinux source files

The name rc-selinux-util.* is a bit long, so I renamed the source files
to rc-selinux.*

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

---
 src/rc/Makefile| 4 ++--
 src/rc/checkpath.c | 2 +-
 src/rc/{rc-selinux-util.c = rc-selinux.c} | 2 +-
 src/rc/{rc-selinux-util.h = rc-selinux.h} | 0
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/rc/Makefile b/src/rc/Makefile
index fb5265c..609794a 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -5,10 +5,10 @@ SRCS= checkpath.c fstabinfo.c mountinfo.c 
start-stop-daemon.c \
runscript.c rc.c swclock.c
 
 ifeq (${MKSELINUX},yes)
-SRCS+= rc-selinux-util.c
+SRCS+= rc-selinux.c
 endif
 
-CLEANFILES=version.h rc-selinux-util.o
+CLEANFILES=version.h rc-selinux.o
 
 BINDIR=${PREFIX}/bin
 SBINDIR=   ${PREFIX}/sbin

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 6945b67..b0384bd 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -47,7 +47,7 @@
 #include rc-misc.h
 
 #ifdef HAVE_SELINUX
-#include rc-selinux-util.h
+#include rc-selinux.h
 #endif
 
 typedef enum {

diff --git a/src/rc/rc-selinux-util.c b/src/rc/rc-selinux.c
similarity index 99%
rename from src/rc/rc-selinux-util.c
rename to src/rc/rc-selinux.c
index 6cbb5db..8e780c9 100644
--- a/src/rc/rc-selinux-util.c
+++ b/src/rc/rc-selinux.c
@@ -36,7 +36,7 @@
 #include selinux/selinux.h
 #include selinux/label.h
 
-#include rc-selinux-util.h
+#include rc-selinux.h
 
 static struct selabel_handle *hnd = NULL;
 

diff --git a/src/rc/rc-selinux-util.h b/src/rc/rc-selinux.h
similarity index 100%
rename from src/rc/rc-selinux-util.h
rename to src/rc/rc-selinux.h



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-16 Thread William Hubbs
commit: 8b8edc29705b843988b97242942a409241c182eb
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Jul 16 19:48:03 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 19:48:03 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8b8edc29

style fixes

---
 src/rc/rc-selinux.c | 21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/rc/rc-selinux.c b/src/rc/rc-selinux.c
index 8e780c9..7c1ee80 100644
--- a/src/rc/rc-selinux.c
+++ b/src/rc/rc-selinux.c
@@ -40,8 +40,7 @@
 
 static struct selabel_handle *hnd = NULL;
 
-int
-selinux_util_label(const char *path)
+int selinux_util_label(const char *path)
 {
int retval = 0;
int enforce;
@@ -52,12 +51,12 @@ selinux_util_label(const char *path)
if (retval  0)
return retval;
 
-   if (NULL == hnd)
+   if (!hnd)
return (enforce) ? -1 : 0;
 
retval = lstat(path, st);
if (retval  0) {
-   if (ENOENT == errno)
+   if (errno == ENOENT)
return 0;
return (enforce) ? -1 : 0;
}
@@ -65,7 +64,7 @@ selinux_util_label(const char *path)
/* lookup the context */
retval = selabel_lookup_raw(hnd, con, path, st.st_mode);
if (retval  0) {
-   if (ENOENT == errno)
+   if (errno == ENOENT)
return 0;
return (enforce) ? -1 : 0;
}
@@ -74,9 +73,9 @@ selinux_util_label(const char *path)
retval = lsetfilecon(path, con);
freecon(con);
if (retval  0) {
-   if (ENOENT == errno)
+   if (errno == ENOENT)
return 0;
-   if (ENOTSUP == errno)
+   if (errno == ENOTSUP)
return 0;
return (enforce) ? -1 : 0;
}
@@ -88,8 +87,7 @@ selinux_util_label(const char *path)
  * Open the label handle
  * returns 1 on success, 0 if no selinux, negative on error
  */
-int
-selinux_util_open(void)
+int selinux_util_open(void)
 {
int retval = 0;
 
@@ -98,7 +96,7 @@ selinux_util_open(void)
return retval;
 
hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
-   if (NULL == hnd)
+   if (!hnd)
return -2;
 
return 1;
@@ -108,8 +106,7 @@ selinux_util_open(void)
  * Close the label handle
  * returns 1 on success, 0 if no selinux, negative on error
  */
-int
-selinux_util_close(void)
+int selinux_util_close(void)
 {
int retval = 0;
 



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-16 Thread William Hubbs
commit: a94a9740d545817294cc431180db0f22fc923b13
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Jul 16 20:03:11 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 20:03:11 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a94a9740

checkpath: style fixes

---
 src/rc/checkpath.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index b0384bd..ecd845f 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -59,9 +59,8 @@ typedef enum {
 
 extern const char *applet;
 
-static int
-do_check(char *path, uid_t uid, gid_t gid, mode_t mode, inode_t type,
-   bool trunc, bool chowner, bool selinux_on)
+static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
+   inode_t type, bool trunc, bool chowner, bool selinux_on)
 {
struct stat st;
int fd, flags;
@@ -157,8 +156,8 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode, 
inode_t type,
return 0;
 }
 
-static int
-parse_owner(struct passwd **user, struct group **group, const char *owner)
+static int parse_owner(struct passwd **user, struct group **group,
+   const char *owner)
 {
char *u = xstrdup (owner);
char *g = strchr (u, ':');
@@ -217,8 +216,7 @@ static const char * const longopts_help[] = {
 };
 #include _usage.c
 
-int
-checkpath(int argc, char **argv)
+int checkpath(int argc, char **argv)
 {
int opt;
uid_t uid = geteuid();



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-16 Thread William Hubbs
commit: 89907b60bac51db2cda1afe4555676577ef498a8
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Wed Jul 16 20:46:25 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 22:59:25 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=89907b60

move the selinux_setup function into rc-selinux

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

---
 src/rc/rc-selinux.c | 41 +
 src/rc/rc-selinux.h |  2 ++
 src/rc/runscript.c  | 45 +
 3 files changed, 48 insertions(+), 40 deletions(-)

diff --git a/src/rc/rc-selinux.c b/src/rc/rc-selinux.c
index 7c1ee80..eae030d 100644
--- a/src/rc/rc-selinux.c
+++ b/src/rc/rc-selinux.c
@@ -30,14 +30,24 @@
 
 #include stddef.h
 #include errno.h
+#include dlfcn.h
 
 #include sys/stat.h
 
 #include selinux/selinux.h
 #include selinux/label.h
 
+#include einfo.h
+#include rc.h
+#include rc-misc.h
+#include rc-plugin.h
 #include rc-selinux.h
 
+#define SELINUX_LIB RC_LIBDIR /runscript_selinux.so
+
+static void (*selinux_run_init_old) (void);
+static void (*selinux_run_init_new) (int argc, char **argv);
+
 static struct selabel_handle *hnd = NULL;
 
 int selinux_util_label(const char *path)
@@ -121,3 +131,34 @@ int selinux_util_close(void)
 
return 0;
 }
+
+void selinux_setup(int argc, char **argv)
+{
+   void *lib_handle = NULL;
+
+   if (!exists(SELINUX_LIB))
+   return;
+
+   lib_handle = dlopen(SELINUX_LIB, RTLD_NOW | RTLD_GLOBAL);
+   if (!lib_handle) {
+   eerror(dlopen: %s, dlerror());
+   return;
+   }
+
+   selinux_run_init_old = (void (*)(void))
+   dlfunc(lib_handle, selinux_runscript);
+   selinux_run_init_new = (void (*)(int, char **))
+   dlfunc(lib_handle, selinux_runscript2);
+
+   /* Use new run_init if it exists, else fall back to old */
+   if (selinux_run_init_new)
+   selinux_run_init_new(argc, argv);
+   else if (selinux_run_init_old)
+   selinux_run_init_old();
+   else
+   /* This shouldnt happen... probably corrupt lib */
+   eerrorx
+   (run_init is missing from runscript_selinux.so!);
+
+   dlclose(lib_handle);
+}

diff --git a/src/rc/rc-selinux.h b/src/rc/rc-selinux.h
index 69624b3..8cf73b0 100644
--- a/src/rc/rc-selinux.h
+++ b/src/rc/rc-selinux.h
@@ -30,4 +30,6 @@ int selinux_util_open(void);
 int selinux_util_label(const char *path);
 int selinux_util_close(void);
 
+void selinux_setup(int argc, char **argv);
+
 #endif

diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index 981e606..03d851e 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -36,7 +36,6 @@
 #include sys/wait.h
 
 #include ctype.h
-#include dlfcn.h
 #include errno.h
 #include fcntl.h
 #include fnmatch.h
@@ -66,7 +65,9 @@
 #include rc-misc.h
 #include rc-plugin.h
 
-#define SELINUX_LIB RC_LIBDIR /runscript_selinux.so
+#ifdef HAVE_SELINUX
+#include rc-selinux.h
+#endif
 
 #define PREFIX_LOCKRC_SVCDIR /prefix.lock
 
@@ -88,42 +89,6 @@ static int signal_pipe[2] = { -1, -1 };
 static RC_STRINGLIST *types_b, *types_n, *types_nu, *types_nua, *types_m;
 static RC_STRINGLIST *types_mua = NULL;
 
-#ifdef __linux__
-static void (*selinux_run_init_old)(void);
-static void (*selinux_run_init_new)(int argc, char **argv);
-
-static void
-setup_selinux(int argc, char **argv)
-{
-   void *lib_handle = NULL;
-
-   if (! exists(SELINUX_LIB))
-   return;
-
-   lib_handle = dlopen(SELINUX_LIB, RTLD_NOW | RTLD_GLOBAL);
-   if (! lib_handle) {
-   eerror(dlopen: %s, dlerror());
-   return;
-   }
-
-   selinux_run_init_old = (void (*)(void))
-   dlfunc(lib_handle, selinux_runscript);
-   selinux_run_init_new = (void (*)(int, char **))
-   dlfunc(lib_handle, selinux_runscript2);
-
-   /* Use new run_init if it exists, else fall back to old */
-   if (selinux_run_init_new)
-   selinux_run_init_new(argc, argv);
-   else if (selinux_run_init_old)
-   selinux_run_init_old();
-   else
-   /* This shouldnt happen... probably corrupt lib */
-   eerrorx(run_init is missing from runscript_selinux.so!);
-
-   dlclose(lib_handle);
-}
-#endif
-
 static void
 handle_signal(int sig)
 {
@@ -1224,9 +1189,9 @@ openrc_run(int argc, char **argv)
eprefix(prefix);
}
 
-#ifdef __linux__
+#ifdef HAVE_SELINUX
/* Ok, we are ready to go, so setup selinux if applicable */
-   setup_selinux(argc, argv);
+   selinux_setup(argc, argv);
 #endif
 
deps = true;



[gentoo-commits] proj/gentoo-news:master commit in: 2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/

2014-07-16 Thread William Hubbs
commit: 61cef991cc061d71ced1971c20e4745a63da96ef
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Jul 16 23:08:02 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 23:08:02 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/gentoo-news.git;a=commit;h=61cef991

news item about dhcpcd-6.4.2 changing defaults

---
 ...7-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt | 27 ++
 ...cpcd_6.4.2_changes_defaults_for_ipv6.en.txt.asc |  7 ++
 2 files changed, 34 insertions(+)

diff --git 
a/2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt
 
b/2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt
new file mode 100644
index 000..11ce7a0
--- /dev/null
+++ 
b/2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt
@@ -0,0 +1,27 @@
+Title: dhcpcd = 6.4.2 changes defaults for IPv6
+Author: William Hubbs willi...@gentoo.org
+Content-Type: text/plain
+Posted: 2014-07-17
+Revision: 1
+News-Item-Format: 1.0
+Display-If-Installed: =net-misc/dhcpcd-6.4.2
+
+dhcpcd-6.4.2 and newer supports IPv6 stable private addresses when using
+IPv6 stateless address autoconfiguration (SLAAC) as described in
+RFC-7217 [1]. The configuration file shipped with dhcpcd activates this
+feature by default, because it means that a machine cannot be tracked
+across multiple networks since its address will no longer be based on
+the hardware address of the interface.
+
+I received a report in testing that IPv6 connectivity was lost due
+to this change [2]. If you are concerned about losing IPv6 connectivity,
+temporarily comment out the line in dhcpcd.conf that says
+slaac private until you can adjust to the new configuration.
+
+See the references below for why the upstream default is to use stable
+private instead of hardware-based addresses.
+
+[1] http://tools.ietf.org/html/rfc7217
+[2] https://bugs.gentoo.org/show_bug.cgi?id=514198
+[3] http://tools.ietf.org/html/draft-ietf-6man-default-iids-00
+[4] http://mail-index.netbsd.org/tech-net/2014/06/04/msg004572.html

diff --git 
a/2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt.asc
 
b/2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt.asc
new file mode 100644
index 000..ec8af63
--- /dev/null
+++ 
b/2014/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6/2014-07-17-dhcpcd_6.4.2_changes_defaults_for_ipv6.en.txt.asc
@@ -0,0 +1,7 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v2
+
+iEYEABECAAYFAlPGk4MACgkQblQW9DDEZTiegQCffP0J23W1bUekr3CWpz9vkjDB
+u84An2AH3TlneRgOp5UMCuYZQ7Izcd+W
+=owFf
+-END PGP SIGNATURE-



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-16 Thread William Hubbs
commit: 99939b9839fb45093fe193e06139eab4a95637da
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Wed Jul 16 23:07:18 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 23:21:59 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=99939b98

sysfs: restorecon after mounting /sys

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

---
 init.d/sysfs.in | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index e01dcc8..2156670 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -120,6 +120,18 @@ mount_cgroups()
done  /proc/cgroups
 }
 
+restorecon_sys()
+{
+   if [ -x /sbin/restorecon ]; then
+   ebegin Restoring SELinux contexts in /sys
+   restorecon -F /sys/devices/system/cpu/online /dev/null 21
+   restorecon -rF /sys/fs/cgroup /dev/null 21
+   eend $?
+   fi
+
+   return 0
+}
+
 start()
 {
local retval
@@ -133,5 +145,8 @@ start()
mount_cgroups
retval=$?
fi
+
+   restorecon_sys
+
return $retval
 }



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-16 Thread William Hubbs
commit: 1a1d53335b2e6e3240b738ba1f81de64e552c337
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Wed Jul 16 23:07:19 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Jul 16 23:22:33 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1a1d5333

devfs: fix restorecon ebegin message to match sys

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

---
 init.d/devfs.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init.d/devfs.in b/init.d/devfs.in
index 196bc57..ca24231 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -95,7 +95,7 @@ seed_dev()
 restorecon_dev()
 {
if [ -x /sbin/restorecon ]; then
-   ebegin Set SELinux labels in /dev
+   ebegin Restoring SELinux contexts in /dev
restorecon -rF /dev /dev/null 21
eend $?
fi



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-07-17 Thread William Hubbs
commit: 40f42ced21b1c0c99780b801d28fafd91a858f90
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Jul 18 04:10:28 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul 18 04:10:28 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=40f42ced

rc-status: fix infinite  loop when using stacked runlevels

Remove the recursive call in print_stacked_services which was causing an
infinite loop when using stacked runlevels.
I would like to thank Doug Freed and Jason Zaman for assisting with
tracking this down.

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

---
 src/rc/rc-status.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c
index e38ce11..62591da 100644
--- a/src/rc/rc-status.c
+++ b/src/rc/rc-status.c
@@ -185,7 +185,6 @@ print_stacked_services(const char *runlevel)
servicelist = rc_services_in_runlevel(stackedlevel-value);
print_services(stackedlevel-value, servicelist);
rc_stringlist_free(servicelist);
-   print_stacked_services(stackedlevel-value);
}
rc_stringlist_free(stackedlevels);
stackedlevels = NULL;



[gentoo-commits] proj/openrc:master commit in: src/librc/

2014-07-19 Thread William Hubbs
commit: 1f7582c78b2697c3f2617a4a89afabaf3550b0fb
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sat Jul 19 18:03:00 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Jul 19 18:03:00 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1f7582c7

src/librc/librc-daemon.c: style fix

---
 src/librc/librc-daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index a53e6e1..8793075 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -131,7 +131,7 @@ rc_find_pids(const char *exec, const char *const *argv, 
uid_t uid, pid_t pid)
if (exists(/proc/self/status)) {
fp = fopen(/proc/self/status, r);
if (fp) {
-   while(! feof(fp)) {
+   while (! feof(fp)) {
rc_getline(line, len, fp);
if (strncmp(line, envID:\t0, 8) == 0) {
openvz_host = true;



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-07-24 Thread William Hubbs
commit: e3bfb68aece9378a0669c2893285808100fd5ea6
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Jul 23 21:19:25 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Jul 24 22:40:14 2014 +
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e3bfb68a

hwclock: always set the kernel's timezone

The hwclock service should set the time zone regardless of the setting
of the clock_hctosys variable. This needs to be done to prevent issues
when the system time is being synchronized using ntp.

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

---
 init.d/hwclock.in | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/init.d/hwclock.in b/init.d/hwclock.in
index 823a5ab..4b0da02 100644
--- a/init.d/hwclock.in
+++ b/init.d/hwclock.in
@@ -83,22 +83,17 @@ start()
fi
fi
 
+   # Always set the kernel's time zone.
+   _hwclock --systz $utc_cmd $clock_args
+   : $(( retval += $? ))
+
if [ -e /etc/adjtime ]  yesno $clock_adjfile; then
_hwclock --adjust $utc_cmd
: $(( retval += $? ))
fi
 
-   # If setting UTC, don't bother to run hwclock when first booting
-   # as that's the default
-   if [ $PREVLEVEL != N -o \
-   $utc_cmd != --utc -o \
-   -n $clock_args ];
-   then
-   if yesno ${clock_hctosys:-YES}; then
-   _hwclock --hctosys $utc_cmd $clock_args
-   else
-   _hwclock --systz $utc_cmd $clock_args
-   fi
+   if yesno ${clock_hctosys:-YES}; then
+   _hwclock --hctosys $utc_cmd $clock_args
: $(( retval += $? ))
fi
 



[gentoo-commits] proj/openrc:master commit in: sh/

2014-08-22 Thread William Hubbs
commit: c8018d04a7b238b57a3d74a68e2af02af395f510
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Aug 13 20:26:37 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Aug 13 20:26:37 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c8018d04

tmpfiles: fix relabel to run restorecon before chown and chmod

---
 sh/tmpfiles.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 8538545..42a3639 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -45,10 +45,10 @@ relabel() {
 
for path in ${paths}; do
if [ -e $path ]; then
+   [ -x /sbin/restorecon ]  dryrun_or_real restorecon 
$CHOPTS $path
[ $uid != '-' ]  dryrun_or_real chown $CHOPTS $uid 
$path
[ $gid != '-' ]  dryrun_or_real chgrp $CHOPTS $gid 
$path
[ $mode != '-' ]  dryrun_or_real chmod $CHOPTS 
$mode $path
-   [ -x /sbin/restorecon ]  dryrun_or_real restorecon 
$CHOPTS $path
fi
done
 }



[gentoo-commits] proj/openrc:master commit in: conf.d/

2014-08-22 Thread William Hubbs
commit: fb4bf540b4df011abea5985963dbc9e1646a
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Aug 10 18:00:39 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Aug 10 18:00:39 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=fb4b

hwclock: fix comments about the usage of clock_hctosys

The clock_hctosys variable should be set to YES if you are not using NTP to
synchronize your system time; it doesn't have anything to do with the
kernel configuration.

---
 conf.d/hwclock | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf.d/hwclock b/conf.d/hwclock
index fc65ac2..ce9b40a 100644
--- a/conf.d/hwclock
+++ b/conf.d/hwclock
@@ -8,7 +8,7 @@ clock=UTC
 # to match the current hardware clock during bootup, leave this
 # commented out.
 # However, you can set this to NO if you are running a modern kernel
-# with CONFIG_RTC_HCTOSYS set to y and your hardware clock set to UTC.
+# and using NTP to synchronize your system clock.
 #clock_hctosys=YES
 
 # If you do not want to set the hardware clock to the current system



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-08-22 Thread William Hubbs
commit: 4f4f00d612ce6b43a2dcba9e0c39816e5d6d92a7
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Aug 22 17:41:55 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Aug 22 19:01:20 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=4f4f00d6

cgroups: fix cgroup subsystem mounting

Originally, we aborted all of the cgroup setup if /sys/fs/cgroup/openrc
was already mounted. This  caused an issue in lxc containers, so we
should always allow the subsystems to be mounted.

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

---
 init.d/sysfs.in | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 2156670..67485c2 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -100,14 +100,15 @@ mount_misc()
 mount_cgroups()
 {
mountinfo -q /sys/fs/cgroup || return 0
-   mountinfo -q /sys/fs/cgroup/openrc || return 0
-
-   local agent=@LIBEXECDIR@/sh/cgroup-release-agent.sh
-   mkdir /sys/fs/cgroup/openrc
-   mount -n -t cgroup \
-   -o none,${sysfs_opts},name=openrc,release_agent=$agent \
-   openrc /sys/fs/cgroup/openrc
-   echo 1  /sys/fs/cgroup/openrc/notify_on_release
+
+   if ! mountinfo -q /sys/fs/cgroup/openrc; then
+   local agent=@LIBEXECDIR@/sh/cgroup-release-agent.sh
+   mkdir /sys/fs/cgroup/openrc
+   mount -n -t cgroup \
+   -o 
none,${sysfs_opts},name=openrc,release_agent=$agent \
+   openrc /sys/fs/cgroup/openrc
+   echo 1  /sys/fs/cgroup/openrc/notify_on_release
+   fi
 
yesno ${rc_controller_cgroups:-YES}  [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do



[gentoo-commits] proj/openrc:master commit in: sh/

2014-08-22 Thread William Hubbs
commit: 647e08eb9166d23d0c64f0c8767d93a06bd21a40
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Tue Aug  5 22:12:35 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Aug  7 17:54:04 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=647e08eb

tmpfiles.sh: do not use install

install is in /usr which causes problems if /usr is not mounted.
Instead, checkpath and mkdir -p can do everything required and are
both available before /usr is mounted.
Since checkpath also handles selinux labels correctly,
_restorecon after is not required.

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

---
 sh/tmpfiles.sh.in | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index da64011..63c5d14 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -15,6 +15,7 @@
 #
 
 DRYRUN=0
+CHECKPATH=@LIBEXECDIR@/bin/checkpath
 
 checkprefix() {
n=$1
@@ -87,9 +88,8 @@ _f() {
[ $CREATE -gt 0 ] || return 0
 
if [ ! -e $path ]; then
-   dryrun_or_real install -m$mode -o$uid -g$gid /dev/null 
$path
+   dryrun_or_real $CHECKPATH -fq -m $mode -o $uid:$gid $path
[ -z $arg ] || _w $@
-   _restorecon $path
fi
 }
 
@@ -99,9 +99,8 @@ _F() {
 
[ $CREATE -gt 0 ] || return 0
 
-   dryrun_or_real install -m$mode -o$uid -g$gid /dev/null $path
+   dryrun_or_real $CHECKPATH -Fq -m $mode -o $uid:$gid $path
[ -z $arg ] || _w $@
-   _restorecon $path
 }
 
 _d() {
@@ -111,8 +110,8 @@ _d() {
[ $CREATE -gt 0 ] || return 0
 
if [ ! -d $path ]; then
-   dryrun_or_real install -d -m$mode -o$uid -g$gid $path
-   _restorecon $path
+   dryrun_or_real mkdir -p $path 2/dev/null
+   dryrun_or_real $CHECKPATH -dq -m $mode -o $uid:$gid $path
fi
 }
 
@@ -126,8 +125,8 @@ _D() {
fi
 
if [ $CREATE -gt 0 ]; then
-   dryrun_or_real install -d -m$mode -o$uid -g$gid $path
-   _restorecon $path
+   dryrun_or_real mkdir -p $path 2/dev/null
+   dryrun_or_real $CHECKPATH -Dq -m $mode -o $uid:$gid $path
fi
 }
 
@@ -145,9 +144,7 @@ _p() {
[ $CREATE -gt 0 ] || return 0
 
if [ ! -p $path ]; then
-   dryrun_or_real mkfifo -m$mode $path
-   dryrun_or_real chown $uid:$gid $path
-   _restorecon $path
+   dryrun_or_real $CHECKPATH -pq -m $mode -o $uid:$gid $path
fi
 }
 



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-08-22 Thread William Hubbs
commit: 275714bdc74c363ca1612b2b6b97f74f7a62b50c
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Jul 25 16:04:57 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Jul 25 16:04:57 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=275714bd

checkpath: style fix

---
 src/rc/checkpath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index ecd845f..a65dbc2 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -281,7 +281,7 @@ int checkpath(int argc, char **argv)
gid = gr-gr_gid;
 
 #ifdef HAVE_SELINUX
-   if (1 == selinux_util_open())
+   if (selinux_util_open() == 1)
selinux_on = true;
 #endif
 



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-08-22 Thread William Hubbs
commit: 2624a8c8a7030180f9548a6e2fba5b0a82c5f046
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Jul 28 15:41:24 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Jul 28 15:41:24 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2624a8c8

checkpath: apply ownership to all paths given on command line

The stat structure was not being initialized correctly in do_check. This
was causing the owner adjustment to be skipped if the first path had the
correct owner.

Also, the correcting owner message should always be printed when the
owner is being changed.

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

---
 src/rc/checkpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index a65dbc2..94ab474 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -67,6 +67,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t 
mode,
int r;
int u;
 
+   memset(st, 0, sizeof(st));
if (stat(path, st) || trunc) {
if (type == inode_file) {
einfo(%s: creating file, path);
@@ -140,8 +141,7 @@ 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 (st.st_dev || st.st_ino)
-   einfo(%s: correcting owner, path);
+   einfo(%s: correcting owner, path);
if (chown(path, uid, gid)) {
eerror(%s: chown: %s, applet, strerror(errno));
return -1;



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-08-22 Thread William Hubbs
commit: 7b744befac2049eb6372a7f0c5420c740aa0a4ea
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Aug 10 22:15:05 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sun Aug 10 22:15:05 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=7b744bef

bootmisc: do not run the clean_run function in an LXC container

---
 init.d/bootmisc.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
index 3e56ebc..2ec075f 100644
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -117,7 +117,7 @@ migrate_to_run()
 
 clean_run()
 {
-   [ $RC_SYS = VSERVER ]  return 0
+   [ $RC_SYS = VSERVER -o $RC_SYS = LXC ]  return 0
local dir
dir=$(mktemp -d)
mount --bind / $dir



[gentoo-commits] proj/openrc:master commit in: src/rc/

2014-08-22 Thread William Hubbs
commit: d1e71b07afd4b900894ce4ea45f94010c70e32cc
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Aug 11 17:29:04 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Aug 11 17:32:44 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d1e71b07

Show rc and runscript deprecation warnings in verbose mode

These messages are being changed for this release to show in verbose
mode because of the number of times they display.

---
 src/rc/rc-applets.c | 2 +-
 src/rc/runscript.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c
index b4f61d9..8fe2d22 100644
--- a/src/rc/rc-applets.c
+++ b/src/rc/rc-applets.c
@@ -539,7 +539,7 @@ run_applets(int argc, char **argv)
 * openrc, so output a warning.
 */
if (strcmp(applet, rc) == 0)
-   ewarn(The 'rc' applet is deprecated; please use 'openrc' 
instead.);
+   ewarnv(The 'rc' applet is deprecated; please use 'openrc' 
instead.);
/* Bug 351712: We need an extra way to explicitly select an applet OTHER
 * than trusting argv[0], as argv[0] is not going to be the applet 
value if
 * we are doing SELinux context switching. For this, we allow calls 
such as

diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index 03d851e..de18f90 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -1389,6 +1389,6 @@ openrc_run(int argc, char **argv)
 int
 runscript(int argc, char **argv)
 {
-   ewarn(runscript is deprecated; please use openrc-run instead.);
+   ewarnv(runscript is deprecated; please use openrc-run instead.);
return (openrc_run(argc, argv));
 }



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-08-22 Thread William Hubbs
commit: d29db70efb2adfbd200ba4a03fa78653e97893a6
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Aug  7 03:01:30 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Aug  9 17:35:04 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d29db70e

sysctl.linux.in: use the --system option

According to the sysctl man page, the --system option causes sysctl to
process all system configuration files, which include the following:

/run/sysctl.d/*.conf
/etc/sysctl.d/*.conf
/usr/local/lib/sysctl.d/*.conf
/usr/lib/sysctl.d/*.conf
/lib/sysctl.d/*.conf
/etc/sysctl.conf

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

---
 init.d/sysctl.Linux.in | 22 ++
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/init.d/sysctl.Linux.in b/init.d/sysctl.Linux.in
index cda86b5..a1a8897 100644
--- a/init.d/sysctl.Linux.in
+++ b/init.d/sysctl.Linux.in
@@ -10,25 +10,7 @@ depend()
 
 start()
 {
-   local conf= retval=0 err errs
-
ebegin Configuring kernel parameters
-   eindent
-
-   for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
-   if [ -r $conf ]; then
-   vebegin applying $conf
-   if ! err=$(sysctl -p $conf 21 /dev/null) ; then
-   errs=${errs} ${err}
-   sysctl -e -p ${conf} /dev/null
-   fi
-   veend $? || retval=1
-   fi
-   done
-
-   eoutdent
-   if [ ${retval} -eq 0 ]  [ -n ${errs} ] ; then
-   ewarn Unknown keys:${errs}
-   fi
-   eend $retval Some errors were encountered: ${errs}
+   sysctl --system
+   eend $? Unable to configure some kernel parameters
 }



[gentoo-commits] proj/openrc:master commit in: etc/

2014-08-22 Thread William Hubbs
commit: 24d82d9ff1ca1ba7085814f8f6530124c117aa5f
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Aug 11 17:57:23 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Aug 11 17:57:23 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=24d82d9f

rc.conf: document rc_verbose

---
 etc/rc.conf.in | 4 
 1 file changed, 4 insertions(+)

diff --git a/etc/rc.conf.in b/etc/rc.conf.in
index 546c36e..69a5cf2 100644
--- a/etc/rc.conf.in
+++ b/etc/rc.conf.in
@@ -51,6 +51,10 @@
 # The default value is: /var/log/rc.log
 #rc_log_path=/var/log/rc.log
 
+# If you want verbose output for OpenRC, set this to yes. If you want
+# verbose output for service foo only, set it to yes in /etc/conf.d/foo.
+#rc_verbose=no
+
 # By default we filter the environment for our running scripts. To allow other
 # variables through, add them here. Use a * to allow all variables through.
 #rc_env_allow=VAR1 VAR2



[gentoo-commits] proj/openrc:master commit in: /

2014-08-22 Thread William Hubbs
commit: 2c265e13c60be0ed583a871ca12a22e4d379a7c0
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Aug 11 18:17:33 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Aug 11 18:17:33 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2c265e13

README: expand information about rc and runscript deprecation

---
 README | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/README b/README
index 917704b..69e3b54 100644
--- a/README
+++ b/README
@@ -67,7 +67,12 @@ conflicts with other software. The /sbin/rc binary was 
renamed to
 
 Backward compatible symbolic links are currently in place so your
 system will keep working if you are using the old names; however, it is
-strongly advised that you migrate to the new names.
+strongly advised that you migrate to the new names because the symbolic
+links will be removed in the future.
+
+Warnings have been added to assist with this migration; however, they
+only show in verbose mode in this release due to the level of noise they
+produce.
 
 Reporting Bugs
 --



[gentoo-commits] proj/openrc:master commit in: sh/

2014-08-22 Thread William Hubbs
commit: 6f080e9c1a2a9b9c308cdc03f9cf782c4ce4d440
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Wed Aug 13 06:50:34 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Aug 13 15:02:20 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6f080e9c

tmpfiles: Move relabelling before any other calls for device nodes

Device nodes are normally never device_t so this type does not
have many permissions. After the mknod, the device should have
its label corrected before any other operations (like chmod).

---
 sh/tmpfiles.sh.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 63c5d14..8538545 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -65,8 +65,8 @@ _b() {
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
if [ ! -e $path ]; then
dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:}
-   dryrun_or_real chown $uid:$gid $path
_restorecon $path
+   dryrun_or_real chown $uid:$gid $path
fi
 }
 
@@ -75,8 +75,8 @@ _c() {
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
if [ ! -e $path ]; then
dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:}
-   dryrun_or_real chown $uid:$gid $path
_restorecon $path
+   dryrun_or_real chown $uid:$gid $path
fi
 }
 



[gentoo-commits] proj/openrc:master commit in: init.d/, conf.d/

2014-08-22 Thread William Hubbs
commit: 6a337ff6c531d9d7310253b67b3e95d1ce5d214c
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Aug  8 19:49:00 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Aug  8 19:49:00 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6a337ff6

devfs: several small clarifications

- Rename the static_dev switch in conf.d/devfs to skip_mount_dev since
  this is a better description of what the switch does.

- Clarify the error messages in the devfs service script based on the
  new name of the switch.

---
 conf.d/devfs| 10 --
 init.d/devfs.in | 14 --
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/conf.d/devfs b/conf.d/devfs
index 92a8a99..51f8037 100644
--- a/conf.d/devfs
+++ b/conf.d/devfs
@@ -1,2 +1,8 @@
-# Set this to yes if your /dev is not a devtmpfs or tmpfs.
-# static_dev=NO
+# OpenRC will attempt each of the following in succession to mount /dev.
+#
+# 1. If there is an entry for /dev in fstab, it will be used.
+# 2. If devtmpfs is defined in the kernel, it will be used.
+# 3. If tmpfs is defined in the kernel, it will be used.
+#
+# Set this to yes if you do not want OpenRC to attempt to mount /dev.
+# skip_mount_dev=NO

diff --git a/init.d/devfs.in b/init.d/devfs.in
index ca24231..bcdbdcd 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -16,8 +16,8 @@ mount_dev()
local action=--mount devfstype msg=Mounting
# Some devices require exec, Bug #92921
local mountopts=exec,nosuid,mode=0755
-   if yesno ${static_dev:-no}; then
-   einfo Using static /dev
+   if yesno ${skip_mount_dev:-no} ; then
+   einfo /dev will not be mounted due to user request
return 0
fi
if mountinfo -q /dev; then
@@ -43,11 +43,13 @@ mount_dev()
mount -n -t $devfstype -o $mountopts dev /dev
eend $?
else
-   ewarn This kernel does not have devtmpfs or tmpfs support.
-   ewarn Assuming you want static /dev. If this is not the case,
-   ewarn please set the CONFIG_DEVTMPFS or CONFIG_TMPFS option
-   ewarn in your kernel.
+   ewarn This kernel does not have devtmpfs or tmpfs support, and 
there
+   ewarn is no entry for /dev in fstab.
+   ewarn This means /dev will not be mounted.
+   ewarn To avoid this message, set CONFIG_DEVTMPFS or 
CONFIG_TMPFS to y
+   ewarn in your kernel configuration or see 
@SYSCONFDIR@/conf.d/devfs
fi
+   return 0
 }
 
 seed_dev()



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-08-22 Thread William Hubbs
commit: e3bfb68aece9378a0669c2893285808100fd5ea6
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Wed Jul 23 21:19:25 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Jul 24 22:40:14 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e3bfb68a

hwclock: always set the kernel's timezone

The hwclock service should set the time zone regardless of the setting
of the clock_hctosys variable. This needs to be done to prevent issues
when the system time is being synchronized using ntp.

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

---
 init.d/hwclock.in | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/init.d/hwclock.in b/init.d/hwclock.in
index 823a5ab..4b0da02 100644
--- a/init.d/hwclock.in
+++ b/init.d/hwclock.in
@@ -83,22 +83,17 @@ start()
fi
fi
 
+   # Always set the kernel's time zone.
+   _hwclock --systz $utc_cmd $clock_args
+   : $(( retval += $? ))
+
if [ -e /etc/adjtime ]  yesno $clock_adjfile; then
_hwclock --adjust $utc_cmd
: $(( retval += $? ))
fi
 
-   # If setting UTC, don't bother to run hwclock when first booting
-   # as that's the default
-   if [ $PREVLEVEL != N -o \
-   $utc_cmd != --utc -o \
-   -n $clock_args ];
-   then
-   if yesno ${clock_hctosys:-YES}; then
-   _hwclock --hctosys $utc_cmd $clock_args
-   else
-   _hwclock --systz $utc_cmd $clock_args
-   fi
+   if yesno ${clock_hctosys:-YES}; then
+   _hwclock --hctosys $utc_cmd $clock_args
: $(( retval += $? ))
fi
 



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/

2014-08-22 Thread William Hubbs
commit: 785b61e8725f26b7d7c66b00e6e87597dd7bd735
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Aug 22 17:41:55 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Aug 22 19:19:03 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=785b61e8

cgroups: fix cgroup subsystem mounting

Originally, we aborted all of the cgroup setup if /sys/fs/cgroup/openrc
was already mounted. This  caused an issue in lxc containers, so we
should always allow the subsystems to be mounted.

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

---
 init.d/sysfs.in | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 2156670..67485c2 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -100,14 +100,15 @@ mount_misc()
 mount_cgroups()
 {
mountinfo -q /sys/fs/cgroup || return 0
-   mountinfo -q /sys/fs/cgroup/openrc || return 0
-
-   local agent=@LIBEXECDIR@/sh/cgroup-release-agent.sh
-   mkdir /sys/fs/cgroup/openrc
-   mount -n -t cgroup \
-   -o none,${sysfs_opts},name=openrc,release_agent=$agent \
-   openrc /sys/fs/cgroup/openrc
-   echo 1  /sys/fs/cgroup/openrc/notify_on_release
+
+   if ! mountinfo -q /sys/fs/cgroup/openrc; then
+   local agent=@LIBEXECDIR@/sh/cgroup-release-agent.sh
+   mkdir /sys/fs/cgroup/openrc
+   mount -n -t cgroup \
+   -o 
none,${sysfs_opts},name=openrc,release_agent=$agent \
+   openrc /sys/fs/cgroup/openrc
+   echo 1  /sys/fs/cgroup/openrc/notify_on_release
+   fi
 
yesno ${rc_controller_cgroups:-YES}  [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: /

2014-08-22 Thread William Hubbs
commit: 54ed42503fbae45eb1fa6cf8c09ca1e34c8002cd
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Fri Aug 22 19:18:33 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Aug 22 19:18:33 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=54ed4250

start work on 0.13.1

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 322fd2a..c6dc0c1 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,3 +1,3 @@
 NAME=  openrc
-VERSION=   0.13
+VERSION=   0.13.1
 PKG=   ${NAME}-${VERSION}



[gentoo-commits] proj/openrc: New tag: openrc-0.13.1

2014-08-22 Thread William Hubbs
commit: 
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Aug 22 19:26:07 2014 +

New tag: openrc-0.13.1




[gentoo-commits] proj/openrc:master commit in: sh/

2014-08-28 Thread William Hubbs
commit: d4204a97a2410fcf37a64385204e6452c6958e8d
Author: Andrew Gregory andrew.gregory.8 AT gmail DOT com
AuthorDate: Mon Aug 25 19:46:28 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Aug 27 22:49:00 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d4204a97

tmpfiles.sh: add support for C action

Recursively copies files or directories.  Added by systemd in 849958d1.

---
 sh/tmpfiles.sh.in | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 41f86cf..6e7be42 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -80,6 +80,17 @@ _c() {
fi
 }
 
+_C() {
+   # recursively copy a file or directory
+   local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
+   if [ ! -e $path ]; then
+   dryrun_or_real cp -r $arg $path
+   _restorecon $path
+   [ $uid != '-' ]  dryrun_or_real chown $uid $path
+   [ $gid != '-' ]  dryrun_or_real chgrp $gid $path
+   [ $mode != '-' ]  dryrun_or_real chmod $mode $path
+   fi
+}
 
 _f() {
# Create a file if it doesn't exist yet
@@ -325,7 +336,7 @@ for FILE in $tmpfiles_d ; do
 
# whine about invalid entries
case $cmd in
-   f|F|w|d|D|p|L|c|b|x|X|r|R|z|Z) ;;
+   f|F|w|d|D|p|L|c|C|b|x|X|r|R|z|Z) ;;
*) warninvalid ; continue ;;
esac
 
@@ -334,7 +345,7 @@ for FILE in $tmpfiles_d ; do
case $cmd in
p|f|F) mode=0644 ;;
d|D) mode=0755 ;;
-   z|Z|x|r|R|L) ;;
+   C|z|Z|x|r|R|L) ;;
esac
fi
 



[gentoo-commits] proj/openrc:master commit in: sh/

2014-08-28 Thread William Hubbs
commit: 6f3f50d4530f583d0d2aedec8af20077a9d07f4f
Author: Andrew Gregory andrew.gregory.8 AT gmail DOT com
AuthorDate: Mon Aug 25 19:37:45 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Wed Aug 27 22:48:34 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6f3f50d4

tmpfiles.sh: add support for + modifier

systemd added support for b+, c+, p+, and L+ in 2e78fa79 and 1554afae to
remove the target path if it already exists.

---
 sh/tmpfiles.sh.in | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 42a3639..41f86cf 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -304,6 +304,7 @@ for FILE in $tmpfiles_d ; do
# But IS allowed when globs are expanded for the x/r/R/z/Z types.
while read cmd path mode uid gid age arg; do
LINENUM=$(( LINENUM+1 ))
+   FORCE=0
 
# Unless we have both command and path, skip this line.
if [ -z $cmd -o -z $path ]; then
@@ -311,13 +312,20 @@ for FILE in $tmpfiles_d ; do
fi
 
case $cmd in
-   *!) [ $BOOT -eq 1 ] || continue; cmd=${cmd%!} ;;
+   \#*) continue ;;
esac
 
+   while [ ${#cmd} -gt 1 ]; do
+   case $cmd in
+   *!) cmd=${cmd%!}; [ $BOOT -eq 1 ] || 
continue 2 ;;
+   *+) cmd=${cmd%+}; FORCE=1; ;;
+   *) warninvalid ; continue 2 ;;
+   esac
+   done
+
# whine about invalid entries
case $cmd in
f|F|w|d|D|p|L|c|b|x|X|r|R|z|Z) ;;
-   \#*) continue ;;
*) warninvalid ; continue ;;
esac
 
@@ -338,6 +346,13 @@ for FILE in $tmpfiles_d ; do
 
[ -n $EXCLUDE ]  checkprefix $path $EXCLUDE  continue
[ -n $PREFIX ]  ! checkprefix $path $PREFIX  continue
+
+   if [ $FORCE -gt 0 ]; then
+   case $cmd in
+   p|L|c|b) [ -f $path ]  dryrun_or_real rm -f 
$path
+   esac
+   fi
+
[ $VERBOSE -eq 1 ]  echo _$cmd $@
_$cmd $@
rc=$?



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-08-29 Thread William Hubbs
commit: d032b17897278659ae103d1bcf2aea7739cdbfbb
Author: Joe M joe9mail AT gmail DOT com
AuthorDate: Fri Aug 29 14:10:58 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Fri Aug 29 14:10:58 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d032b178

savecache: check permissions on the correct directory

---
 init.d/savecache.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/savecache.in b/init.d/savecache.in
index 9040732..dde02dd 100644
--- a/init.d/savecache.in
+++ b/init.d/savecache.in
@@ -13,8 +13,8 @@ start()
return 1
fi
fi
-   if ! checkpath -W $RC_LIBEXECDIR; then
-   ewarn WARNING: ${RC_LIBEXECDIR} is not writable!
+   if ! checkpath -W $RC_LIBEXECDIR/cache; then
+   ewarn WARNING: ${RC_LIBEXECDIR}/cache is not writable!
if ! yesno ${RC_GOINGDOWN}; then
ewarn Unable to save deptree cache
return 1



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-11-20 Thread William Hubbs
commit: 8d0ca13fbd38e782bae655eca6646dabc8d63899
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov 20 16:55:53 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov 20 16:55:53 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8d0ca13f

devfs: optionally add missing symbolic links

If symbolic links for /dev/{fd,stdin,stdout,stderr,core} do not exist
once /dev is mounted, we should create them.

---
 init.d/devfs.in | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/init.d/devfs.in b/init.d/devfs.in
index bcdbdcd..5af68f9 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -69,7 +69,14 @@ seed_dev()
# so udev can add its start-message to dmesg
[ -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 \
mqueue /dev/mqueue 1777 ,nodev mqueue \
devpts /dev/pts 0755 ,gid=5,mode=0620 devpts \



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/

2014-11-20 Thread William Hubbs
commit: 6b85d4288c9409f8870396b8026862463e732bf8
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov 20 16:55:53 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov 20 17:07:14 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6b85d428

devfs: optionally add missing symbolic links

If symbolic links for /dev/{fd,stdin,stdout,stderr,core} do not exist
once /dev is mounted, we should create them.

---
 init.d/devfs.in | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/init.d/devfs.in b/init.d/devfs.in
index bcdbdcd..5af68f9 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -69,7 +69,14 @@ seed_dev()
# so udev can add its start-message to dmesg
[ -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 \
mqueue /dev/mqueue 1777 ,nodev mqueue \
devpts /dev/pts 0755 ,gid=5,mode=0620 devpts \



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: /

2014-11-20 Thread William Hubbs
commit: dec899b946281c7c12829f3300d533f40e468c20
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov 20 17:06:03 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov 20 17:06:03 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=dec899b9

Start work on 0.13.5

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 09a792f..44b9254 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,3 +1,3 @@
 NAME=  openrc
-VERSION=   0.13.4
+VERSION=   0.13.5
 PKG=   ${NAME}-${VERSION}



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-11-20 Thread William Hubbs
commit: 3fad31a994f7eb14f3f001f3980eb2b0ae8fe4f1
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov 20 17:25:48 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov 20 17:25:48 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=3fad31a9

init.d: add osclock to ignore patterns

---
 init.d/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init.d/.gitignore b/init.d/.gitignore
index 3a5d003..04f725d 100644
--- a/init.d/.gitignore
+++ b/init.d/.gitignore
@@ -23,6 +23,7 @@ modules
 mount-ro
 mtab
 numlock
+osclock
 procfs
 staticroute
 sysfs



[gentoo-commits] proj/openrc: New tag: openrc-0.13.5

2014-11-20 Thread William Hubbs
commit: 
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov 20 18:03:38 2014 +

New tag: openrc-0.13.5




[gentoo-commits] proj/openrc:master commit in: man/

2014-11-22 Thread William Hubbs
commit: dff6e4a004afeaa64f4ccb07c7d31bb821b043b4
Author: S. Gilles sgilles AT umd DOT edu
AuthorDate: Sat Nov 22 17:41:10 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Nov 22 17:49:46 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=dff6e4a0

Fix mdoc warning for empty line in rc-update man page.

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

---
 man/rc-update.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/rc-update.8 b/man/rc-update.8
index dca4b90..113a533 100644
--- a/man/rc-update.8
+++ b/man/rc-update.8
@@ -87,7 +87,7 @@ If the
 .Fl s , -stack
 option is given then we either add or remove the runlevel from the runlevel.
 This allows inheritance of runlevels.
-
+.Pp
 If the
 .Fl a, -all
 option is given, we remove the service from all runlevels. This is



[gentoo-commits] proj/openrc:master commit in: init.d/

2014-11-23 Thread William Hubbs
commit: 30cc3cdb76a66c7c0f89a52db4e5cff77b570e31
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Nov 23 16:28:21 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov 24 03:39:20 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=30cc3cdb

Make sysfs behave like netmount and localmount

sysfs now mounts all related sysfs file systems and returns success,
like netmount and localmount.

Also, we now check to make sure the cgroups are not mounted before we
mount them.

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

---
 init.d/sysfs.in | 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 67485c2..bc0d9d3 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -113,7 +113,8 @@ mount_cgroups()
yesno ${rc_controller_cgroups:-YES}  [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do
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} \
${name} /sys/fs/cgroup/${name}
;;
@@ -129,25 +130,13 @@ restorecon_sys()
restorecon -rF /sys/fs/cgroup /dev/null 21
eend $?
fi
-
-   return 0
 }
 
 start()
 {
-   local retval
mount_sys
-   retval=$?
-   if [ $retval -eq 0 ]; then
-   mount_misc
-   retval=$?
-   fi
-   if [ $retval -eq 0 ]; then
-   mount_cgroups
-   retval=$?
-   fi
-
+   mount_misc
+   mount_cgroups
restorecon_sys
-
-   return $retval
+   return 0
 }



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: /

2014-11-23 Thread William Hubbs
commit: 534031fc7ac3795cc42ea6f54b7ee1c304ee53de
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Nov 24 03:57:44 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov 24 03:57:44 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=534031fc

Start work on 0.13.6

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 44b9254..1c6b43c 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,3 +1,3 @@
 NAME=  openrc
-VERSION=   0.13.5
+VERSION=   0.13.6
 PKG=   ${NAME}-${VERSION}



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/

2014-11-23 Thread William Hubbs
commit: 2eb0ea9afbba584fc4c5ee0feefa9ae6a3d3278d
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sun Nov 23 16:28:21 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov 24 03:59:01 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2eb0ea9a

Make sysfs behave like netmount and localmount

sysfs now mounts all related sysfs file systems and returns success,
like netmount and localmount.

Also, we now check to make sure the cgroups are not mounted before we
mount them.

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

---
 init.d/sysfs.in | 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/init.d/sysfs.in b/init.d/sysfs.in
index 67485c2..bc0d9d3 100644
--- a/init.d/sysfs.in
+++ b/init.d/sysfs.in
@@ -113,7 +113,8 @@ mount_cgroups()
yesno ${rc_controller_cgroups:-YES}  [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do
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} \
${name} /sys/fs/cgroup/${name}
;;
@@ -129,25 +130,13 @@ restorecon_sys()
restorecon -rF /sys/fs/cgroup /dev/null 21
eend $?
fi
-
-   return 0
 }
 
 start()
 {
-   local retval
mount_sys
-   retval=$?
-   if [ $retval -eq 0 ]; then
-   mount_misc
-   retval=$?
-   fi
-   if [ $retval -eq 0 ]; then
-   mount_cgroups
-   retval=$?
-   fi
-
+   mount_misc
+   mount_cgroups
restorecon_sys
-
-   return $retval
+   return 0
 }



[gentoo-commits] proj/openrc: New tag: openrc-0.13.6

2014-11-23 Thread William Hubbs
commit: 
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov 24 04:03:57 2014 +

New tag: openrc-0.13.6




[gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/, conf.d/

2014-11-25 Thread William Hubbs
commit: ebb3f35bd06591bf7092cfc61e5cd51857ed888f
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Nov  3 20:31:08 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Tue Nov 25 20:43:15 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=ebb3f35b

split the udev service

The udev service now has been split into three services: udev starts the
daemon, udev-trigger populates /dev and udev-settle waits for all udev
events to time out.

udev and udev-trigger will be needed in the sysinit runlevel; however,
udev-settle will not on most systems.

---
 conf.d/udev   | 38 --
 conf.d/udev-settle|  5 +++
 conf.d/{udev = udev-trigger} | 17 +---
 init.d/udev   | 92 ---
 init.d/udev-settle| 17 
 init.d/udev-trigger   | 91 ++
 6 files changed, 114 insertions(+), 146 deletions(-)

diff --git a/conf.d/udev b/conf.d/udev
index 41f6b9b..a714032 100644
--- a/conf.d/udev
+++ b/conf.d/udev
@@ -1,31 +1,5 @@
 # /etc/conf.d/udev: config file for udev
 
-# udev can trigger coldplug events which cause services to start and
-# kernel modules to be loaded.
-# Services are deferred to start in the boot runlevel.
-# Set rc_coldplug=NO if you don't want this.
-# If you want module coldplugging but not coldplugging of services then you
-# can disable service coldplugging in baselayout/openrc config files.
-# The setting is named different in different versions.
-# in /etc/rc.conf: rc_hotplug=!* or
-# in /etc/conf.d/rc: rc_plug_services=!*
-#rc_coldplug=YES
-
-# We can create a /dev/root symbolic link to point to the root device in
-# some situations. This is on by default because some software relies on
-# it,. However, this software should be fixed to not do this.
-# For more information, see
-# https://bugs.gentoo.org/show_bug.cgi?id=438380.
-# If you are not using any affected software, you do not need this, so
-# feel free to turn it off.
-#rc_dev_root_symlink=YES
-
-# Expert options:
-
-# Timeout in seconds to wait for processing of uevents at boot.
-# There should be no need to change this.
-#udev_settle_timeout=60
-
 # Add extra command line options to udevd, use with care
 # udevd --help for possible values
 #udev_opts=
@@ -33,15 +7,3 @@
 # Run udevd --debug and write output to /run/udevdebug.log
 # Should not be kept on as it fills diskspace slowly
 #udev_debug=YES
-
-# Run udevadmin monitor to get a log of all events
-# in /run/udevmonitor.log
-#udev_monitor=YES
-
-# Keep udevmonitor running after populating /dev.
-#udev_monitor_keep_running=no
-
-# Set cmdline options for udevmonitor.
-# could be some of --env --kernel --udev
-#udev_monitor_opts=--env
-

diff --git a/conf.d/udev-settle b/conf.d/udev-settle
new file mode 100644
index 000..b83580a
--- /dev/null
+++ b/conf.d/udev-settle
@@ -0,0 +1,5 @@
+# /etc/conf.d/udev-settle: config file for udev-settle
+
+# Timeout in seconds to wait for processing of uevents at boot.
+# There should be no need to change this.
+#udev_settle_timeout=60

diff --git a/conf.d/udev b/conf.d/udev-trigger
similarity index 73%
copy from conf.d/udev
copy to conf.d/udev-trigger
index 41f6b9b..5850b8b 100644
--- a/conf.d/udev
+++ b/conf.d/udev-trigger
@@ -1,4 +1,4 @@
-# /etc/conf.d/udev: config file for udev
+# /etc/conf.d/udev-trigger: config file for udev-trigger
 
 # udev can trigger coldplug events which cause services to start and
 # kernel modules to be loaded.
@@ -20,20 +20,6 @@
 # feel free to turn it off.
 #rc_dev_root_symlink=YES
 
-# Expert options:
-
-# Timeout in seconds to wait for processing of uevents at boot.
-# There should be no need to change this.
-#udev_settle_timeout=60
-
-# Add extra command line options to udevd, use with care
-# udevd --help for possible values
-#udev_opts=
-
-# Run udevd --debug and write output to /run/udevdebug.log
-# Should not be kept on as it fills diskspace slowly
-#udev_debug=YES
-
 # Run udevadmin monitor to get a log of all events
 # in /run/udevmonitor.log
 #udev_monitor=YES
@@ -44,4 +30,3 @@
 # Set cmdline options for udevmonitor.
 # could be some of --env --kernel --udev
 #udev_monitor_opts=--env
-

diff --git a/init.d/udev b/init.d/udev
index 654eee3..57fae76 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -7,12 +7,8 @@ description=udev manages device permissions and symbolic 
links in /dev
 extra_started_commands=reload
 description_reload=Reload the udev rules and databases
 
-udevmonitor_log=/run/udevmonitor.log
-udevmonitor_pid=/run/udevmonitor.pid
-
 depend()
 {
-   provide dev
need sysfs dev-mount
before checkfs fsck
 
@@ -73,94 +69,6 @@ start_pre()
return 0
 }
 
-start_udevmonitor()
-{
-   yesno ${udev_monitor:-no} || return 0
-
-   einfo udev: Running udevadm monitor ${udev_monitor_opts} to log all 
events
-   start-stop-daemon

[gentoo-commits] proj/openrc:master commit in: src/librc/

2014-11-01 Thread William Hubbs
commit: be952bebb3647069fb93b9791ee3439698f697ca
Author: Alexander Vershilov alexander.vershilov AT gmail DOT com
AuthorDate: Wed Oct 29 20:16:35 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Nov  1 21:44:30 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=be952beb

Fix incorrect handling of chroot option.
Fixes #28.

X-Gentoo-Bug: #527370
X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=527370

---
 src/librc/librc-daemon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 190a014..02aff5a 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -556,8 +556,8 @@ rc_service_daemons_crashed(const char *service)
 
char *ch_root = rc_service_value_get(basename_c(service), 
chroot);
char *spidfile = pidfile;
-   if (ch_root) {
-   spidfile = malloc(strlen(ch_root) + strlen(pidfile));
+   if (ch_root  pidfile) {
+   spidfile = xmalloc(strlen(ch_root) + strlen(pidfile) + 
1);
strcpy(spidfile, ch_root);
strcat(spidfile, pidfile);
}



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: /

2014-11-01 Thread William Hubbs
commit: d92eca3988a1756e12c22c99a5e17f525ebffc6c
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Sat Nov  1 23:31:20 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Nov  1 23:31:20 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d92eca39

Start work on 0.13.3

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index a94811d..c82a4de 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,3 +1,3 @@
 NAME=  openrc
-VERSION=   0.13.2
+VERSION=   0.13.3
 PKG=   ${NAME}-${VERSION}



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: src/librc/

2014-11-01 Thread William Hubbs
commit: cb2c45a3c092de617fa037089599e624a758aea9
Author: Alexander Vershilov alexander.vershilov AT gmail DOT com
AuthorDate: Wed Oct 29 20:16:35 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Sat Nov  1 23:32:26 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=cb2c45a3

Fix incorrect handling of chroot option.
Fixes #28.

X-Gentoo-Bug: #527370
X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=527370

---
 src/librc/librc-daemon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 190a014..02aff5a 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -556,8 +556,8 @@ rc_service_daemons_crashed(const char *service)
 
char *ch_root = rc_service_value_get(basename_c(service), 
chroot);
char *spidfile = pidfile;
-   if (ch_root) {
-   spidfile = malloc(strlen(ch_root) + strlen(pidfile));
+   if (ch_root  pidfile) {
+   spidfile = xmalloc(strlen(ch_root) + strlen(pidfile) + 
1);
strcpy(spidfile, ch_root);
strcat(spidfile, pidfile);
}



[gentoo-commits] proj/openrc:master commit in: src/rc/, mk/

2014-11-03 Thread William Hubbs
commit: 1932360adca3f9fe9b47bcfad7b8bd5efbd33bee
Author: Jason Zaman jason AT perfinion DOT com
AuthorDate: Thu Oct 30 02:22:02 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov  3 15:31:25 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=1932360a

Integrate the functionality from runscript_selinux.so

runscript used to dlopen() runscript_selinux.so. This adds equivalent
functionality directly in to runscript instead. It authenticates with
either PAM or shadow and optionally has a dep on audit.

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

---
 mk/os-Linux.mk  |  15 ++-
 mk/pam.mk   |   6 ++
 src/rc/rc-selinux.c | 292 ++--
 src/rc/rc-selinux.h |   2 +-
 src/rc/runscript.c  |   2 +-
 5 files changed, 285 insertions(+), 32 deletions(-)

diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk
index dc76b96..bb6fa37 100644
--- a/mk/os-Linux.mk
+++ b/mk/os-Linux.mk
@@ -9,6 +9,19 @@ LIBDL= -Wl,-Bdynamic -ldl
 
 ifeq (${MKSELINUX},yes)
 CPPFLAGS+= -DHAVE_SELINUX
-LIBSELINUX= -lselinux
+LIBSELINUX?= -lselinux
 LDADD += $(LIBSELINUX)
+
+ifneq (${MKPAM},pam)
+# if using selinux but not pam then we need crypt
+LIBCRYPT?= -lcrypt
+LDADD += $(LIBCRYPT)
+endif
+
+endif
+
+ifeq (${MKAUDIT},yes)
+LIBAUDIT?= -laudit
+CPPFLAGS+= -DHAVE_AUDIT
+LDADD+=${LIBAUDIT}
 endif

diff --git a/mk/pam.mk b/mk/pam.mk
index 15ffb54..199896c 100644
--- a/mk/pam.mk
+++ b/mk/pam.mk
@@ -3,6 +3,12 @@ LIBPAM?=   -lpam
 CPPFLAGS+= -DHAVE_PAM
 LDADD+=${LIBPAM}
 
+ifeq (${MKSELINUX},yes)
+# with selinux, pam_misc is needed too
+LIBPAM_MISC?=  -lpam_misc
+LDADD+=${LIBPAM_MISC}
+endif
+
 PAMDIR?=   /etc/pam.d
 PAMMODE?=  0644
 else ifneq (${MKPAM},)

diff --git a/src/rc/rc-selinux.c b/src/rc/rc-selinux.c
index 518b25d..7124e83 100644
--- a/src/rc/rc-selinux.c
+++ b/src/rc/rc-selinux.c
@@ -1,7 +1,7 @@
 /*
-  rc-selinux.c
-  SELinux helpers to get and set contexts.
-*/
+ * rc-selinux.c
+ * SELinux helpers to get and set contexts.
+ */
 
 /*
  * Copyright (c) 2014 Jason Zaman ja...@perfinion.com
@@ -31,11 +31,18 @@
 #include stddef.h
 #include errno.h
 #include dlfcn.h
-
-#include sys/stat.h
+#include ctype.h
+#include limits.h
+#include pwd.h
+#include unistd.h
 
 #include selinux/selinux.h
 #include selinux/label.h
+#include selinux/get_default_type.h
+#include selinux/context.h
+
+#include sys/stat.h
+#include sys/types.h
 
 #include einfo.h
 #include queue.h
@@ -44,11 +51,28 @@
 #include rc-plugin.h
 #include rc-selinux.h
 
-#define SELINUX_LIB RC_LIBDIR /runscript_selinux.so
+/* the context files for selinux */
+#define RUN_INIT_FILE run_init_type
+#define INITRC_FILE initrc_context
 
-static void (*selinux_run_init_old) (void);
-static void (*selinux_run_init_new) (int argc, char **argv);
+#ifdef HAVE_AUDIT
+#include libaudit.h
+#endif
 
+/* PAM or shadow for authentication */
+#ifdef HAVE_PAM
+#define PAM_SERVICE_NAME run_init /* the name of this program for PAM */
+#include security/pam_appl.h
+#include security/pam_misc.h
+#else
+#define PASSWORD_PROMPT Password:
+#include crypt.h
+#include shadow.h
+#include string.h
+#endif
+
+
+/* The handle for the fcontext lookups */
 static struct selabel_handle *hnd = NULL;
 
 int selinux_util_label(const char *path)
@@ -133,33 +157,243 @@ int selinux_util_close(void)
return 0;
 }
 
-void selinux_setup(int argc, char **argv)
+/*
+ * This will check the users password and return 0 on success or -1 on fail
+ *
+ * We ask for the password to make sure it is intended vs run by malicious 
software.
+ * Actual authorization is covered by the policy itself.
+ */
+static int check_password(char *username)
 {
-   void *lib_handle = NULL;
+   int ret = 1;
+#ifdef HAVE_PAM
+   pam_handle_t *pamh;
+   int pam_err = 0;
+   const struct pam_conv pconv = {
+   misc_conv,
+   NULL
+   };
 
-   if (!exists(SELINUX_LIB))
-   return;
+   pam_err = pam_start(PAM_SERVICE_NAME, username, pconv, pamh);
+   if (pam_err != PAM_SUCCESS) {
+   ret = -1;
+   goto outpam;
+   }
 
-   lib_handle = dlopen(SELINUX_LIB, RTLD_NOW | RTLD_GLOBAL);
-   if (!lib_handle) {
-   eerror(dlopen: %s, dlerror());
-   return;
+   pam_err = pam_authenticate(pamh, PAM_DISALLOW_NULL_AUTHTOK);
+   if (pam_err != PAM_SUCCESS) {
+   ret = -1;
+   goto outpam;
+   }
+
+   ret = 0;
+outpam:
+   pam_end(pamh, pam_err);
+   pamh = NULL;
+
+#else /* authenticating via /etc/shadow instead */
+   struct spwd *spw;
+   char *password;
+   char *attempt;
+
+   spw = getspnam(username);
+   if (!spw) {
+   eerror(Failed to read shadow entry);
+   ret = -1

[gentoo-commits] proj/udev-gentoo-scripts:master commit in: /

2014-11-03 Thread William Hubbs
commit: 3a1fea130b7238c073fa7fc0d94f25896f0be2d8
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Nov  3 18:52:47 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov  3 20:33:11 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=3a1fea13

start work on version 28

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 49d1924..9f88d4d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 PACKAGE = udev-init-scripts
-VERSION = 27
+VERSION = 28
 DISTNAME = $(PACKAGE)-$(VERSION)
 
 SYSCONFDIR ?= /etc



[gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/

2014-11-03 Thread William Hubbs
commit: 7da8580803a5d44247d117c98e5df52761ae0c0d
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Mon Nov  3 18:49:49 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov  3 20:37:00 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=7da85808

move default for udev_monitor to the yesno calls

---
 init.d/udev | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/init.d/udev b/init.d/udev
index 72b2be2..654eee3 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -7,7 +7,6 @@ description=udev manages device permissions and symbolic links 
in /dev
 extra_started_commands=reload
 description_reload=Reload the udev rules and databases
 
-udev_monitor=${udev_monitor:-no}
 udevmonitor_log=/run/udevmonitor.log
 udevmonitor_pid=/run/udevmonitor.pid
 
@@ -76,7 +75,7 @@ start_pre()
 
 start_udevmonitor()
 {
-   yesno ${udev_monitor} || return 0
+   yesno ${udev_monitor:-no} || return 0
 
einfo udev: Running udevadm monitor ${udev_monitor_opts} to log all 
events
start-stop-daemon --start --stdout ${udevmonitor_log} \
@@ -131,7 +130,7 @@ populate_dev()
 
 stop_udevmonitor()
 {
-   yesno ${udev_monitor} || return 0
+   yesno ${udev_monitor:-no} || return 0
 
if yesno ${udev_monitor_keep_running:-no}; then
ewarn udev: udevmonitor is still running and writing into 
${udevmonitor_log}



[gentoo-commits] proj/openrc: New tag: openrc-0.13.3

2014-11-03 Thread William Hubbs
commit: 
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Tue Nov 04 00:13:01 2014 +

New tag: openrc-0.13.3




[gentoo-commits] proj/openrc:master commit in: init.d/

2014-11-06 Thread William Hubbs
commit: 93ba67eff9333e434c969bb8131467f777546764
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov  6 20:38:17 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov  6 20:38:17 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=93ba67ef

netmount: unmount nfs file systems

---
 init.d/netmount.in | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/init.d/netmount.in b/init.d/netmount.in
index f6145f0..4ea0c4c 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -47,14 +47,7 @@ stop()
eindent
fs=
for x in $net_fs_list $extra_net_fs_list; do
-   case $x in
-   nfs|nfs4)
-   continue
-   ;;
-   *)
-   fs=$fs${fs:+|}$x
-   ;;
-   esac
+   fs=$fs${fs:+|}$x
done
[ -n $fs ]  fs=^($fs)$
do_unmount umount ${fs:+--fstype-regex} $fs --netdev



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: init.d/

2014-11-07 Thread William Hubbs
commit: c9f6e2a6c8ca4e258f1b577010586668759b361a
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov  6 20:38:17 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov  6 20:44:01 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c9f6e2a6

netmount: unmount nfs file systems

---
 init.d/netmount.in | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/init.d/netmount.in b/init.d/netmount.in
index f6145f0..4ea0c4c 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -47,14 +47,7 @@ stop()
eindent
fs=
for x in $net_fs_list $extra_net_fs_list; do
-   case $x in
-   nfs|nfs4)
-   continue
-   ;;
-   *)
-   fs=$fs${fs:+|}$x
-   ;;
-   esac
+   fs=$fs${fs:+|}$x
done
[ -n $fs ]  fs=^($fs)$
do_unmount umount ${fs:+--fstype-regex} $fs --netdev



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: /

2014-11-07 Thread William Hubbs
commit: e1a4aef3e551371a83a38eb1a275f10b0e9e165e
Author: William Hubbs w.d.hubbs AT gmail DOT com
AuthorDate: Thu Nov  6 20:43:02 2014 +
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Thu Nov  6 20:43:02 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e1a4aef3

start work on 0.13.4

---
 Makefile.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index c82a4de..09a792f 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,3 +1,3 @@
 NAME=  openrc
-VERSION=   0.13.3
+VERSION=   0.13.4
 PKG=   ${NAME}-${VERSION}



[gentoo-commits] proj/openrc: New tag: openrc-0.13.4

2014-11-10 Thread William Hubbs
commit: 
Commit: William Hubbs williamh AT gentoo DOT org
CommitDate: Mon Nov 10 17:43:12 2014 +

New tag: openrc-0.13.4




  1   2   3   4   5   6   7   8   9   10   >