Commit Graph

2436 Commits

Author SHA1 Message Date
Jason Zaman
4f784bd469 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
2014-07-16 10:53:25 -05:00
William Hubbs
4a1afa694c Add SELinux support to the build system
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2014-07-15 11:38:19 -05:00
William Hubbs
25c229cf83 sysfs.in: fix indentation 2014-07-14 15:58:50 -05:00
William Hubbs
71d6d61b28 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.
2014-07-13 14:12:36 -05:00
William Hubbs
40141244e3 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
2014-07-13 11:23:43 -05:00
Alexander V Vershilov
d59737afb1 man/openrc.8: update checkpath documentation
X-GENTOO-BUG: 500606
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606
2014-07-13 08:50:36 -05:00
Alexander V Vershilov
f66f41c4f0 typo fix 2014-07-11 16:36:35 -05:00
William Hubbs
d80482c2f4 checkpath: fix error message in previous commit 2014-07-11 15:23:38 -05:00
William Hubbs
d0040aff0a 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.
2014-07-11 15:04:06 -05:00
William Hubbs
75e06d8558 Style Fixes 2014-07-10 10:57:56 -05:00
Alexander V Vershilov
1a44be0f16 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
2014-07-10 10:56:37 -05:00
William Hubbs
f265ddde97 FEATURE_REMOVAL_SCHEDULE: add entry for local_start/stop 2014-07-10 09:04:04 -05:00
William Hubbs
57b9e601a9 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.
2014-07-09 15:33:48 -05:00
Thomas D
c1de8c09bf 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
2014-07-05 13:12:30 -05:00
Kaarle Ritvanen
143f1c64c1 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
2014-07-04 08:33:55 -05:00
William Hubbs
b4b34d909c Schedule removal of the opts variable from service scripts 2014-07-01 07:15:22 -05:00
William Hubbs
56112a6f1f 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@gentoo.org> for pointing this out.
2014-06-30 20:30:39 -05:00
William Hubbs
09d81e86f2 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
2014-06-23 20:41:06 -05:00
William Hubbs
23cb55d843 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
2014-06-21 01:53:17 -05:00
William Hubbs
094bc17cb0 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@gmx.com
X-Gentoo-Bug: 511804
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=511804
2014-06-20 19:39:07 -05:00
Sven Vermeulen
6126700a07 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@siphos.be>
2014-06-20 18:37:33 -05:00
Robin H. Johnson
19cccb2e94 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@gentoo.org>
2014-06-20 16:19:25 -05:00
William Hubbs
9eb9b28d3e librc: filter out container processes on OpenVZ host
Thanks to info and testing done by Daniel Robbins <drobbins@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
2014-06-20 16:01:47 -05:00
William Hubbs
a817915632 README.busybox: document incompatibility with built-in ip applet 2014-04-09 19:29:16 -05:00
Andrew Gregory
20d7b83150 tmpfiles.dev: remove --remove option
For compatibility with systemd.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-04-03 12:39:27 -05:00
Andrew Gregory
686ee62a79 tmpfiles: add support for --boot option
For compatibility with systemd-tmpfiles.

Fixes #17

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-03-27 11:36:41 -04:00
Andrew Gregory
c081633762 tmpfiles: ignore all files starting with systemd-
systemd recently moved creation of /run/nologin to systemd-nologin.conf

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-03-27 11:36:41 -04:00
William Hubbs
e0e1f2a4da rc.conf: typo fix 2014-03-14 22:18:25 -05:00
William Hubbs
7fb209a6fc conf.d/hwclock: typo fix 2014-03-13 15:27:40 -05:00
William Hubbs
d0186d422c rc.conf: document rc_nocolor setting 2014-03-09 15:37:38 -05:00
Mike Frysinger
4ee8e90ffe devfs: explicitly mount /dev/shm with mode=1777
The current code relies on the tmpfs mount defaulting to 1777
permissions.  If it doesn't, things break badly.

This can come up when tmpfs is disabled in the kernel and ramfs
is being used instead (the kernel will alias tmpfs to ramfs).
The default permissions for ramfs is 0755.
2014-01-23 12:01:53 -06:00
William Hubbs
2cc6ef723a update feature removal schedule
- Remove the netifrc related items since netifrc is now a separate
  package.

- State that the features we are planning to remove will be removed
  in version 1.0.

- Clarify the last entry; we are refering to start-stop-daemon options.
2014-01-23 11:18:45 -06:00
William Hubbs
de186401e5 fstabinfo: fix mount and remount
The mount and remount options should always be processed. They were only
being processed if -q was not on the command line.

X-Gentoo-Bug: 498206
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=498206
2014-01-18 13:50:05 -06:00
William Hubbs
cdc0dd061b init-Linux.sh: do not mount /run with nosuid
This is so that we will be consistent with the systemd spec forr the
/run directory mentioned in this wiki article:

http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/
2014-01-18 02:34:39 -06:00
William Hubbs
561b53ef09 bootmisc: Remove console directories only if $RC_LIBEXECDIR is writable
X-Gentoo-Bug: 489368
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489368
2014-01-15 10:43:52 -06:00
Benda Xu
abadaa04ab rc-update: add option to remove a service from all runlevels
The -a option,which only applies to the del command, is used to remove a
service from all runlevels.

X-Gentoo-Bug: 497740
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=497740
2014-01-13 10:41:38 -06:00
William Hubbs
54ab12d218 Merge init-common-post code into BSD init script
This code is no longer part of the initialization script for Linux, so
we can move it into the init script for *BSD which is the only place it
is used.
2014-01-11 13:32:43 -06:00
William Hubbs
257e10a1ab conf.d/keymaps: Remove the currency and euro symbols
A comment in this file had the actual currency and euro symbols, which
were not utf-8, so I was requested to remove them.

X-Gentoo-Bug: 494936
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494936
2014-01-09 13:56:31 -06:00
William Hubbs
e5a94dd3f4 Add missing documentation for environment variables
Add documentation for the RC_SERVICE, RC_GOINGDOWN, RC_LIBEXECDIR and
RC_NO_UMOUNTS environment variables.

X-Gentoo-Bug: 489344
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=489344
2014-01-08 13:16:27 -06:00
William Hubbs
8352082eb6 devfs: add code to mount /dev
All Linux systems need /dev to be set up,so add code to devfs to do
this. The process devfs follows is below.

1. If static_dev is yes, nothing is done.
2. if /dev is an entry in fstab it is mounted or remounted based on that
entry.
3. If /dev is not in fstab, it attempts to mount /dev as a devtmpfs or
   tmpfs depending on which is defined in the kernel; devtmpfs is
   preferred.
4. If neither devtmpfs nor tmpfs is defined, it assumes the user wants
static /dev and prints a warning.

X-Gentoo-Bug: 492694
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=492694
2014-01-05 11:17:05 -06:00
William Hubbs
3470eda3f5 Rename runscript to openrc-run
This was requested by Debian, because the minicom software, which is
available on Debian and other distros, has a binary named runscript. We
are keeping a backward compatibility symlink for now, but this allows
Debian or any other distro to safely remove the symlink.

X-Gentoo-Bug: 494220
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-29 22:57:31 -06:00
William Hubbs
c096ad63ca add openrc binary to ignore patterns 2013-12-13 12:19:27 -06:00
William Hubbs
7a35daeab7 runscript: clarify the message wrt scheduling
The message about a service being scheduled to start was confusing to
some of our users; I was told this wording is more clear.

X-Gentoo-Bug: 493070
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493070
2013-12-13 01:09:55 -06:00
William Hubbs
7b5fa011ac Rename the rc binary to openrc
Debian requested this rename due to the "rc" binary conflicting with the
"rc" binary from the plan 9 shell.

We also add a deprecation warning to the binary when it is run as rc to
encourage users to switch to openrc instead.

X-Gentoo-Bug: 493958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493958
2013-12-12 18:31:29 -06:00
William Hubbs
09733d3fae tmpfiles.sh: small fixes
Change "sort | uniq" to "sort -u". Also, change `...` to $(...).

X-Gentoo-Bug: 493736
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493736
2013-12-10 22:34:40 -06:00
William Hubbs
7230b29bf3 rc.conf: Sync list of network file systems with actual defaults
I would like to thank Aaron Ten Clay <aarontc@aarontc.com> for pointing
this out; this is based on a patch he submitted.

X-Gentoo-Bug: 491384
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=491384
2013-12-08 13:40:23 -06:00
Petre Rodan
235f94c4c5 bootmisc.in: fix boot order
Bootmisc was running before the root file system was remounted rw in
some situations. This fixes that issue.

X-Gentoo-Bug: 493442
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493442
2013-12-08 12:42:31 -06:00
Andrew Gregory
d711663189 network.in: skip loopback device
The loopback interface is supposed to be handled by the loopback
service, but sys_interfaces includes it.  This causes network to try to
start it and means that network provides net even if lo is the only
interface configured.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-12-06 13:24:58 -06:00
William Hubbs
60d288a877 remove type command
The posix equivalent of the type command is "command -v", so now we use
that. Thanks to Jonathan Callen <jcallen@gentoo.org> for informing me
wrt the fix.
2013-12-02 02:08:40 -06:00
William Hubbs
1fccf91df1 rc-update: make "service already installed" message informational
This message was being sent to stderr, and it should be sent to
stdout since it is informational. This change was requested by
zero_chaos.
2013-12-01 11:20:29 -06:00