aboutsummaryrefslogtreecommitdiff
path: root/init.d
AgeCommit message (Collapse)Author
2022-09-07Avoid warning on grep 3.8 in hwclockStefan Linke
Starting with grep version 3.8, the hwclock init script logs warnings about stray backslashes: > hwclock | * Setting system clock using the hardware clock [UTC] ... > hwclock |grep: warning: stray \ before - > hwclock |grep: warning: stray \ before - This is caused by the check for existence of the `--noadjfile` argument in function `get_noadjfile()`. Replacing the affected logic with an explicit argument denoting the pattern as such resolves the issue. Fixes #548
2022-09-04init.d/root: don't remount swapSören Tempel
While refactoring the changes proposed in #533 a minor error was introduced were the root service will now attempt to remount swap. This will fail with the error message `mountinfo: 'swap' is not a mountpoint`. This fixes #546
2022-09-02init.d/root: also remount / with options provided in /etc/fstabSören Tempel
Without this commit, the root OpenRC service remounts all mounted filesystems (except /) with the options defined in /etc/fstab via fstabinfo. It is presently unclear to me why / was excluded from remounting in 497ff7ee41168d863971efb52e2ca6b42f765832 and unfortunately neither the commit nor the associated Bugzilla issue [1] provides further information on this. At Alpine, our initramfs does currently not remount / with all options defined in /etc/fstab [2]. As part of the discussion on the Alpine side of things we wondered why OpenRC does not remount / since this would be the easier solution for us. For this reason, this commit changes the behavior of the OpenRC root services accordingly to also remount / with the options defined in /etc/fstab. [1]: https://bugs.gentoo.org/401573 [2]: https://gitlab.alpinelinux.org/alpine/mkinitfs/-/merge_requests/103 This fixes #533.
2022-06-28remove trailing spaceWilliam Hubbs
2022-06-27modules.in: always return 0, make loading more verboseWilliam Hubbs
2022-06-08clean up hostname service scriptWilliam Hubbs
- use _ throw-away variable to get rid of a shellcheck warning - remove tests for /etc/hostname and just try to read it - drop reference to bash HOSTNAME variable. - make source of host name more accurate X-Gentoo-Bug: 850577 X-Gentoo-Bug-URL: https://bugs.gentoo.org/850577
2022-04-30multiple spelling and typo fixesJosh Soref
This fixes #516.
2022-04-21seedrng: use posix positional params to avoid space splittingJason A. Donenfeld
The value of ${seed_dir} may have spaces in it, making the current argument string building method unsafe. Instead, use positional parameters to pass these arguments safely.
2022-04-20seedrng: incorporate various improvementsJason A. Donenfeld
There have been a number of subtle improvements and cleanups to seedrng, including using openat and locking the directory fd instead of a separate lock file. Also various stylistic cleanups. This fixes #519. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-04-06migrate fully to meson build systemWilliam Hubbs
- drop old build system - move shared include and source files to common directory - drop "rc-" prefix from shared include and source files - move executable-specific code to individual directories under src - adjust top-level .gitignore file for new build system This closes #489.
2022-03-31init.d/seedrng.in: fix rc_yesno typoSam James
This fixes #512.
2022-03-30init.d/urandom.in: drop the use of the psz variableWilliam Hubbs
Since this service is now *bsd only, we don't need to worry about reading this value from /proc/sys.
2022-03-30add seedrng service for LinuxWilliam Hubbs
This moves urandom to *bsd only and adds seedrng as a separate service for Linux. This fixes #510
2022-03-26Use seedrng for seeding the random number generatorJason A. Donenfeld
The RNG can't actually be seeded from a shell script, due to the reliance on ioctls. For this reason, the seedrng project provides a basic script meant to be copy and pasted into projects like OpenRC and tweaked as needed: https://git.zx2c4.com/seedrng/about/ This commit imports it into OpenRC and wires up /etc/init.d/urandom to call it. It shouldn't be called by other things on the system, so it lives in rc_sbindir. Closes #506. Closes #507. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-01-30init.d/devfs: default mount /dev noexecomnivagant
2022-01-30init.d/bootmisc.in: prevent error due to nonexistant fileDermot Bradley
During boot if the "previous_dmesg" setting is enabled in /etc/conf.d/bootmisc then during the 1st boot of a machine the bootmisc init.d script will attempt to move a nonexistant dmesg file, so generating an error on the console. Modify the script to only move an existing file.
2021-12-30fix filename in FreeBSD meson buildWilliam Hubbs
2021-12-20 supervise runsvdir daemonAaditya Bagga
This fixes #254.
2021-12-20use HEAD in git URIs to point to the default branchMike Frysinger
This makes the URIs shorter and dynamic: whatever the default branch the repo uses will be used.
2021-12-12net-online: add missing sleep 1 in ping loopiucoen
Currently the ping loop instantly times out because timeout is decremented by 1 without actually going to sleep. This fixes #480.
2021-12-07killprocs: add kill_delay settingWilliam Hubbs
This allows containers using OpenRC based services to be configured to allow open tcp connections to be closed before they are shut down. This fixes #476.
2021-10-14init.d/s6-svscan.in: make sure $command existsKerin Millar
While the s6-svscan runscript belongs to OpenRC, the user is required to install s6 before it can actually be used, potentially leading to confusion. Check for the existence of $command in start_pre and, if it does not exist, bail out with an error that makes this observation. X-Gentoo-Bug: 816978 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=816978
2021-09-15fix agetty can be start directlyhosxy
This fixes #320.
2021-09-15hide error when migrating /var/run to /runNatanael Copa
The script tries to copy non-existing files. We simply hide the error http://bugs.alpinelinux.org/issues/3160 This fixes #451.
2021-09-14force root to be rw before localmountNatanael Copa
The original service that pulled in root remount was mtab which is not part of OpenRC. This fixes #449.
2021-09-04add meson build filesWilliam Hubbs
Closes #116. Closes #171. Closes #172. Closes #175.
2021-05-12init.d/modules.in: Avoid loading modules twice in Linux with dash shellLars Wendler
Since commit 6b475ab26992f1dd8815700828df46abc4b71d27, openrc tries to load modules twice which have been defined in /etc/conf.d/modules via modules= variable when /bin/sh points to dash shell. The reason is that when the "modules-load" service was merged into "modules" service, the "modules" variable name got used in both, load_modules() function and in Linux_modules() function which both get called when modules service is started. Although "modules" variable is marked as local in load_modules(), dash simply ignores this. Avoid the issue by renaming "modules" variable to "_modules" in load_modules() function. This fixes #419.
2021-03-19numlock: Don't disable numlock on shutdownThomas Deutschmann
When dealing with remote consoles, a shutdown could disable host's numlock which is not desired. This fixes #413.
2021-02-23fix unified cgroups v2 setupWilliam Hubbs
The cgroups v2 setup required the rc_cgroups_controllers variable to be set to the list of controllers to enable regardless of whether the mode was hybrid or unified. This makes sense for hybrid mode since the controllers can't be in both the cgroups v1 and v2 hierarchies, but for unified mode we should enable all controllers that are configured in the kernel.
2021-01-28allow devfs to run on lxcWilliam Hubbs
X-Gentoo-Bug: 761918 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=761918 Closes #272.
2020-12-22net-online: fix process of symlinks in sysfsGaël PORTAY
The test `[ -h "${ifname}" ] && continue` skips the symlinks while it is the opposite that is the expected: ignoring files that are not symlinks. Fixes commit f42ec82f21f3760b829507344ad0ae761e1d59aa. This fixes #391.
2020-11-27Remove warning when osclock init.d script runsDermot Bradley
Currently when osclock is enabled as a init.d service the following messages appear during boot when osclock starts: * The command variable is undefined. * There is nothing for osclock to start. * If this is what you intend, please write a start function. * This will become a failure in a future release. osclock is activated whenever a machine's system clock is automatically configured from a RTC by the kernel and the osclock's only purpose is to satisfy the "clock" dependency defined by other init.d services. Adding a stub start() function prevents OpenRC from showing warnings but continues to ensure that the osclock service still does not actually do anything. This fixes #377.
2020-11-27bootmisc: allow sysvinit compatibility during shutdownWilliam Hubbs
Use "halt -w" to write the halt record if it exists. Otherwise use openrc-shutdown. This fixes #336.
2019-07-29init.d/agetty: provide the getty virtual serviceWilliam Hubbs
2018-12-06init.d/agetty: set default respawn period to 60 secondsWilliam Hubbs
Without a respawn period setting, the supervisor will give up on respawning agetty after it is respawned respawn_max times. For most daemons giving up like this is reasonable, but not for agettys. Agettys should always be respawned unless they are respawning too fafst,. If an agetty is respawning faster than 10 times in 60 seconds, this seems to be too fast.
2018-11-07Create save-keymaps and save-ktermencoding servicesWilliam Hubbs
These services represent the parts of the keymaps and termencoding services which saved the settings back to the root file system so they can be loaded very early in the boot process. These are needed to allow keymaps and termencoding to run earlier in the boot sequence. X-Gentoo-Bug: 446018 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446018
2018-10-23modules: Add --first-time switch to modprobe commandsWilliam Hubbs
On Linux, kernel modules should be loaded once during boot, either in an initramfs or by this service. This does not change anything other than printing out messages if a module is loaded more than once. X-Gentoo-Bug: 659530 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=659530
2018-10-13misc: whitespace fixesAustin English
2018-08-14Stop mounting efivarfs read-onlyWilliam Hubbs
We do not need to do this any longer since all supported linux kernels make efivarfs immutable and the tools that manipulate it are aware of this feature. This fixes https://github.com/openrc/openrc/issues/238.
2018-06-29modules: remove the ability to rename modules on the flyWilliam Hubbs
Kmod doesn't support the -o switch, so if you have been using this your module loads have been failing.
2018-05-11Revert "savecache: stop saving the dependency tree"William Hubbs
It is safe to save the deptree, but we also need to regenerate it at boot time.
2018-05-07Remove localmount from dependencies for linux-only servicesWilliam Hubbs
This removes localmount from the dependencies of the consolefont, keymaps, numlock and procfs services. These services are Linux only and the default modern linux system has / and /usr on the same file system. This also fixes the following issue. X-Gentoo-Bug: 651998 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=651998
2018-03-16init.d/modules: add code from modules-load serviceWilliam Hubbs
There is no reason for these to be separate services. I did add a provide so that we don't break backward compatibility.
2018-03-16net-online: always start after netWilliam Hubbs
X-Gentoo-Bug: 650600 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=650600
2018-03-14agetty.in: allow status to be displayedWilliam Hubbs
2018-03-05init.d: swap should always be started after rootScall
Otherwise if a swap file is being used, and swap is started before root, swapon may fail because of a read-only filesystem.
2018-02-27cgroups: fix indentationWilliam Hubbs
2018-02-26cgroups: add rc_cgroup_memory_use_hierarchy setting for cgroups v1William Hubbs
2018-02-23improve cgroup configuration checksWilliam Hubbs
make the base/controller functions return successfully if cgroups v1/v2 are not configured in the kernel
2018-01-05net-online: only process symbolic links in /sys/class/net3PO
The /sys/class/net directory contains files which are not symlinks if the system has bonded devices [1]. We should ignore these files. This fixes #196. [1] https://elkano.org/blog/manage-interface-bondings-sysfs-interface/