summaryrefslogtreecommitdiff
path: root/sh
Commit message (Collapse)AuthorAge
* cgroups: major update to cgroups supportWilliam Hubbs2013-02-19
| | | | | | | | | | 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.
* cgroups: fix shebang line in rc-cgroup.shWilliam Hubbs2013-02-19
|
* make init.sh and init-early.sh honor SYSCONFDIRAndrew Gregory2013-02-16
| | | | | | | 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>
* consolefont: use setfont to save the current fontAndrew Gregory2013-02-16
| | | | | | | | | 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>
* Add module for cgroup processingAlexander Vershilov2013-02-16
| | | | | | 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
* rc-functions.sh: add ceph to net fs listMike Frysinger2013-01-16
| | | | | | | 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>
* typo fixWilliam Hubbs2013-01-15
|
* runscript: fix stopping changed service issuesWilliam Hubbs2013-01-15
| | | | | | | | | | | | | 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
* udhcpc: fix resolv.conf setting for domainWilliam Hubbs2012-12-22
| | | | | | | | | 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
* Set a default size for /run on LinuxWilliam Hubbs2012-12-22
| | | | | | Reported-by: alpiturchi@gmail.com X-Gentoo-Bug: 447076 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=447076
* init.sh.Linux: do not try to remove the /run/openrc symlinkWilliam Hubbs2012-12-19
| | | | | | | | | | | 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
* init-linux: Do not remove the $rc_libexecdir/init.d directoryWilliam Hubbs2012-12-07
| | | | | | Reported-by: toralf.foerster@gmx.de X-Gentoo-Bug: 446342 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=446342
* migrate-to-run: do not require a rebootWilliam Hubbs2012-12-06
| | | | | | | The script that migrates the @libexecdir@/rc/init.d directory to /run/openrc should not require a reboot. Reported-by: chainsaw@gentoo.org
* Do not add a prefix to the /run directoryWilliam Hubbs2012-12-03
| | | | | | | | 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
* migrate-to-run: Remove old RC_SVCDIR after unmounting tmpfsWilliam Hubbs2012-11-25
| | | | | | reporrrrted-by: netfab@gmail.com X-Gentoo-Bug: 443996 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=443996
* Support cpu usage management for LinuxAlexander Vershilov2012-11-12
| | | | | | | | | | | 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}.
* checkbashisms: Fix redirection order.Robin H. Johnson2012-11-07
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* checkbashisms: clean up export statements.Robin H. Johnson2012-11-07
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* tmpfiles: fix bashismWilliam Hubbs2012-11-06
| | | | reported-by: <pesa@gentoo.org>
* tmpfilesd: Doing both create+remove at the same time is valid.Robin H. Johnson2012-11-05
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* tmpfilesd: parse arguments with spacesAndrew Gregory2012-10-21
| | | | | | | | 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>
* tmpfiles: return success from _f/_F on empty $argAndrew Gregory2012-10-21
| | | | | | | '[ -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>
* tmpfiles: do not process systemd.confWilliam Hubbs2012-10-21
| | | | | | | This file contains definitions specific to systemd, so we should not process it. Reported-by: <andrew.gregory.8@gmail.com>
* functions.sh: do not hard code path in e* wrapper functionsWilliam Hubbs2012-10-17
| | | | | | 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.
* tmpfiles.d init.d scriptsRobin H. Johnson2012-09-26
| | | | | | | | | | | | 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>
* sh/tmpfiles.sh: Improve dry-run mode.Robin H. Johnson2012-09-26
| | | | | | Dry-run with more detail is more useful this way. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Drop restart_pre/restart_postWilliam Hubbs2012-09-25
| | | | | | | | 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.
* Add restart_pre/restart_post support, also document RC_CMDChristian Ruppert2012-09-22
|
* sh/tmpfiles: fix quoting for optional argumentsRobin H. Johnson2012-08-16
| | | | | | | Some optional arguments were missing quotes in the tests, so produced spurious warnings. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* fix handling of /run for vserverWilliam Hubbs2012-07-02
| | | | | | | | | | 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
* local is only allowed in functionsChristian Ruppert2012-05-17
|
* move rc_svcdir to /run/openrc on Linux systemsWilliam Hubbs2012-05-14
| | | | | | | | | | | | | | | 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
* clarify the message about /proc being already mountedWilliam Hubbs2012-05-02
| | | | | | 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.
* fix references to functions.shWilliam Hubbs2012-04-26
| | | | | | | 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.
* Change the working directory for depend onlyWilliam Hubbs2012-04-26
| | | | | | 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.
* Revert "Revert "Let runscript enter the service dir before expand globs""William Hubbs2012-04-26
| | | | | | This reverts commit f971c4c0b5e45500f1255f2e076f2c101d2f9281. After further discussion, this is a good first step toward a fix, so I am putting it back.
* Revert "Let runscript enter the service dir before expand globs"William Hubbs2012-04-26
| | | | | This reverts commit 9d0dce35c3e46b4515499f3f0f1c47645be0bc48. This is being reverted due to the fix still being under discussion.
* Let runscript enter the service dir before expand globsChristian Ruppert2012-04-26
| | | | | | | | | | | | 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
* sh/tmpfiles: Upstream clarifications & quoting fixes.Robin H. Johnson2012-03-12
| | | | | | | | | | | | 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>
* sh/tmpfiles: tmpfiles.d support.Robin H. Johnson2012-03-12
| | | | | | | | | | | | | | | 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>
* Runscript: allow extra_commands to be run in chrootsWilliam Hubbs2012-03-03
| | | | | | | | | | | | | 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
* update ignore patternsWilliam Hubbs2012-02-20
|
* Fix early consolefont/termencoding usage vs rc_sysRobin H. Johnson2012-02-09
| | | | | | | | | | 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>
* cgroups: only create the cgroup when the service is being startedWilliam Hubbs2012-01-29
|
* Use "checkpath -W" instead of dir_writable()Christian Ruppert2012-01-28
|
* Check if /sys/fs/cgroup/openrc is writableChristian Ruppert2012-01-28
|
* cgroups: add all services to the openrc cgroupWilliam Hubbs2012-01-26
| | | | | This is a modified version of a patch originally submitted by Patrick Lauer <patrick@gentoo.org>.
* Make checks for writable directory posix compliantWilliam Hubbs2012-01-22
| | | | | | Reported-by: Maxim Kammerer <mk@de.su> X-Gentoo-Bug: 398931 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=398931
* drop the extra --pidfile optionWilliam Hubbs2012-01-17
|
* Use the "--make-pidfile" when command_background is usedChristian Ruppert2012-01-17
| | | | | | | | | | The start-stop-daemon "--make-pidfile" option is now used by default when using command_background, this requires a pidfile to be specified. Document command_background option. Reported-by: Giampaolo Tomassoni <giampaolo@tomassoni.biz> X-Gentoo-Bug: 399165 X-Gentoo-Bug-URL: https://bugs.gentoo.org/399165