Commit Graph

2161 Commits

Author SHA1 Message Date
Christian Ruppert
7ea5c614d9 Add -W/--writable function to checkpath
Checkpath -W will use access(3p) to determine whether or not a path is
writable. This is more accurate than test(1p) because it also takes into
account whether or not the filesystem is mounted read-only.

Modified by William Hubbs to add the man page update.
2012-01-26 14:42:18 -06:00
Christian Ruppert
5d441dd376 Whitespace 2012-01-26 20:47:46 +01:00
Christian Ruppert
44019f6542 Add is_writable() function to check whether a path is writable or not 2012-01-26 20:46:31 +01:00
William Hubbs
de5cee2c21 cgroups: make sure /sys/fs/cgroup is a mount point
We need to make sure this directory is a mount point before we add the
control groups.

Reported-by: Andrej Filipcic <andrej.filipcic@ijs.si>
X-Gentoo-Bug: 400903
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400903
2012-01-26 11:02:00 -06:00
Mike Frysinger
3ad501218d bootmisc: stop deleting /etc/nologin
Baselayout-1.x used to have a DELAYLOGIN option where it would setup
/etc/nologin automatically and then delete it later on.  OpenRC did
not keep that feature, and during the rewrites, ended up just punting
it all the time.  This isn't what we intended, so drop the rm.

X-Gentoo-Bug: 400837
X-Gentoo-Bug-URL: https://bugs.gentoo.org/400837
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-26 01:12:23 -05:00
Robin H. Johnson
43a155a313 This new release will be 0.9.9 with idl0r's changes
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-25 11:04:22 -08:00
Robin H. Johnson
fb00b10669 net/bonding: Fix which interface IPs get added to.
The previous bonding change of ensuring interfaces were down to add
slave interfaces, but it clobbered the IFACE variable, because it was
being passed to a bash function rather than a command.

X-Gentoo-Bug: 400613
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400613
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-25 10:47:37 -08:00
Christian Ruppert
8b4fc05ff2 Disable parallel startup in interactive mode 2012-01-24 19:41:50 +01:00
Christian Ruppert
ced60319e3 Override rc.conf options only 2012-01-24 19:41:50 +01:00
William Hubbs
cacea4e7f3 Cgroups: activate the openrc control group release agent 2012-01-23 22:00:08 -06:00
William Hubbs
ce4c9b5397 Cgroups: create openrc control group
This creates the "openrc" control group with no subsystems attached. The
next step will be to add everything openrc starts to this group.
2012-01-23 21:46:33 -06:00
Robin H. Johnson
426b94bd69 Per the systemd tmpfiles implementation, we need to watch out for umask during initial creation of files as well as potentially changing permissions later. Also do not abort if the items exist already, per truncate rules in tmpfiles.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-23 10:26:58 +00:00
Robin H. Johnson
06b8084b2c Ensure that when -F is passed, existing files are truncated properly.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-23 05:30:00 +00:00
Robin H. Johnson
e3d0fe06bd Respin features.h usage so that we correctly test for features before we use them. Some BSD libc implementations may have one or the other flag, but not both.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-23 05:26:40 +00:00
Robin H. Johnson
319f5003c6 Revert "Drop include for features.h"
This reverts commit 30a565f80d.
2012-01-23 05:24:54 +00:00
William Hubbs
30a565f80d Drop include for features.h
The following information is taken from the feature_test_macros man
page:

<features.h> is a Linux/glibc-specific header file.  Other systems have
an analogous file, but typically with a different name.  This header
file is automatically included by other header files as required: it is
not necessary to explicitly include it in order to employ feature test
macros.

Reported-by: Tibor Vago <tibor.vago@gmail.com>
X-Gentoo-Bug: 399635
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=399635
2012-01-22 14:41:47 -06:00
William Hubbs
6e2fbf6a0f Make checks for writable directory posix compliant
Reported-by: Maxim Kammerer <mk@de.su>
X-Gentoo-Bug: 398931
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=398931
2012-01-22 11:56:24 -06:00
Christian Ruppert
2990e5a2e3 Whitespace 2012-01-22 01:17:42 +01:00
William Hubbs
85c90f9a1d small style fix 2012-01-20 21:38:13 -06:00
William Hubbs
c529a57650 drop the extra --pidfile option 2012-01-17 12:04:20 -06:00
Christian Ruppert
9c0edc5c52 Use the "--make-pidfile" when command_background is used
The start-stop-daemon "--make-pidfile" option is now used by default when using
command_background, this requires a pidfile to be specified.
Document command_background option.

Reported-by: Giampaolo Tomassoni <giampaolo@tomassoni.biz>
X-Gentoo-Bug: 399165
X-Gentoo-Bug-URL: https://bugs.gentoo.org/399165
2012-01-17 18:25:44 +01:00
William Hubbs
d729f9d0f2 style fixes 2012-01-16 12:11:29 -06:00
Robin H. Johnson
fdc8849e56 net/ethtool: Fix program call.
I missed removing a call to the old ethtool function wrapper that was
made unneeded by commit d02d3af02.

X-Gentoo-Bug: 399037
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=399037
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-16 09:33:09 -08:00
Christian Ruppert
30a56cdb46 Add "ifstopped" command to runscript
Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
2012-01-15 02:10:35 +01:00
Christian Ruppert
14625346c0 Allow overriding of rc.conf options via kernel cmdline
This adds a new function that allows us to override some specific rc.conf
options via the kernel cmdline aka /proc/cmdline.
This makes esp. sense in cases where a rc_parallel enabled system has boot
issues. Simply disable rc_parallel by appending rc_parallel=no to your kernel
cmdline.
2012-01-15 01:02:11 +01:00
Christian Ruppert
c3be42006b Rename proc_getent to rc_proc_getent and make it global 2012-01-15 01:02:11 +01:00
William Hubbs
6fcc55cef8 release openrc-0.9.8.1 2012-01-14 14:00:36 -06:00
Robin H. Johnson
380752f4e0 net: allow parameters to a single address config
In the case of a single line of configuration, where the address has
parameters, the parameters were being treated as seperate addresses.
Eg:
config_eth0="4321:0:1:2:3:4:567:89ab/64 nodad home preferred_lft 0"

Also document usage of parameters in the net example, and note that
multiple addresses on a single line cannot be mixed with parameters.
Newlines are required to seperate the addresses.

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

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-13 15:57:22 -08:00
Robin H. Johnson
e7649f117a net/iproute2: Handle shortened arguments
Allow users to shorten iproute arguments to the shortest unique argument
that will match a flag of iproute2.

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

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-12 20:38:31 -08:00
Robin H. Johnson
66f4305e1c rc/checkpath: tmpfiles.d backend creation code
This commit provides the checkpath applet with feature parity to
systemd's tmpfiles.c create_item function.

Very similarly to the systemd function, it does NOT do any of the
cleanup work in this function.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-09 19:20:47 -08:00
Robin H. Johnson
4255ba175b net: net.lo, lots of scripts
The program function in depend blocks is now able to search paths by
itself. If passed multiple arguments or multiple calls, at least one of
the arguments passed must be a program or a shell builtin (eg ip built
into busybox). If a qualified path is specified, only that path will be
checked, otherwise it will be checked as a builtin, then $PATH will be
checked for the named binary (via type).

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-08 16:24:10 -08:00
William Hubbs
d02d3af02e net: make lookup of ethtool dynamic
The ethtool module checked in two places for the ethtool binary; now we
look for it in the path.
2012-01-07 15:47:48 -06:00
William Hubbs
61e05331d1 net: make lookup of iproute2 dynamic
The iproute2, macvlan and vlan modules had several possible hard coded
paths for the iproute2 binary. Now we look for it in the path.
2012-01-07 15:41:43 -06:00
William Hubbs
f2e404ab66 net.lo: Add the ability to find the full path of a binary
Some of the networking tools, such as iproute2, can be stored in one of
several locations. This function gives us a standard way to find these
tools.

I would like to thankRobin Johnson <robbat2@gentoo.org> for his input on
this function.
2012-01-07 13:09:17 -06:00
William Hubbs
adde73141f release openrc-0.9.8 2012-01-06 17:34:38 -06:00
William Hubbs
84aa4ba818 Revert "net/ifconfig net/iproute2: support lookup ifconfig/ip dynamically"
This reverts commit f583030e3c.

The previous commit did not account for the case of not having iproute2
installed.

Reported-by: Duncan <1i5t5.duncan@cox.net>
X-Gentoo-Bug: 397875
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=397875
2012-01-06 14:51:43 -06:00
William Hubbs
982ac38f35 cgroups: hide configure option to turn off cgroups
Turning off the default cgroups is possible, but these groups are the
recommended setup from the kernel, so turning them off is highly
discouraged.
2012-01-05 22:29:37 -06:00
William Hubbs
cd52fecc4e cgroups: turn on groups by default
The control groups we create are the ones recommended by the linux
kernel, so this should be on most of the time if cgroups are enabled in
the kernel.
2012-01-05 22:28:04 -06:00
William Hubbs
dbfcf23273 really disable /var/{lock,run} migration to /run
This needs to be disabled until we have tmpfiles.d support. The previous
method did not disable it correctly.
2012-01-05 06:55:08 -06:00
Mike Frysinger
f583030e3c net/ifconfig net/iproute2: support lookup ifconfig/ip dynamically
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-04 16:38:11 -05:00
William Hubbs
1771a83b92 Reword the documentation for the retry option for start-stop-daemon 2011-12-30 22:20:03 -06:00
William Hubbs
e873ef2ba7 Reword retry documentation on runscript man page 2011-12-30 22:12:59 -06:00
Christian Ruppert
26edfe369c Fix the description of --retry in start-stop-daemon(8)
X-Gentoo-Bug: 368615
X-Gentoo-Bug-URL: https://bugs.gentoo.org/368615
Reported-by: Stuart Shelton <srcshelton@gmail.com>
2011-12-31 03:43:25 +01:00
Christian Ruppert
34b7632d1d Do not exit immediately when a service has been stopped already
The old behaviour was to exit(EXIT_SUCCESS) in case the service has been stopped
already, even if further commands has been passed to the init script
(like zap, start).
So using for example /etc/init.d/foo stop zap start would abort immediately
after "stop" if the service has been stopped already. Though there may be cases
were we need it to proceed with the remaining commands, zap and start in this
case.
This patch fixes the behaviour to continue and proceed with the remaining
commands whenever necessary.

X-Gentoo-Bug: 371845
X-Gentoo-Bug-URL: https://bugs.gentoo.org/371845
2011-12-31 03:35:32 +01:00
Christian Ruppert
fb8db18d79 Add "retry" option for the stop() template 2011-12-31 02:41:59 +01:00
William Hubbs
6d5a2d5f9e Net: do not bring down interfaces during shutdown 2011-12-30 10:44:56 -06:00
William Hubbs
810f2e55fb Documentation updates
- Clarify that start_stop_daemon_args is only used when starting a
  daemon.
- fix several typos.
2011-12-30 10:35:16 -06:00
Christian Ruppert
372745844b Code style fixes 2011-12-30 16:03:24 +01:00
Christian Ruppert
191ea10f86 Document start_stop_daemon_args 2011-12-30 16:03:24 +01:00
Christian Ruppert
0d6ae379f4 Compare stricter in proc_getent
The new proc_getent compares stricter so that e.g. "ro" doesn't match
root=/dev/sdaN anymore.
So it has to be either "ro" or "ro=".
2011-12-30 16:03:24 +01:00