aboutsummaryrefslogtreecommitdiff
path: root/sh
AgeCommit message (Collapse)Author
2013-05-05fix setfont detection in early startup on LinuxWilliam Hubbs
Most of the time, setfont is an external command (part of the kbd package), but it can also be a builtin if busybox is being used. This corrects the test in early startup to work for both cases. I would like to thank Steve L. for pointing this out.
2013-04-25add cgroup cleanup supportAlexander Vershilov
This adds the ability to kill all processes within a service's cgroup when that service is stopped or restarted.
2013-04-03migrate-to-run: fix test for successful migrationWilliam Hubbs
This script originally tested the file system type for the source location of the data we were migrating to determine if the migration was complete. Now we test the destination, and if the softlevel file is there the migration was successful. Reported-by: Piotr Karbowski <piotr.karbowski@gmail.com>
2013-03-12Make fuser command time outWilliam Hubbs
This avoids situations in which fuser hangs because of open files on remote file systems when the remote system goes down. I have also passed this bug on to the maintainers of psmisc since it should really be fixed in fuser. This is based on a patch submitted by evermind@tuxfamily.org Reported-by: evermind@tuxfamily.org X-Gentoo-Bug: 455458 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=455458
2013-03-11tmpfiles: add support for the new X line typeWilliam Hubbs
tmpfiles now has a new line type, X, which is similar to the x line type used by the cleanup function. This is not supported yet by OpenRc, because we do not have the cleanup function in tmpfiles.sh, so I have added a dummy procedure for it so we don't get complaints about this line type. Reported-by: mgorny@gentoo.org X-Gentoo-Bug: 460880 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=460880
2013-02-23include BINDIR and SBINDIR in the sanitized PATHAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-23Fix shebangs in services to point to the correct location of runscriptAndrew Gregory
SBINDIR and BINDIR can be set independently of PREFIX. This fixes broken shebangs in service files when SBINDIR is set to something other than PREFIX/sbin Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-19cgroups: major update to cgroups supportWilliam Hubbs
This reworks cgroups support so we have one variable in rc.conf for each controller instead of each setting. Also we add support for all of the possible cgroup controllers. I would like to thank Alexander Vershilov for his help with testing and reworking this code.
2013-02-19cgroups: fix shebang line in rc-cgroup.shWilliam Hubbs
2013-02-16make init.sh and init-early.sh honor SYSCONFDIRAndrew Gregory
Fixes hardcoded paths that break when built with SYSCONFDIR set to anything other than /etc/ Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-16consolefont: use setfont to save the current fontAndrew Gregory
Using setfont directly to save the font prevents breakage when a distro stores consolefonts in a location other than /usr/share/consolefonts such as Arch which stores them in /usr/share/kbd/consolefonts Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-16Add module for cgroup processingAlexander Vershilov
sh/rc-cgroup.sh.in: new script to handle cgroup processing sh/rc-cgroup.sh.in: do not use grep or cut (modification by William Hubbs) sh/runscript.sh.in: use the cgroup script
2013-01-16rc-functions.sh: add ceph to net fs listMike Frysinger
X-Gentoo-Bug: 452552 X-Gentoo-Bug-URL: https://bugs.gentoo.org/452552 Reported-by: Tomas Mozes <hydrapolic@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-01-15typo fixWilliam Hubbs
2013-01-15runscript: fix stopping changed service issuesWilliam Hubbs
If an init script or service was upgraded while it was running and the settings for the pid file, command and process name were changed, it would not be possible to stop the old service. Runscript now saves the values it used to start the service and re-uses them to stop the service. Reported-by: flameeyes@gentoo.org X-Gentoo-Bug: 434032 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=434032
2012-12-22udhcpc: fix resolv.conf setting for domainWilliam Hubbs
The value that was supposed to be in the domain setting was being added incorrectly to search. Reported-by: bug@mejor.pl X-Gentoo-Bug: 446862 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446862
2012-12-22Set a default size for /run on LinuxWilliam Hubbs
Reported-by: alpiturchi@gmail.com X-Gentoo-Bug: 447076 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=447076
2012-12-19init.sh.Linux: do not try to remove the /run/openrc symlinkWilliam Hubbs
In order to make migration from /lib*/rc/init.d to /run/openrc possible without rebooting, the migration script creates a symlink from /run/openrc to /lib*/rc/init.d. We were trying to remove it on the next reboot, but this is not possible since / is ro when /run is mounted. Reported-by: fturco@fastmail.fm X-Gentoo-Bug: 447678 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=447678
2012-12-07init-linux: Do not remove the $rc_libexecdir/init.d directoryWilliam Hubbs
Reported-by: toralf.foerster@gmx.de X-Gentoo-Bug: 446342 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446342
2012-12-06migrate-to-run: do not require a rebootWilliam Hubbs
The script that migrates the @libexecdir@/rc/init.d directory to /run/openrc should not require a reboot. Reported-by: chainsaw@gentoo.org
2012-12-03Do not add a prefix to the /run directoryWilliam Hubbs
This doesn't affect us on gentoo, but on archlinux, which has done the /usr merge, OpenRC was looking for /run under PREFIX. /run is always at the root level, so it shouldn't have prefix appended to it. Reported-by: udeved@openrc4arch.site40.net
2012-11-25migrate-to-run: Remove old RC_SVCDIR after unmounting tmpfsWilliam Hubbs
reporrrrted-by: netfab@gmail.com X-Gentoo-Bug: 443996 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=443996
2012-11-12Support cpu usage management for LinuxAlexander Vershilov
This commit was modified by William Hubbs as follows: - The paths in the cgroup fs were put into variables to ease maintenance. - Documentation was added to rc.conf.Linux. - The services were added originally to openrc/svcname cgroups under the controller cgroups, but this left an "openrc" cgroup which was unused. Now they are added to individual cgroups with the name openrc_${RC_SVCNAME}.
2012-11-07checkbashisms: Fix redirection order.Robin H. Johnson
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-07checkbashisms: clean up export statements.Robin H. Johnson
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-11-06tmpfiles: fix bashismWilliam Hubbs
reported-by: <pesa@gentoo.org>
2012-11-05tmpfilesd: Doing both create+remove at the same time is valid.Robin H. Johnson
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-10-21tmpfilesd: parse arguments with spacesAndrew Gregory
systemd allows the final arg in tmpfiles to contain spaces. Using the read() call to set the variables includes all trailing components in $arg so it doesn't get cut off. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-21tmpfiles: return success from _f/_F on empty $argAndrew Gregory
'[ -n "$arg" ] && _w' causes _f/_F to return the failure from the test when $arg is empty. Inverting the test causes the test and _f/_F to return success. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2012-10-21tmpfiles: do not process systemd.confWilliam Hubbs
This file contains definitions specific to systemd, so we should not process it. Reported-by: <andrew.gregory.8@gmail.com>
2012-10-17functions.sh: do not hard code path in e* wrapper functionsWilliam Hubbs
We should use the "command" shell builtin to execute a binary from within the wrapper with the same name. Hard coding the path to the binary makes our test suite fail.
2012-09-26tmpfiles.d init.d scriptsRobin H. Johnson
Now that the tmpfiles.d code is more tested, actually call it from init.d. It assumes that /run is already available when it runs. Please note it runs TWICE. - During sysinit, ideally just after /dev/shm is created, but before udev has started. After udev is also acceptable, but not ideal. - During boot, ideally just after localmount has completed. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-26sh/tmpfiles.sh: Improve dry-run mode.Robin H. Johnson
Dry-run with more detail is more useful this way. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-09-25Drop restart_pre/restart_postWilliam Hubbs
By design, restart is hard coded to run stop followed by start along with all of the pre/post functions associated with them. Restart doesn't need its own pre/post functions since it is possible to make any function in an init script behave differently for a restart command by testing against the RC_CMD environment variable.
2012-09-22Add restart_pre/restart_post support, also document RC_CMDChristian Ruppert
2012-08-16sh/tmpfiles: fix quoting for optional argumentsRobin H. Johnson
Some optional arguments were missing quotes in the tests, so produced spurious warnings. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-07-02fix handling of /run for vserverWilliam Hubbs
Mount can't be used in vservers, but /run is still needed. So we create the directory and clear it out instead of mounting a tmpfs in that situation. reported-by: <patrick@gentoo.org> X-Gentoo-Bug: 423739 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=423739
2012-05-17local is only allowed in functionsChristian Ruppert
2012-05-14move rc_svcdir to /run/openrc on Linux systemsWilliam Hubbs
If you are not using linux, this should not affect you. If you are using linux, from this point forward, openrc requires the /run directory to be a mounted tmpfs. If it is, you can run @LIBEXECDIR@/sh/migrate-to-run.sh as root to migrate your dependency tree and state information to the new location. If it is not, you must create the /run directory as root with permissions 755 then reboot your system. reported-by: Maxim Kammerer <mk@dee.su> X-Gentoo-Bug: 401059 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401059
2012-05-02clarify the message about /proc being already mountedWilliam Hubbs
This message was being taken by some users as an error, so I have removed the part about "skipping..." Hopefully this will make the message less alarming.
2012-04-26fix references to functions.shWilliam Hubbs
There were a couple of places where we were sourcing functions.sh in @SYSCONFDIR@/init.d. This is only a backward compatibility symlink, so it should not be used for openrc. The correct place to source this from is @LIBEXECDIR@/sh.
2012-04-26Change the working directory for depend onlyWilliam Hubbs
We already have a special case for depend processing, so we should change the working directory there only. This prevents us from forcing all init scripts to be run in the init directory.
2012-04-26Revert "Revert "Let runscript enter the service dir before expand globs""William Hubbs
This reverts commit f971c4c0b5e45500f1255f2e076f2c101d2f9281. After further discussion, this is a good first step toward a fix, so I am putting it back.
2012-04-26Revert "Let runscript enter the service dir before expand globs"William Hubbs
This reverts commit 9d0dce35c3e46b4515499f3f0f1c47645be0bc48. This is being reverted due to the fix still being under discussion.
2012-04-26Let runscript enter the service dir before expand globsChristian Ruppert
Enter the service directory, like gendeps.sh does, to make sure globs are expanded in it rather than in /. That makes sure that globbing like "need *" will end up in all files of the init.d directory. Signed-off-by: Christian Ruppert <idl0r@gentoo.org> Reported-by: Guenther Brunthaler <gb_about_gnu@gmx.net> X-Gentoo-Bug: 412677 X-Gentoo-Bug-URL: https://bugs.gentoo.org/412677
2012-03-12sh/tmpfiles: Upstream clarifications & quoting fixes.Robin H. Johnson
Upstream has clarified via IRC: - hardcoding /usr/lib/ is an explicit choice. It should NOT consider $libdir at all. - The z/Z relabel types should call restorecon, not chcon. - Whitespace is not allowed in tmpfiles.d/*.conf path entries, but is allowed in globs results. Fixed quoting of path arguments for this. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-03-12sh/tmpfiles: tmpfiles.d support.Robin H. Johnson
This is the baseline support for tmpfiles.d. Still missing: - SELinux relabel, pending upstream clarification - LIBDIR vs multilib systems, pending upstream clarification - Whitespace in paths? - Clean support not implemented - "x" exclude type not implemented X-Gentoo-Bug: 396003 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=396003 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-03-03Runscript: allow extra_commands to be run in chrootsWilliam Hubbs
The commands defined in the extra_commands variable do not depend on whether the service is stopped or started, so it is valid to run them in chroot environments. Also, add a note to the runscript man page about the commands in extra_commands being able to run whether or not the service is started. Reported-by: Robin Johnson <robbat2@gentoo.org> X-Gentoo-Bug: 406713 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=406713
2012-02-20update ignore patternsWilliam Hubbs
2012-02-09Fix early consolefont/termencoding usage vs rc_sysRobin H. Johnson
During early boot, the keywords were not being checked for consolefont/termencoding and they were running anyway when they should not be. X-Gentoo-Bug: 400549 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400549 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>