Compare commits

..

4 Commits

Author SHA1 Message Date
William Hubbs
4f544f4130 update change log 2015-05-13 16:59:54 -05:00
William Hubbs
c65bed756e More s6 fixes
- When no service link is in the scan directory, show the default
  stopped message.
- Do not remove the service link when stopping the service.
2015-05-13 16:55:34 -05:00
William Hubbs
ccc81a9cad Fix the s6 handling
This changes the default s6 service directory to /var/svc.d, also
it changes the code to work with the individual services instead of
forcing a rescan when a service is started or stopped.
2015-05-13 16:15:44 -05:00
William Hubbs
3a1e304d6c Start work on 0.16.1 2015-05-13 16:14:48 -05:00
27 changed files with 769 additions and 728 deletions

963
ChangeLog
View File

@@ -1,321 +1,4 @@
commit d5116cc697c9eb275ab8497939ab41504e5ce578
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
localmount: white space cleanup
commit b86d170037197d7bdcda57c7d4c09c17bda97f31
Author: Ian Stakenvicius <axs@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
localmount: clean up handling of aufs branches
X-Gentoo-Bug: 560008
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=560008
commit 6fa0d6318bcd5c98548cff2ff840bca116892ca5
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
mtab: fix update logic
This advises users to remove mtab from their runlevels if /etc/mtab is a
symlink, and it creates the symlink if /etc/mtab does not exist on a
system.
X-Gentoo-Bug: 560060
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=560060
commit 80d3928b0d13f09a9c1e82bd27c9fff943d84d43
Author: Austin S. Hemmelgarn <ahferroin7@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
cgroups: Add the hugetlb, net_cls and pids controllers
Note from WilliamH: I slightly rearranged the code and added the
settings in rc.conf.
X-Gentoo-Bug: 555488
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=555488
commit 17ef205bc63a4e231dccee719394a7a8563f8c3f
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
sysfs: use printf instead of echo to write to cgroup files
This is needed for compatibility with musl and printf is also posix.
X-Gentoo-Bug: 562334
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=562334
commit b20a1951adf9a705a903fb3047b7ef26c013103c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
rc-cgroup.sh: Do not add leading spaces to cgroup values
We were starting the value we write to the cgroup setting file with
leading spaces and this was causing issues. This change makes sure that
we aren't adding leading spaces to the value.
X-Gentoo-Bug: 562354
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=562354
commit bf0c0dd5644436efe4986c2b259b755d111266b9
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
bootmisc: convert errors in clean_run function to warnings
X-Gentoo-Bug: 552418
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=552418
commit 1558ad2b9ebf319b85876a940d31d513bf21324f
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
bootmisc: only remove temp directory if umount is successful
Change the clean_run function to only remove the temp directory if the
umount was successful.
X-Gentoo-Bug: 561230
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=561230
commit 5f4f2420364098835522da868a9e75205c9e4f9c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
mountinfo: fix --netdev and --nonetdev on Linux
On Linux, the --netdev and --nonetdev switches were not working. They
were both returning false. After this change, they operate based on the
presence or abscence of the _netdev option in mount options.
commit b3f7ff901f7d3ed00b9f73c601193ac507f62eaf
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
mountinfo: read /proc/self/mounts instead of /proc/mounts on Linux
commit a59365a582c3a8c9a8b863b572fddcb65fccadfd
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
start-stop-daemon.sh: complain in start if command is undefined
The default start-stop-daemon start function expects the command
variable to be defined to point to the daemon we want to start.
If the variable is undefined, this means that there will be nothing to
start, and in this case we should complain because it is possible that
the script writer made a typo in the variable name.
commit dac5966ca40610797d2b2aabef17154ca3dc20af
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Revert "local/netmount: remove uses of -O [no]_netdev"
This reverts commit 2a439c85bd69efc14847b4397bd6783cac051405.
There is another use case for -O involving iscsi, so we can't remove it.
commit 3b6a6df4b5b818e576a88444632d5c73cffd1c57
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
openrc-run: rename some dependency variables and a function for clarity
All of the dependency type lists had the types_ prefix in their names;
this has been changed to deptypes_ to make them more self documenting.
Along the same lines, the setup_types function was renamed
setup_deptypes.
commit b047ea47e97d7e8b96d6d0e064613f6860c8eb36
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
localmount/netmount: on Linux, fail if some file systems do not mount
The following return codes are returned by mount -a:
0: all file systems mounted.
32: no file systems mounted.
64: some file systems mounted.
The localmount/netmount services should fail if all file systems that
should mount did not mount.
commit b652752339690e10a55ae50d046f4cf2a98daf1a
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Make localmount and netmount always succeed on non-linux
commit 2a439c85bd69efc14847b4397bd6783cac051405
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
local/netmount: remove uses of -O [no]_netdev
This was causing an incompatibility with busybox, and we do not use it
in Gentoo.
commit 7341cd882fba522c1f1d183603334839bd4df7fc
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
allow localmount and netmount to fail
commit 279f1e5d1013309d99509ab4b7b57521f8a4aba4
Author: Mike Frysinger <vapier@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
binfmt: fix indent on return
commit c256a7aa80c683eca6194c80b57294e4d51c9a16
Author: Doug Freed <dwfreed@mtu.edu>
Commit: Doug Freed <dwfreed@mtu.edu>
savecache: clean up implementation
X-Gentoo-Bug: 557222
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=557222
commit 6a422982579786cb8308af04ccca6622afa06e50
Author: Jason Zaman <jason@perfinion.com>
Commit: Doug Freed <dwfreed@mtu.edu>
tmpfiles: run restorecon on the entire path
The tmpfiles "d" entry will create a full path and only the last dir in
the path will have its SELinux label set correctly. This patch will
restorecon the parents as well so that the selinux labels are correct.
eg, "d /run/libvirt/lxc", then "lxc" would have the correct SELinux
label but "libvirt" would not.
Signed-off-by: Jason Zaman <jason@perfinion.com>
commit f69833a1e17d1cf65e96a34fcc0e48caf9d90d64
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
mountinfo: fix -e and -E options
Add the -e and -E options to getoptstring so they are recognized.
commit eeadca0b8a5b87c26e60a58563251604350a7a3b
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Add EERROR_QUIET and EINFO_QUIET to environment whitelist
commit dde339070b4850dc1fadf4992cc01d3468992106
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Increment version
commit 1736be3bc3ebbc1440f87b49fc353e81fb0a6037
Author: Doug Freed <dwfreed@mtu.edu>
Commit: Doug Freed <dwfreed@mtu.edu>
savecache: Fix unable to create cache message
The cache is created in $RC_LIBEXECDIR, not $RC_SVCDIR, so fix the error
message when we fail to create it to match.
commit a36a635b016a7427dd1739a26c951fedf22f0dec
Author: Mike Gilbert <floppym@gentoo.org>
Commit: Doug Freed <dwfreed@mtu.edu>
tmpfiles: Recognize type 'v' (create btrfs subvol)
This change does NOT implement btrfs subvol creation. Instead, it
treats 'v' the same as 'd', which is an acceptable fallback
according to the manual.
Fixes #58
commit 9310ccc06bcadd8897aed51cd51c94fccb7d9c07
Author: Mike Gilbert <floppym@gentoo.org>
Commit: Doug Freed <dwfreed@mtu.edu>
Remove execute bit from tmpfiles.sh.in
commit 0c2e4eb3cd7935d375b74099a3a9a5fe519e6cab
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Update ChangeLog
commit d2ce07e227ec95370e8aee5f1199edc6ad61aff9
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Add rc-sstat script
The rc-sstat script is written to display status of s6 services and
run rc-status to display all services status.
This currently only works on Linux.
commit b209fe3859c05c286037843bb34058f849c54b15
Author: Mike Gilbert <floppym@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
bootmisc: Don't call dmesg in systemd-nspawn containers
This fixes #57.
commit c94c8288cd5217b01c24d6f048c64ebbc30bee02
Author: Mike Frysinger <vapier@gentoo.org>
Commit: Mike Frysinger <vapier@gentoo.org>
fix link to s6 website
commit bcb9c44e73ccf332c7c961a6f82520699c6e776d
Author: Mike Gilbert <floppym@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
man: Document the stopsig variable
This variable can be used to set the signal to send if the service is
using start-stop-daemon.
This fixes #56
commit bbabf546f9d72cbfc48bd839a6d01b402ee6cced
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Document bash's handling of ulimit options
When bash is used in posix mode for the shell, the ulimit command uses
a block size of 512 bytes for the -c and -f options.
X-Gentoo-Bug: 549238
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=549238
commit a7fcc1e264b035177b4e524a40b27145baa86969
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
S6: kick the scanner and sleep 1.5 seconds to avoid a race condition
commit b79d058f162d8b49ccc968744e7cb1b7a7ba729c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
s6: Use s6-svc -Dd to stop services
This allows us to get rid of the sleep call in the stop function. Also,
we set a configurable timeout value for stopping daemons.
commit ddce529c71c2e9f01d8e5666e27050b6ed6c6761
commit c65bed756e5f5cfa244d9aa4325691345d8c324d
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
@@ -325,7 +8,7 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
stopped message.
- Do not remove the service link when stopping the service.
commit e372f97bebd4866633ad56aa5d5b1ae59fa88118
commit ccc81a9cad5d9beb739593827fc4bbc04c4a3304
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
@@ -335,11 +18,11 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
it changes the code to work with the individual services instead of
forcing a rescan when a service is started or stopped.
commit c2abf4b436b8cca8ebed395ff08f5fdc546eadac
commit 3a1e304d6c56875838b884b6e0608fe756ccce4e
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Start work on 0.17
Start work on 0.16.1
commit d247ac4cbbe0ab62564ef82a5940b4f1a03973b3
Author: William Hubbs <w.d.hubbs@gmail.com>
@@ -1231,3 +914,641 @@ Commit: William Hubbs <w.d.hubbs@gmail.com>
X-Gentoo-Bug: 508574
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=508574
commit ad770d739cd7d68dd16b4b2e23d4822ebeb3305b
Author: Rick Farina (ZeroChaos) <sidhayn@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
localmount: unmount aufs branches
commit 866501be1c554de074533ee98400124393d7fe9d
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
typo fix
commit 20006625a6d37c5add84dd4c8454649279645604
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
man: Document start_inactive and in_background_fake
commit e860b7cb4f3749528ae3db0f3cb500ef889d2781
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Revert "sysfs: fix permissions on cgroup mounts"
This reverts commit 7a25491ced95e14b04b8fe6225171564c87fcde0.
This was broken; I need to look further into it.
commit 7a25491ced95e14b04b8fe6225171564c87fcde0
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
sysfs: fix permissions on cgroup mounts
commit 50658449bd46f1a53b8eb11d34f6eefdd1ceba9c
Author: Roy Marples <roy@marples.name>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit de60ffeebe93ffdc09c1dda51e04f29485d96cdb
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
runscript: move verbose mode setting near debug setting
commit d032b17897278659ae103d1bcf2aea7739cdbfbb
Author: Joe M <joe9mail@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
savecache: check permissions on the correct directory
commit d4204a97a2410fcf37a64385204e6452c6958e8d
Author: Andrew Gregory <andrew.gregory.8@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
tmpfiles.sh: add support for C action
Recursively copies files or directories. Added by systemd in 849958d1.
commit 6f3f50d4530f583d0d2aedec8af20077a9d07f4f
Author: Andrew Gregory <andrew.gregory.8@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit 4f4f00d612ce6b43a2dcba9e0c39816e5d6d92a7
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 7b9fe5fced762935c48c90797b3bba2c82f10eb2
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
start work on 0.14
commit c60ef5c381e9edc7e30be9dcc9cc7e123515452e
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
mtab: add verbose level deprecation warnings
commit bee3f8463cbc372c344541077924ddd45ca62ef1
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
README: Clarify devfs changes
I was informed that the previous explanation of the devfs changes could
be interpreted to mean that we mount a second /dev on top of the one
that was mounted by the kernel or initramfs. This change makes it clear
that is not the case.
commit 72b7b32502ff149c0f0f8a7833cfd213f6cf933e
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
README: add notes about devfs changes
commit 645f7b6947d9fc44fbece0931a3ddb10d3d79b27
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
adjust deprecation schedule for mtab
- Quiet the deprecation messages forr now
- update the feature removal schedule to reflect that it will be removed
in 2.0.
commit 1b26d547a50e2554483bdbfd288fae75fd76bfa0
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Deprecate the mtab service script
The mtab service script is no longer needed on modern Linux systems, so
we can remove it in 1.0. However, we need to set a deprecation notice
first.
commit c8018d04a7b238b57a3d74a68e2af02af395f510
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
tmpfiles: fix relabel to run restorecon before chown and chmod
commit 6f080e9c1a2a9b9c308cdc03f9cf782c4ce4d440
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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).
commit 2c265e13c60be0ed583a871ca12a22e4d379a7c0
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
README: expand information about rc and runscript deprecation
commit 24d82d9ff1ca1ba7085814f8f6530124c117aa5f
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
rc.conf: document rc_verbose
commit d1e71b07afd4b900894ce4ea45f94010c70e32cc
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit 7b744befac2049eb6372a7f0c5420c740aa0a4ea
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
bootmisc: do not run the clean_run function in an LXC container
commit faaaab4bf540b4df011abea5985963dbc9e1646a
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit d29db70efb2adfbd200ba4a03fa78653e97893a6
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 6a337ff6c531d9d7310253b67b3e95d1ce5d214c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit 647e08eb9166d23d0c64f0c8767d93a06bd21a40
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 2624a8c8a7030180f9548a6e2fba5b0a82c5f046
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 275714bdc74c363ca1612b2b6b97f74f7a62b50c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
checkpath: style fix
commit e3bfb68aece9378a0669c2893285808100fd5ea6
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 1f7582c78b2697c3f2617a4a89afabaf3550b0fb
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
src/librc/librc-daemon.c: style fix
commit cc1bc6a4cec772c50a1b5232655ff34370d204b1
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
src/rc/Makefile: typo fix
commit 40f42ced21b1c0c99780b801d28fafd91a858f90
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 1a1d53335b2e6e3240b738ba1f81de64e552c337
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 99939b9839fb45093fe193e06139eab4a95637da
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
sysfs: restorecon after mounting /sys
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
commit 89907b60bac51db2cda1afe4555676577ef498a8
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit a94a9740d545817294cc431180db0f22fc923b13
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
checkpath: style fixes
commit 8b8edc29705b843988b97242942a409241c182eb
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
style fixes
commit 010c2ab18b4be2068237cf0db97e9348bba65ac6
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 9c689542c3246e793310db938374bc97600435e6
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
checkpath: restore the SELinux context
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
commit 525d7140b12a8e259f9d919f24148e369e9ff7d1
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 4f784bd46923486773edcd7749246a21bd419e6b
Author: Jason Zaman <jason@perfinion.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 4a1afa694cd8ebd6591d5a825ee35e4f57c98469
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Add SELinux support to the build system
X-Gentoo-Bug: 516956
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
commit 25c229cf830c8e822a206f2e08f9c94964a47aa9
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
sysfs.in: fix indentation
commit 71d6d61b28c4c0f285ec51459551d900dfa4ea71
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit 40141244e349e6e1d2dfb9ebfbcbf62f68d33a9d
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit d59737afb159d993916836903d9e670a1334c93a
Author: Alexander V Vershilov <qnikst@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
man/openrc.8: update checkpath documentation
X-GENTOO-BUG: 500606
X-GENTOO-BUG-URL: https://bugs.gentoo.org/show_bug.cgi?id=500606
commit f66f41c4f03d8077bdaa047a7a93f6c92c0a69de
Author: Alexander V Vershilov <qnikst@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
typo fix
commit d80482c2f4ec35a880ee099eeb3983b255d65e8f
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
checkpath: fix error message in previous commit
commit d0040aff0aa033fd5d5c40480008e98ee5e1f11a
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit 75e06d85584fc3ebfa26fbca97ea60b687247bb0
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Style Fixes
commit 1a44be0f16a7a1de8a176e7c656f8513494e0e64
Author: Alexander V Vershilov <qnikst@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit f265ddde971d0fdb97a4f14b4cc96140be7b4628
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
FEATURE_REMOVAL_SCHEDULE: add entry for local_start/stop
commit 57b9e601a97fac3a044ec5d7e5f11b6219c892b7
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit c1de8c09bf4895c6108d297fcebd63046e49e614
Author: Thomas D <whissi@whissi.de>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 143f1c64c13e4930e3880a393b7253d6fbc0ed58
Author: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit b4b34d909c36898095a0036f90a328838137e3a4
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
Schedule removal of the opts variable from service scripts
commit 56112a6f1f176696e5f39a86fe4b52017ccdd04c
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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.
commit 09d81e86f210acf5270ea4bd0fa7319a49f88131
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 23cb55d843b165d5508f330287ed329358fc85dc
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 094bc17cb0ad75da189ebf1a8242a378928a1eef
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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
commit 6126700a0723efa4ef1e299da0f58498f742c3a1
Author: Sven Vermeulen <sven.vermeulen@siphos.be>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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>
commit 19cccb2e9416311b85fcad3c15d4d988fed2f954
Author: Robin H. Johnson <robbat2@gentoo.org>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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>
commit 9eb9b28d3e3b6725559fb38101ae869c1e4530ce
Author: William Hubbs <w.d.hubbs@gmail.com>
Commit: William Hubbs <w.d.hubbs@gmail.com>
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

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.18.1
VERSION= 0.16.1
PKG= ${NAME}-${VERSION}

11
NEWS.md
View File

@@ -3,17 +3,6 @@
This file will contain a list of notable changes for each release. Note
the information in this file is in reverse order.
## OpenRC-0.18
The behaviour of localmount and netmount in this version is changing. In
the past, these services always started successfully. In this version,
they will be able to fail if file systems they mount fail to mount. If
you have file systems listed in fstab which should not be mounted at
boot time, make sure to add noauto to the mount options. If you have
file systems that you want to attempt to mount at boot time but failure
should be allowed, add nofail to the mount options for these file
systems in fstab.
## OpenRC-0.14
The binfmt service, which registers misc binary formats with the Linux

View File

@@ -62,21 +62,12 @@ rc_tty_number=12
# Set the devices controller settings for this service.
#rc_cgroup_devices=""
# Set the hugetlb controller settings for this service.
#rc_cgroup_hugetlb=""
# Set the memory controller settings for this service.
#rc_cgroup_memory=""
# Set the net_cls controller settings for this service.
#rc_cgroup_net_cls=""
# Set the net_prio controller settings for this service.
#rc_cgroup_net_prio=""
# Set the pids controller settings for this service.
#rc_cgroup_pids=""
# Set this to YES if yu want all of the processes in a service's cgroup
# killed when the service is stopped or restarted.
# This should not be set globally because it kills all of the service's

View File

@@ -116,9 +116,6 @@
#SSD_NICELEVEL="-19"
# Pass ulimit parameters
# If you are using bash in POSIX mode for your shell, note that the
# ulimit command uses a block size of 512 bytes for the -c and -f
# options
#rc_ulimit="-u 30"
# It's possible to define extra dependencies for services like so

View File

@@ -16,5 +16,5 @@ start()
ebegin "Loading custom binary format handlers"
"$RC_LIBEXECDIR"/sh/binfmt.sh
eend $?
return 0
return 0
}

View File

@@ -121,11 +121,11 @@ clean_run()
local dir
# If / is still read-only due to a problem, this will fail!
if ! checkpath -W /; then
ewarn "/ is not writable; unable to clean up underlying /run"
eerror "/ is not writable; unable to clean up underlying /run"
return 1
fi
if ! checkpath -W /tmp; then
ewarn "/tmp is not writable; unable to clean up underlying /run"
eerror "/tmp is not writable; unable to clean up underlying /run"
return 1
fi
# Now we know that we can modify /tmp and /
@@ -136,12 +136,13 @@ clean_run()
dir=$(mktemp -d)
if [ -n "$dir" -a -d $dir -a -w $dir ]; then
mount --bind / $dir && rm -rf $dir/run/* || rc=1
umount $dir && rmdir $dir
umount $dir
rm -rf $dir
else
rc=1
fi
if [ $rc -ne 0 ]; then
ewarn "Could not clean up underlying /run on /"
eerror "Could not clean up underlying /run on /"
return 1
fi
}
@@ -213,13 +214,10 @@ start()
if yesno $log_dmesg; then
if $logw || checkpath -W /var/log; then
# Create an 'after-boot' dmesg log
case "$RC_SYS" in
VSERVER|OPENVZ|LXC|SYSTEMD-NSPAWN) ;;
*)
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
;;
esac
if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ -a "$RC_SYS" != LXC ]; then
dmesg > /var/log/dmesg
chmod 640 /var/log/dmesg
fi
fi
fi

View File

@@ -15,7 +15,7 @@ depend()
start()
{
# Mount local filesystems in /etc/fstab.
local types="noproc" x= no_netdev= rc=
local types="noproc" x= no_netdev=
for x in $net_fs_list $extra_net_fs_list; do
types="${types},no${x}"
done
@@ -29,11 +29,9 @@ start()
ebegin "Mounting local filesystems"
mount -at "$types" $no_netdev
eend $? "Some local filesystem failed to mount"
rc=$?
if [ "$RC_UNAME" != Linux ]; then
rc=0
fi
return $rc
# Always return 0 - some local mounts may not be critical for boot
return 0
}
stop()
@@ -72,19 +70,17 @@ stop()
sync
fi
local aufs_branch aufs_mount_point aufs_si_id aufs_br_id branches
for aufs_si_dir in /sys/fs/aufs/si*; do
[ -d "${aufs_si_dir}" ] || continue
aufs_si_id="si=${aufs_si_dir#/sys/fs/aufs/si_}"
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})"
branches="$aufs_si_dir/br[0-9] $aufs_si_dir/br[0-9][0-9] $aufs_si_dir/br[0-9][0-9][0-9]"
for x in $branches; do
[ -e "${x}" ] || continue
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 2>&1; then
ewarn "Failed to remove branch $aufs_branch from aufs \
$aufs_mount_point"
$aufs_mount_point"
fi
eoutdent
sync

View File

@@ -12,18 +12,21 @@ depend()
start()
{
[ -L /etc/mtab ] && return 0
local rc=0
ebegin "Updating /etc/mtab"
if [ -L /etc/mtab ] ; then
ewarn "/etc/mtab is a symlink, not updating."
ewarn "FYI - You can safely remove mtab from your runlevels."
elif ! checkpath -W /etc; then
if ! checkpath -W /etc; then
rc=1
elif [ ! -e /etc/mtab ]; then
einfo "Creating mtab symlink"
ln -snf /proc/self/mounts /etc/mtab
else
einfo "Updating mtab file"
ewarn "The support for updating /etc/mtab as a file is"
ewarn "deprecated and will be removed in the future."
ewarn "Please run the following command as root on your system."
ewarn
ewarn "ln -snf /proc/self/mounts /etc/mtab"
ewarn
# With / as tmpfs we cannot umount -at tmpfs in localmount as that
# makes / readonly and dismounts all tmpfs even if in use which is
# not good. Luckily, umount uses /etc/mtab instead of /proc/mounts

View File

@@ -27,10 +27,7 @@ start()
rc=$?
fi
ewend $rc "Could not mount all network filesystems"
if [ "$RC_UNAME" != Linux ]; then
rc=0
fi
return $rc
return 0
}
stop()

View File

@@ -7,53 +7,43 @@ description="Saves the caches OpenRC uses to non volatile storage"
start()
{
if [ -e "$RC_SVCDIR"/clock-skewed ]; then
ewarn "Clock skew detected!"
ewarn "WARNING: clock skew detected!"
if ! yesno "${RC_GOINGDOWN}"; then
eerror "Not saving deptree cache"
return 1
fi
fi
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
if ! checkpath -W "$RC_LIBEXECDIR"; then
eerror "${RC_LIBEXECDIR} is not writable!"
eerror "Unable to save dependency cache"
if yesno "${RC_GOINGDOWN}"; then
return 0
fi
if ! checkpath -W "$RC_LIBEXECDIR"; then
ewarn "WARNING: ${RC_LIBEXECDIR} is not writable!"
if ! yesno "${RC_GOINGDOWN}"; then
ewarn "Unable to save deptree cache"
return 1
fi
rm -rf "$RC_LIBEXECDIR"/cache
if ! mkdir -p "$RC_LIBEXECDIR"/cache; then
eerror "Unable to create $RC_LIBEXECDIR/cache"
eerror "Unable to save dependency cache"
if yesno "${RC_GOINGDOWN}"; then
return 0
fi
return 1
fi
fi
if ! checkpath -W "$RC_LIBEXECDIR"/cache; then
eerror "${RC_LIBEXECDIR}/cache is not writable!"
eerror "Unable to save dependency cache"
if yesno "${RC_GOINGDOWN}"; then
return 0
fi
return 1
return 0
fi
ebegin "Saving dependency cache"
local rc=0 save=
local rc=
if [ ! -d "$RC_LIBEXECDIR"/cache ]; then
rm -rf "$RC_LIBEXECDIR"/cache
if ! mkdir -p "$RC_LIBEXECDIR"/cache; then
rc=$?
if yesno "${RC_GOINGDOWN}"; then
rc=0
fi
eend $rc "Unable to create $RC_SVCDIR/cache"
return $rc
fi
fi
local save=
for x in deptree depconfig shutdowntime softlevel nettree rc.log; do
[ -e "$RC_SVCDIR/$x" ] && save="$save $RC_SVCDIR/$x"
done
if [ -n "$save" ]; then
cp -p $save "$RC_LIBEXECDIR"/cache
rc=$?
cp -p $save "$RC_LIBEXECDIR"/cache 2>/dev/null
fi
rc=$?
if yesno "${RC_GOINGDOWN}"; then
if [ $rc -ne 0 ]; then
eerror "Unable to save dependency cache"
fi
eend 0
rc=0
fi
eend $rc "Unable to save dependency cache"
eend $rc
}

View File

@@ -116,7 +116,7 @@ mount_cgroups()
mount -n -t cgroup \
-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
openrc /sys/fs/cgroup/openrc
printf 1 > /sys/fs/cgroup/openrc/notify_on_release
echo 1 > /sys/fs/cgroup/openrc/notify_on_release
fi
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0

View File

@@ -1,17 +1,9 @@
MK= ../mk
include ${MK}/sys.mk
include ${MK}/os.mk
MAN3= einfo.3 \
rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \
rc_runlevel.3 rc_service.3 rc_stringlist.3
MAN8= rc-service.8 rc-status.8 rc-update.8 openrc.8 openrc-run.8 \
service.8 start-stop-daemon.8
ifeq (${OS},Linux)
MAN8 += rc-sstat.8
endif
# Handy macro to create symlinks
# This does rely on correctly formatting our manpages!
MAKE_LINKS= suffix=$${man\#*.}; \
@@ -24,6 +16,8 @@ MAKE_LINKS= suffix=$${man\#*.}; \
fi; \
done;
MK= ../mk
include ${MK}/sys.mk
include ${MK}/gitignore.mk
all:

View File

@@ -117,9 +117,8 @@ The path to the s6 service directory if you are monitoring this service
with S6. The default is /var/svc.d/${RC_SVCNAME}.
.It Ar s6_svwait_options_start
The options to pass to s6-svwait when starting the service via s6.
.It Ar s6_service_timeout_stop
The amount of time, in milliseconds, s6-svc should wait for the service
to go down when stopping the service. The default is 10000.
.It Ar s6_svwait_options_stop
The options to pass to s6-svwait when stopping the service via s6.
.It Ar start_stop_daemon_args
List of arguments passed to start-stop-daemon when starting the daemon.
.It Ar command
@@ -141,8 +140,6 @@ will chroot into this path before writing the pid file or starting the daemon.
Pidfile to use for the above defined command.
.It Ar name
Display name used for the above defined command.
.It Ar stopsig
Signal to send when stopping the daemon.
.It Ar retry
Retry schedule to use when stopping the daemon. It can either be a
timeout in seconds or multiple signal/timeout pairs (like SIGTERM/5).

View File

@@ -1,46 +0,0 @@
.\" Copyright (c) 2015 William Hubbs
.\"
.\" 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.
.\"
.Dd April 24, 2008
.Dt RC-sstat 8 SMM
.Os OpenRC
.Sh NAME
.Nm rc-sstat
.Nd show status info about services supervised by s6 then rc-status
info
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
gathers and displays information about the status of services supervised
by s6 then runs rc-status to show info about nnormal OpenRC services.
.Pp
.Sh EXIT STATUS
.Nm
exits 1 if there is an internal error or exits with the same exit codes
as rc-status.
.Sh SEE ALSO
.Xr rc-status 8 ,
.Xr rc-update 8
.Sh AUTHORS
.An William Hubbs <w.d.hubbs@gmail.com>

View File

@@ -33,16 +33,24 @@ supervisor=s6
Several other variables affect s6 services. They are documented on the
openrc-run man page, but I will list them here for convenience:
s6_service_path - the path to the s6 service directory. The default is
/var/svc.d/$RC_SVCNAME.
s6_service_path - the path to the s6 service directory
s6_svwait_options_start - the options to pass to s6-svwait when starting
the service. If this is not set, s6-svwait will not be called.
s6_svwait_options_stop - the options to pass to s6-svwait when stopping.
s6_service_timeout_stop - the amount of time, in milliseconds, s6-svc
should wait for a service to go down when stopping.
The s6_service_path variable defaults to /var/svc.d/${RC_SVCNAME} if it
is not set in the service script. For example, if you want a service
script called /etc/init.d/foobar to use s6 to monitor its daemon, the s6
service should be the directory /var/svc.d/foobar.
See the documentation for s6 for more information about s6 service
directories.
The s6_svwait_options_* variables set command line options to pass to
s6-svwait when starting or stopping the s6 service. These can be very
useful for waiting for s6 services to signal when they are up, timing out
when an s6 service doesn't come up, etc.
This is very early support, so feel free to file bugs if you have
issues.
[1] http://www.skarnet.org/software/s6
[1] https://www.skarnet.org/software/s6

1
scripts/.gitignore vendored
View File

@@ -1 +0,0 @@
rc-sstat

View File

@@ -1,19 +1,5 @@
MK= ../mk
include ${MK}/os.mk
DIR= ${LIBEXECDIR}/bin
BIN= on_ac_power
INSTALLAFTER = _installafter
ifeq (${OS},Linux)
SRCS+= rc-sstat.in
BIN+= rc-sstat
endif
_installafter:
ifeq (${OS},Linux)
${INSTALL} -d ${DESTDIR}${SBINDIR}
ln -s ${DIR}/rc-sstat ${DESTDIR}/${SBINDIR}/rc-sstat
endif
MK= ../mk
include ${MK}/scripts.mk

View File

@@ -1,140 +0,0 @@
#!@SHELL@
# Define variables
scandir="/run/openrc/s6-scan"
statfile=/dev/shm/s6-svstat.${USER}
color_red='\E[01;31m'
color_green='\E[32m'
color_yellow='\E[01;33m'
# Time Modules
uptimeModules() {
# Given a single integer argument representing seconds of uptime...
# convert uptime to a friendly human readable string: '2d 16h 58m 46s'
# define a variable to keep track of the longest length uptime string
uSec=${1:-0}
uDay=$(( $uSec / 86400 ))
uSec=$(( $uSec % 86400 ))
uHour=$(( $uSec / 3600 ))
uSec=$(( $uSec % 3600 ))
uMin=$(( $uSec / 60 ))
uSec=$(( $uSec % 60 ))
[ $uDay -ne 0 ] && pDay="${uDay}d " || pDay=""
[ $uHour -ne 0 ] && pHour="${uHour}h " || pHour=""
[ $uMin -ne 0 ] && pMin="${uMin}m " || pMin=""
[ $uSec -ne 0 ] && pSec="${uSec}s " || pSec=""
parsedUptime="$( echo ${pDay}${pHour}${pMin}${pSec} | sed 's#[ \t]*$##' )"
uCharCount=${#parsedUptime}
}
# Make sure we are running as root
if [ $(id -u) != 0 ]; then
printf "This command must be run as root\n"
exit 1
fi
# Make sure scandir exists
if [ ! -d $scandir ]; then
printf "%s\n" "$scandir does not exist"
exit 1
fi
# Make sure s6-svscan is running
if ! pgrep s6-svscan >/dev/null ; then
printf "s6-svscan is not running\n"
exit 1
fi
# If TERM is undefined (launching sstat through an ssh command) then make it vt100
if [ -z $TERM -o $TERM = "dumb" ]; then
export TERM=vt100
fi
# Gather list of candidate services s6-supervise may be supervising
# filter for folders and symlinks at /run/openrc/s6-scan/* ommiting output starting with '.'
services="$(find $scandir -maxdepth 1 -mindepth 1 \( -type d -or -type l \) | awk -F'/' '{ if ( $NF !~ "^\\." ) print $NF}')"
if [ -z "$services" ]; then
printf "s6 found no services configured for supervision\n"
exit 1
fi
# Gather status for each service from s6-svstat
# write to tmp file in memory for non I/O bound repeatative access
rm -f $statfile 2>/dev/null
for service in $services ; do
echo "$service $(s6-svstat ${scandir}/${service})" >> $statfile
done
# Define longest string from parsed uptime (default to 7 to match string length of 'Up Time')
timeStringLength=7
for uptime in $(awk '$2 == "up" {print $5}' $statfile | sort -run)
do
uptimeModules $uptime
[ ${uCharCount} -gt $timeStringLength ] && timeStringLength=$uCharCount
done
# Print the status header like so...
# Service Name State PID Up Time Start Time
#---------------------------- ----- ----- -------------- -------------------
printf "\n"
printf "%28s %5s %5s %${timeStringLength}s %19s\n" "Service Name" "State" "PID" "Up Time" "Start Time"
for dashes in 28 5 5 $timeStringLength 19 ; do
printf "%0.s-" $(seq 1 $dashes) ; echo -n ' '
done && printf "\n"
# sshd up (pid 26300) 80373 seconds
cat $statfile | \
while read line
do
set $line
service=$1
state=$2
pid=${4/)/}
time=$5
# call function to convert time in seconds and define additional variables
uptimeModules $time
if [ "$state" = up ]; then
if [ $time -lt 30 ]; then
# uptime < 30 seconds, color the whole line yellow
echo -en "$color_yellow"
# 1st 4 columns are printed with printf for space padding
printf "%28s %5s %5s %${timeStringLength}s" $service $state $pid "$parsedUptime"
# 4th column is output from date -d
echo -e " $(date -d "${time} seconds ago" "+%F %T")"
# reset terminal colors
tput sgr0
else
printf "%28s" $service
# uptime > 30 seconds, color just the "state" value green
echo -en "$color_green"
printf " %5s" $state
# reset terminal colors
tput sgr0
printf " %5s" $pid
printf " %${timeStringLength}s" "$parsedUptime"
echo -e " $(date -d "${time} seconds ago" "+%F %T")"
fi
else
printf "%28s" $service
echo -en "$color_red"
printf " %5s" $state
tput sgr0
echo ""
fi
done
# Cleanup
rm -f $statfile 2>/dev/null
printf "\n\n"
rc-status

View File

@@ -221,16 +221,16 @@ done
# Load our script
sourcex "$RC_SERVICE"
eval "printf '%s\n' $required_dirs" | while read _d; do
if [ ! -d "$_d" ]; then
for _d in $required_dirs; do
if [ ! -d $_d ]; then
eerror "$RC_SVCNAME: \`$_d' is not a directory"
exit 1
fi
done
unset _d
eval "printf '%s\n' $required_files" | while read _f; do
if [ ! -r "$_f" ]; then
for _f in $required_files; do
if [ ! -r $_f ]; then
eerror "$RC_SVCNAME: \`$_f' is not readable"
exit 1
fi

View File

@@ -54,9 +54,7 @@ cgroup_set_values()
val=
;;
*)
[ -n "$val" ] &&
val="$val $1" ||
val="$1"
val="$val $1"
;;
esac
shift
@@ -109,21 +107,12 @@ cgroup_set_limits()
local devices="${rc_cgroup_devices:-$RC_CGROUP_DEVICES}"
[ -n "$devices" ] && cgroup_set_values devices "$devices"
local hugetlb="${rc_cgroup_hugetlb:-$RC_CGROUP_HUGETLB}"
[ -n "$hugetlb" ] && cgroup_set_values hugetlb "$hugetlb"
local memory="${rc_cgroup_memory:-$RC_CGROUP_MEMORY}"
[ -n "$memory" ] && cgroup_set_values memory "$memory"
local net_cls="${rc_cgroup_net_cls:-$RC_CGROUP_NET_CLS}"
[ -n "$net_cls" ] && cgroup_set_values net_cls "$net_cls"
local net_prio="${rc_cgroup_net_prio:-$RC_CGROUP_NET_PRIO}"
[ -n "$net_prio" ] && cgroup_set_values net_prio "$net_prio"
local pids="${rc_cgroup_pids:-$RC_CGROUP_PIDS}"
[ -n "$pids" ] && cgroup_set_values pids "$pids"
return 0
}

View File

@@ -13,8 +13,6 @@ s6_start()
s6_service_link="${RC_SVCDIR}/s6-scan/${s6_service_path##*/}"
ebegin "Starting ${name:-$RC_SVCNAME}"
ln -sf "${s6_service_path}" "${s6_service_link}"
s6-svscanctl -na "${RC_SVCDIR}"/s6-scan
sleep 1.5
s6-svc -u "${s6_service_link}"
if [ -n "$s6_svwait_options_start" ]; then
s6-svwait ${s6_svwait_options_start} "${s6_service_link}"
@@ -33,7 +31,11 @@ s6_stop()
fi
s6_service_link="${RC_SVCDIR}/s6-scan/${s6_service_path##*/}"
ebegin "Stopping ${name:-$RC_SVCNAME}"
s6-svc -Dd -T ${s6_service_timeout_stop:-10000} "${s6_service_link}"
s6-svc -d "${s6_service_link}"
if [ -n "$s6_svwait_options_stop" ]; then
s6-svwait ${s6_svwait_options_stop} "${s6_service_link}"
fi
sleep 1.5
set -- $(s6-svstat "${s6_service_link}")
[ "$1" = "down" ]
eend $? "Failed to stop $RC_SVCNAME"

View File

@@ -4,13 +4,7 @@
ssd_start()
{
if [ -z "$command" ]; then
ewarn "The command variable is undefined."
ewarn "There is nothing for ${name:-$RC_SVCNAME} to start."
ewarn "If this is what you intend, please write a start function."
ewarn "This will become a failure in a future release."
return 0
fi
[ -n "$command" ] || return 0
local _background=
ebegin "Starting ${name:-$RC_SVCNAME}"

23
sh/tmpfiles.sh.in Normal file → Executable file
View File

@@ -53,18 +53,10 @@ relabel() {
done
}
splitpath() {
local path=$1
while [ -n "$path" ]; do
echo $path
path=${path%/*}
done
}
_restorecon() {
local path=$1
if [ -x /sbin/restorecon ]; then
dryrun_or_real restorecon -F $(splitpath "$path")
dryrun_or_real restorecon -F "$path"
fi
}
@@ -130,7 +122,6 @@ _d() {
if [ ! -d "$path" ]; then
dryrun_or_real mkdir -p "$path" 2>/dev/null
_restorecon "$path"
dryrun_or_real $CHECKPATH -dq -m "$mode" -o "$uid:$gid" "$path"
fi
}
@@ -146,18 +137,10 @@ _D() {
if [ $CREATE -gt 0 ]; then
dryrun_or_real mkdir -p "$path" 2>/dev/null
_restorecon "$path"
dryrun_or_real $CHECKPATH -Dq -m "$mode" -o "$uid:$gid" "$path"
fi
}
_v() {
# Create a subvolume if the path does not exist yet and the file system
# supports this (btrfs). Otherwise create a normal directory.
# TODO: Implement btrfs subvol creation.
_d "$@"
}
_L() {
# Create a symlink if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
@@ -353,7 +336,7 @@ for FILE in $tmpfiles_d ; do
# whine about invalid entries
case $cmd in
f|F|w|d|D|v|p|L|c|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
@@ -361,7 +344,7 @@ for FILE in $tmpfiles_d ; do
if [ "$mode" = '-' -o "$mode" = '' ]; then
case "$cmd" in
p|f|F) mode=0644 ;;
d|D|v) mode=0755 ;;
d|D) mode=0755 ;;
C|z|Z|x|r|R|L) ;;
esac
fi

View File

@@ -298,7 +298,7 @@ find_mounts(struct args *args)
int netdev;
RC_STRINGLIST *list;
if ((fp = fopen("/proc/self/mounts", "r")) == NULL)
if ((fp = fopen("/proc/mounts", "r")) == NULL)
eerrorx("getmntinfo: %s", strerror(errno));
list = rc_stringlist_new();
@@ -315,8 +315,6 @@ find_mounts(struct args *args)
if ((ent = getmntfile(to))) {
if (strstr(ent->mnt_opts, "_netdev"))
netdev = 0;
else
netdev = 1;
}
process_mount(list, args, from, to, fst, opts, netdev);
@@ -349,7 +347,7 @@ get_regex(const char *string)
#include "_usage.h"
#define extraopts "[mount1] [mount2] ..."
#define getoptstring "f:F:n:N:o:O:p:P:iste:E:" getoptstring_COMMON
#define getoptstring "f:F:n:N:o:O:p:P:ist" getoptstring_COMMON
static const struct option longopts[] = {
{ "fstype-regex", 1, NULL, 'f'},
{ "skip-fstype-regex", 1, NULL, 'F'},

View File

@@ -85,12 +85,8 @@ static bool sighup, in_background, deps, dry_run;
static pid_t service_pid;
static int signal_pipe[2] = { -1, -1 };
static RC_STRINGLIST *deptypes_b;
static RC_STRINGLIST *deptypes_n;
static RC_STRINGLIST *deptypes_nu;
static RC_STRINGLIST *deptypes_nua;
static RC_STRINGLIST *deptypes_m;
static RC_STRINGLIST *deptypes_mua;
static RC_STRINGLIST *types_b, *types_n, *types_nu, *types_nua, *types_m;
static RC_STRINGLIST *types_mua = NULL;
static void
handle_signal(int sig)
@@ -235,12 +231,12 @@ cleanup(void)
rc_plugin_unload();
#ifdef DEBUG_MEMORY
rc_stringlist_free(deptypes_b);
rc_stringlist_free(deptypes_n);
rc_stringlist_free(deptypes_nu);
rc_stringlist_free(deptypes_nua);
rc_stringlist_free(deptypes_m);
rc_stringlist_free(deptypes_mua);
rc_stringlist_free(types_b);
rc_stringlist_free(types_n);
rc_stringlist_free(types_nu);
rc_stringlist_free(types_nua);
rc_stringlist_free(types_m);
rc_stringlist_free(types_mua);
rc_deptree_free(deptree);
rc_stringlist_free(restart_services);
rc_stringlist_free(need_services);
@@ -522,30 +518,30 @@ get_started_services(void)
}
static void
setup_deptypes(void)
setup_types(void)
{
deptypes_b = rc_stringlist_new();
rc_stringlist_add(deptypes_b, "broken");
types_b = rc_stringlist_new();
rc_stringlist_add(types_b, "broken");
deptypes_n = rc_stringlist_new();
rc_stringlist_add(deptypes_n, "ineed");
types_n = rc_stringlist_new();
rc_stringlist_add(types_n, "ineed");
deptypes_nu = rc_stringlist_new();
rc_stringlist_add(deptypes_nu, "ineed");
rc_stringlist_add(deptypes_nu, "iuse");
types_nu = rc_stringlist_new();
rc_stringlist_add(types_nu, "ineed");
rc_stringlist_add(types_nu, "iuse");
deptypes_nua = rc_stringlist_new();
rc_stringlist_add(deptypes_nua, "ineed");
rc_stringlist_add(deptypes_nua, "iuse");
rc_stringlist_add(deptypes_nua, "iafter");
types_nua = rc_stringlist_new();
rc_stringlist_add(types_nua, "ineed");
rc_stringlist_add(types_nua, "iuse");
rc_stringlist_add(types_nua, "iafter");
deptypes_m = rc_stringlist_new();
rc_stringlist_add(deptypes_m, "needsme");
types_m = rc_stringlist_new();
rc_stringlist_add(types_m, "needsme");
deptypes_mua = rc_stringlist_new();
rc_stringlist_add(deptypes_mua, "needsme");
rc_stringlist_add(deptypes_mua, "usesme");
rc_stringlist_add(deptypes_mua, "beforeme");
types_mua = rc_stringlist_new();
rc_stringlist_add(types_mua, "needsme");
rc_stringlist_add(types_mua, "usesme");
rc_stringlist_add(types_mua, "beforeme");
}
static void
@@ -608,10 +604,10 @@ svc_start_deps(void)
if (!deptree && ((deptree = _rc_deptree_load(0, NULL)) == NULL))
eerrorx("failed to load deptree");
if (!deptypes_b)
setup_deptypes();
if (!types_b)
setup_types();
services = rc_deptree_depends(deptree, deptypes_b, applet_list,
services = rc_deptree_depends(deptree, types_b, applet_list,
runlevel, 0);
if (TAILQ_FIRST(services)) {
eerrorn("ERROR: %s needs service(s) ", applet);
@@ -629,9 +625,9 @@ svc_start_deps(void)
rc_stringlist_free(services);
services = NULL;
need_services = rc_deptree_depends(deptree, deptypes_n,
need_services = rc_deptree_depends(deptree, types_n,
applet_list, runlevel, depoptions);
use_services = rc_deptree_depends(deptree, deptypes_nu,
use_services = rc_deptree_depends(deptree, types_nu,
applet_list, runlevel, depoptions);
if (!rc_runlevel_starting()) {
@@ -659,7 +655,7 @@ svc_start_deps(void)
return;
/* Now wait for them to start */
services = rc_deptree_depends(deptree, deptypes_nua, applet_list,
services = rc_deptree_depends(deptree, types_nua, applet_list,
runlevel, depoptions);
/* We use tmplist to hold our scheduled by list */
tmplist = rc_stringlist_new();
@@ -864,10 +860,10 @@ svc_stop_deps(RC_SERVICE state)
if (!deptree && ((deptree = _rc_deptree_load(0, NULL)) == NULL))
eerrorx("failed to load deptree");
if (!deptypes_m)
setup_deptypes();
if (!types_m)
setup_types();
services = rc_deptree_depends(deptree, deptypes_m, applet_list,
services = rc_deptree_depends(deptree, types_m, applet_list,
runlevel, depoptions);
tmplist = rc_stringlist_new();
TAILQ_FOREACH_REVERSE(svc, services, rc_stringlist, entries) {
@@ -927,7 +923,7 @@ svc_stop_deps(RC_SERVICE state)
/* We now wait for other services that may use us and are
* stopping. This is important when a runlevel stops */
services = rc_deptree_depends(deptree, deptypes_mua, applet_list,
services = rc_deptree_depends(deptree, types_mua, applet_list,
runlevel, depoptions);
TAILQ_FOREACH(svc, services, entries) {
if (rc_service_state(svc->value) & RC_SERVICE_STOPPED)

View File

@@ -66,7 +66,6 @@ static const char *const env_whitelist[] = {
"LC_MONETARY", "LC_MESSAGES", "LC_PAPER", "LC_NAME", "LC_ADDRESS",
"LC_TELEPHONE", "LC_MEASUREMENT", "LC_IDENTIFICATION", "LC_ALL",
"IN_HOTPLUG", "IN_BACKGROUND", "RC_INTERFACE_KEEP_CONFIG",
"EERROR_QUIET", "EINFO_QUIET",
NULL
};