Commit Graph

574 Commits

Author SHA1 Message Date
William Hubbs
daf9397764 init.d: combine sysctl scripts
We had separate sysctl scripts for each operating system. However, there
is no need to do this since we can detect the operating system at
runtime with $RC_UNAME.
2016-07-19 16:21:48 -05:00
William Hubbs
314ae3dc78 modules: add support for FreeBSD
This is based on a patch submitted by
Joe Maloney <pkgdemonteam@gmail.com>.

This fixes #91.
2016-07-18 17:09:41 -05:00
William Hubbs
ac8ad169ae hwclock: always use --noadjfile if available
When we use the --utc or --localtime switch, also use --noadjfile if it
is available. This means hwclock will not use a drift file.

X-Gentoo-Bug: 584722
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=584722
2016-07-06 10:40:31 -05:00
William Hubbs
92e2f2c7cc killprocs: remove calls to sleep
X-Gentoo-Bug: 487084
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487084
2016-05-05 17:02:39 -05:00
William Hubbs
fd80b6fc67 localmount/netmount: clean up critical mount processing
Fix a typo and do not fail if a path in critical_mounts is not listed as
a critical mount does not get mounted.
2016-04-26 12:43:50 -05:00
William Hubbs
5d130cc45c localmount/netmount: allow mount points to be marked critical
In previous releases, we either treated no mount points as critical or
all of them.

Now both localmount and netmount support a critical_mounts setting. If
mount points listed in this setting fail to mount, localmount and
netmount will fail.
2016-04-25 12:04:34 -05:00
William Hubbs
1c3c2cf6d8 netmount: fix mounting on Linux
Before this commit, on Linux, we were always trying to mount file
systems marked with _netdev, even when the previous mount command
failed. Now, we do not run the second mount if the first fails.

X-Gentoo-Bug: 579876
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=579876
2016-04-15 11:30:44 -05:00
Mike Frysinger
2c1f6a16e1 sysfs: mount pstore when available 2016-02-09 15:39:43 -06:00
William Hubbs
e52b5f59c2 savecache: stop saving nettree
Netifrc is no longer part of OpenRC, so we shouldn't save its dep tree
as part of savecache.

This should have been removed when netifrc was split out. also, it
might be related to the following bug.

X-Gentoo-Bug: 563720
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=563720
2016-01-28 17:06:25 -06:00
William Hubbs
e277ae57ef fix tests
X-Gentoo-Bug: 572602
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=572602
2016-01-22 12:07:13 -06:00
William Hubbs
cd7883d25d localmount: Allow users to control whether errors are ignored
X-Gentoo-Bug: 572138
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=572138
2016-01-19 13:34:04 -06:00
joe9
9473ac514c allow the user to decide whether fsck aborts for errors
X-Gentoo-Bug: 564008
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=564008
2016-01-13 10:52:22 -06:00
William Hubbs
5d3e85bc31 add ignore patterns for init.d directory 2016-01-01 09:19:49 -06:00
William Hubbs
000503fad7 Convert OpenRC to a centralized copyright/license structure
In the past, OpenRC was a hybrid of a centralized and file-scope
license/copyright structure.

I followed the instructions from the Software Freedom Law Center [1] to
convert to a Centralized structure where possible, for easier future
maintenance.

[1] https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html
2015-12-21 12:16:06 -06:00
Rick Farina (Zero_Chaos)
c45313dfa9 netmount: use want dependency to start nfsclient
add in parsing of fstab to determine if nfsclient should be automatically
started so that netmount can mount nfs without adding nfsclient
to the default runlevel

This fixes #71.
2015-12-11 13:56:03 -06:00
William Hubbs
4cf6b0ecf7 consolefont: add after modules to dependencies
X-Gentoo-Bug: 559540
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=559540
2015-10-29 11:27:27 -05:00
William Hubbs
ee944553a9 bootmisc: optionally save the previous dmesg log
X-Gentoo-Bug: 561204
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=561204
2015-10-21 14:04:28 -05:00
William Hubbs
960881fcfe Add net-online service 2015-10-20 12:13:47 -05:00
William Hubbs
d26013494d mtab: typo fix 2015-10-14 17:48:32 -05:00
William Hubbs
b29b2fb3cb mtab: make /etc/mtab as a file configurable 2015-10-14 12:19:13 -05:00
William Hubbs
9d53d436ae sysfs: consolidate cgroup processing code in a single function 2015-10-13 15:07:53 -05:00
William Hubbs
d5116cc697 localmount: white space cleanup 2015-10-08 13:20:14 -05:00
Ian Stakenvicius
b86d170037 localmount: clean up handling of aufs branches
X-Gentoo-Bug: 560008
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=560008
2015-10-08 12:49:09 -05:00
William Hubbs
6fa0d6318b 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
2015-10-07 11:35:31 -05:00
William Hubbs
17ef205bc6 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
2015-10-06 13:31:43 -05:00
William Hubbs
bf0c0dd564 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
2015-10-05 11:22:08 -05:00
William Hubbs
1558ad2b9e 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
2015-10-05 11:08:11 -05:00
William Hubbs
dac5966ca4 Revert "local/netmount: remove uses of -O [no]_netdev"
This reverts commit 2a439c85bd.
There is another use case for -O involving iscsi, so we can't remove it.
2015-10-01 17:33:43 -05:00
William Hubbs
b047ea47e9 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.
2015-09-01 14:41:07 -05:00
William Hubbs
b652752339 Make localmount and netmount always succeed on non-linux 2015-08-21 12:21:31 -05:00
William Hubbs
2a439c85bd local/netmount: remove uses of -O [no]_netdev
This was causing an incompatibility with busybox, and we do not use it
in Gentoo.
2015-08-18 18:25:48 -05:00
William Hubbs
7341cd882f allow localmount and netmount to fail 2015-08-17 18:21:39 -05:00
Mike Frysinger
279f1e5d10 binfmt: fix indent on return 2015-08-10 18:50:10 -05:00
Doug Freed
c256a7aa80 savecache: clean up implementation
X-Gentoo-Bug: 557222
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=557222
2015-08-10 14:51:15 +00:00
Doug Freed
1736be3bc3 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.
2015-07-10 13:24:10 -04:00
Mike Gilbert
b209fe3859 bootmisc: Don't call dmesg in systemd-nspawn containers
This fixes #57.
2015-06-02 13:11:04 -05:00
William Hubbs
bb2d7becfd Add support for the s6 supervision suite 2015-05-11 18:36:49 -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
8b93492086 convert all references from runscript to openrc-run 2015-04-27 11:21:29 -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
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
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
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