Commit Graph

2568 Commits

Author SHA1 Message Date
William Hubbs
a15fa1a3b1 Rework supervisor integration framework
The original way of doing this allowed users to change the supervisor in
conf.d/*. This changes this so that the supervisor setup can be done in
the service script itself.
2015-05-11 09:44:06 -05:00
William Hubbs
0198affc74 The rc_supervisor variable is a service configuration variable
This variable should not be changed globally unless you really know what
you are doing.
2015-05-08 12:29:26 -05:00
William Hubbs
abef2fcb2d Make the default start, stop and status functions overridable
This will make it possible to add support for supervision suites such as
runit and s6.
2015-05-08 11:39:39 -05:00
Jakob Drexel
0b435ddd83 librc: Fix crash if the service name is the same as the including runlevel
If a service has the same name as the runlevel it is in, openrc will
crash on changing to such runlevel. It goes in a recursive madness and
eventually gets a SEGV while in snprintf (don't know why).

This fixes two errors:
1. ls_dir stats files not with full path -> stat always returns != 0
2. ls_dir adds files to list if stat failed

This fixes #53.

X-Gentoo-Bug: 537304
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=537304
2015-05-04 09:54:51 -05:00
William Hubbs
9f6427ea57 Start work on 0.16 2015-05-01 19:02:49 -05:00
William Hubbs
60488069c0 update ChangeLog 2015-05-01 16:08:24 -05:00
William Hubbs
9225bfa691 Build: make snapshot remove .git directory from tarball 2015-05-01 10:14:31 -05:00
Mike Gilbert
7bd456ed7b Disable service scripts for systemd-nspawn
This adds the -systemd-nspawn keyword to service scripts which are not
intended to run in systemd-nspawn containers.

This fixes #52.

    X-Gentoo-Bug: 548058
    X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=548058
2015-05-01 09:14:09 -05:00
William Hubbs
c709e6077c Add support for systemd-nspawn containers
This adds support for running OpenRC in a container created by
the systemd-nspawn utility.

This fixes #52.

X-Gentoo-Bug: 548058
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=548058
2015-05-01 09:04:07 -05:00
William Hubbs
a27d577da8 Build: fix the dist target
The dist target now creates an archive based on the version setting.
This makes it possible to create an archive identical to the ones github
generates once the release is tagged.
2015-04-30 14:45:42 -05:00
William Hubbs
8b93492086 convert all references from runscript to openrc-run 2015-04-27 11:21:29 -05:00
William Hubbs
4b1b457cd1 Start work on 0.15 2015-04-26 10:30:49 -05:00
William Hubbs
1d6602bb8e Add ChangeLog 2015-04-25 18:30:39 -05:00
William Hubbs
a6391f44ee mtab: move toward requiring /etc/mtab to be a symbolic link
This changes the mtab service in the following way:

- If /etc/mtab is a symbolic link, success is returned.
- If /etc is not writable, we warn that we could not update /etc/mtab
  and return success.
- If /etc/mtab does not exist, we create a symbolic link from
  /etc/mtab to /proc/self/mounts.
- Otherwise, we warn that updating /etc/mtab as a file is
  deprecated and continue to update it after outputting instructions to
  the user for how to move it to a symbolic link.
2015-04-25 16:37:09 -05:00
William Hubbs
a8c6dbac96 typo fix in NEWS
The binfmt service should be added to the boot runlevel, not sysinit.
2015-04-24 19:53:35 -05:00
William Hubbs
a7c0400177 Update news 2015-04-24 14:47:50 -05:00
William Hubbs
03803ae8e9 start-stop-daemon: redirect stdin if --background option is used
X-Gentoo-Bug: 498684
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=498684
2015-04-24 12:24:09 -05:00
William Hubbs
1c2f7bf607 Convert feature removal schedule to markdown 2015-04-22 17:42:38 -05:00
William Hubbs
1ebffa517f Convert news to markdown 2015-04-22 17:13:31 -05:00
William Hubbs
e6dd26d185 convert README.history to markdown 2015-04-22 17:03:59 -05:00
William Hubbs
628b35e1be Update busybox documentation
Convert README.busybox to markdown and add the note on the sysctl applet
incompatibility.
2015-04-22 16:15:30 -05:00
William Hubbs
ebc32aadad Convert style guide to markdown 2015-04-22 15:54:40 -05:00
William Hubbs
362dfa3380 README.md: small formatting changes 2015-04-22 15:39:24 -05:00
William Hubbs
dccc0a9129 Update README.md format and bug reporting information 2015-04-22 14:54:12 -05:00
William Hubbs
c2aa56a7c4 Rename README README.md
This fixes #26.
2015-04-22 14:47:56 -05:00
William Hubbs
23d806ca24 savecache: clean up creation of cache directory
The cache directory should be created via mkdir -p instead of
mkdir. This makes sure all parent directories are created.

Also, we now display an error message explaining that we were unable to
create the cache directory if creation fails.
2015-04-21 18:56:39 -05:00
William Hubbs
de7d184909 savecache: fix check for $RC_LIBEXECDIR writability
We were originally checking to see if $RC_LIBEXECDIR/cache was writable. For
a new install, this check will fail since this path does not exist. This
is also incorrect because later we create $RC_LIBEXECDIR/cache.

The correct check is checkpath -W $RC_LIBEXECDIR, and this fixes the
issue.

X-Gentoo-Bug: 544632
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=544632
2015-04-21 18:30:26 -05:00
William Hubbs
15ab3f39c6 cgroups: use printf to write to cgroup files
This fixes #33.
2015-04-21 11:30:24 -05:00
William Hubbs
ee1768a419 Add binfmt service to sysinit runlevel
This makes binfmt processing behave like tmpfiles processing which
follows the same specification as systemd.

This fixes #48.

X-Gentoo-Bug: 545162
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=545162
2015-04-20 17:10:07 -05:00
William Hubbs
95ed066539 procfs: do not force loading of usbcore module
It appears that the only reason we were force loading the usbcore
module was to facilitate mounting usbfs. Since we no longer mount
usbfs, this is no longer necessary.

X-Gentoo-Bug: 480312
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=480312
2015-04-20 11:02:01 -05:00
William Hubbs
4c5132421f procfs: remove usbfs and usbdevfs support
The usbfs and usbdevfs file systems have been deprecated since
Linux-2.6.32, so we remove the code to automount them.

X-Gentoo-Bug: 480312
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=480312
2015-04-20 10:59:47 -05:00
William Hubbs
6d81d3be1b procfs: do not test for the existence of /proc/filesystems
The test for the existence of /proc/filesystems is redundant since we
always return success.
2015-04-19 13:59:12 -05:00
William Hubbs
8d307a6fad procfs: remove redundant check for OpenVZ
The check for OpenVZ is not necessary since the procfs service already
will not run on OpenVZ due to the keywords setting.
2015-04-17 14:15:59 -05:00
William Hubbs
62addf1180 Move SELinux mount to sysfs service
The selinux file system is mounted under /sys, so move the code for it
to the appropriate service.

X-Gentoo-Bug: 546290
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=546290
2015-04-14 11:41:17 -05:00
William Hubbs
1eab656ca1 Fix tmpfiles processing
Tmpfiles.d processing had /run overriding /usr/lib and /etc, but this is
not correct. The correct order, from lowest to highest, for tmpfiles
processing is:

* /usr/lib/tmpfiles.d/*.conf
* /run/tmpfiles.d/*.conf
* /etc/tmpfiles.d

This means /run/tmpfiles.d/*.conf can override /etc/tmpfiles.d/*.conf,
but /etc/tmpfiles.d/*.conf can override both of them.

This fixes #49.
2015-04-08 09:57:46 -05:00
William Hubbs
731a3affdc Fix script execution in the local service
The local service should use eval when it executes scripts since it has
the redirection set up in a variable.

This fixes #50.
X-Gentoo-Bug: 545012
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=545012
2015-04-08 09:37:04 -05:00
William Hubbs
3e9bb3b021 Make sysctl on Linux respect rc_verbose setting
We do not need to spam the console with variable settings by default.
This fixes #51.

X-Gentoo-Bug: 541922
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=541922
2015-04-07 17:57:56 -05:00
William Hubbs
c068762c4c Fix rc_verbose processing
We were processing the rc_verbose setting before we sourced the
configuration file where it was set; this fixes the issue.

Fixes #46
2015-03-29 23:05:32 +00:00
William Hubbs
b8ab99b5d3 checkpath: Remove the last HAVE_SELINUX test 2015-03-25 08:33:42 -05:00
William Hubbs
a4cf61e8bf selinux: unconditionally include the header and provide stub methods
If selinux is disabled, then stub methods will be provided instead of
calling the real methods. This removes some warnings about unused
parameters which used to be covered up with #ifdef HAVE_SELINUX.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2015-03-25 01:01:38 -05:00
William Hubbs
d38cc8f221 checkpath: fix warning about selinux_on being unused 2015-03-24 23:18:15 -05:00
Doug Freed
f085ae400c Fix some compiler warnings
librc: Fix C90 warning (mixed declaration and code)
rc: Fix warning about discarding const qualifier

Fixes #45.
2015-03-24 19:08:29 -05:00
Will Miles
c1faafcad8 start-stop-daemon: Fix regression for --test
The previous fix to --test (PR #34) prevented reading one too many
arguments when --exec -or --name was not specified, but created a
regression where the last argument would not print if either of those
arguments was specified. This corrects the issue.

Fixes #41.
2015-03-24 15:52:19 -05:00
William Hubbs
de93587aff Silence warning about _DEFAULT_SOURCE for Linux/glibc
In >=glibc-2.20, the _BSD_SOURCE macro is deprecated in favor of
_DEFAULT_SOURCE. This adds -D_DEFAULT_SOURCE to CPPFLAGS on Linux.

Fixes #44
2015-03-24 17:46:30 +00:00
Anthony Donnelly
be497229b6 Fix savecore service on FreeBSD
savecore -C only needs the dumpdevice otherwise it causes an error on startup.

This fixes #40.
2015-03-23 14:06:52 -05:00
William Hubbs
e16b7183e9 mk/os-GNU.mk: fix typo
MAX_PATH should have been PATH_MAX
2015-03-21 22:49:56 -05:00
Will Miles
ccd83a5e9c savecache: Make sure cache directory exists before running checkpath
checkpath -W can fail if the specified path doesn't actually exist yet.
In this case savecache script should attempt to create the path if it is
missing, however it is pre-empted by the checkpath call.  This patch adds
an explicit existence test before executing checkpath.

This fixes #36.
2015-03-20 17:21:57 -05:00
Robin H. Johnson
7bbb73574b bootmisc: clean_run safety improvements.
If /tmp or / are read-only, the clean_run function can fail in some very
bad ways.

1. dir=$(mktemp -d) returns an EMPTY string on error.
2. "mount -o bind / $dir", and don't check the result of that,
3. "rm -rf $dir/run/*", which removes the REAL /run contents
4. box gets very weird from this point forward

Signed-Off-By: Robin H. Johnson <robbat2@gentoo.org>
Signed-Off-By: Chip Parker <infowolfe@gmail.com>
Reported-by: Chip Parker <infowolfe@gmail.com>
Tested-by: Chip Parker <infowolfe@gmail.com>
2015-02-27 10:14:44 -06:00
William Hubbs
a0378f3871 checkpath: do not chown or chmod symbolic links
This is another security fix. If you use chown() or chmod() on a
symbolic link, it affects the referenced file, not the symbolic link
itself.

X-Gentoo-Bug: 540006
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=540006
2015-02-19 14:39:04 -06:00
William Hubbs
423f82bae9 ChangeLog: show authors and committers 2015-02-18 12:47:19 -06:00