summaryrefslogtreecommitdiff
path: root/sh
Commit message (Collapse)AuthorAge
* tmpfilesd: parse arguments with spacesAndrew Gregory2012-10-22
| | | | | | | | 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
* Add "retry" option for the stop() templateChristian Ruppert2011-12-31
|
* cgroups: remove references to the "openrc" cgroupWilliam Hubbs2011-12-19
| | | | Openrc will set up cgroups the way the kernel documentation recommends.
* Allow init scripts to be executed with a relative pathWilliam Hubbs2011-12-11
| | | | | | | | | | This was a regression that was caused by the fix for http://bugs.gentoo.org/show_bug.cgi?id=350910. I am reverting the commit that we said fixed that bug and re-opening it. Reported-By: Nathaniel <nathaniel@paust.us X-Gentoo-Bug: 392457 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=392457
* CGroups: create the openrc cgroup hierarchyWilliam Hubbs2011-11-20
| | | | | | Openrc will create a cgroup hierarchy called openrc which will have all services it starts and all subsystems attached to it. If you need other groups/hierarchies, please use libcgroup.
* make shell math operations style more succulentMike Frysinger2011-11-19
| | | | | | | | | | | Convert the style: var=$((${var} + 1)) to: : $(( var += 1 )) The latter is easier to read imo. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* CGroups: /sys/fs/cgroups should be a tmpfsWilliam Hubbs2011-11-18
| | | | | | | | | | | The kernel documentation states that a cgroup file system should not be mounted here, but a tmpfs. This also means that we should not create a group for each process, but we should allow the user to specify which group a process should be assigned to. The rc_cgroup variable will be used for this purpose. For more information, see /usr/src/linux/Documentation/cgroups/cgroups.txt.
* CGroups: fix group initializationWilliam Hubbs2011-11-18
| | | | | Make sure cpuset.cpus and cpuset.mems exist in the parent group before attempting to copy them to the new group.
* CGroups: finish initializing the CGroupWilliam Hubbs2011-11-17
| | | | | | When a CGroup is created, we need to copy cpuset.cpus and cpuset.mems from the new group's parent into the new group before we can attach any processes to it.
* Change RC_CGROUP to lower caseWilliam Hubbs2011-11-17
|
* Add CGroup supportPatrick Lauer2011-11-17
| | | | | X-Gentoo-Bug: 390297 X-Gentoo-Bug: http://bugs.gentoo.org/show_bug.cgi?id=390297
* add support for extra_stopped_commandsWilliam Hubbs2011-11-16
|
* Make sure we load external scripts before using eerrorWilliam Hubbs2011-11-02
| | | | | | Reported-by: Jochen Schlick <josch06@gmail.com> X-Gentoo-Bug: 388715 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=388715
* Use pattern rules instead of suffix rulesWilliam Hubbs2011-10-29
| | | | | | Rework the makefiles to use pattern rules instead of suffix rules. This is the preferred way to write implicit rules according to the gnu make manual.
* further clean up OS differences in makefilesMike Frysinger2011-10-20
| | | | | | No need for if() logic. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Make variable references in Makefiles consistentWilliam Hubbs2011-10-19
| | | | | | Some variable references were written as $(foo), but the majority were written as ${foo}. This commit changes all of the variable references to using braces.
* consolodate MakefilesWilliam Hubbs2011-10-18
| | | | | | | | | | The tree contained many operating system specific Makefiles which were being included in other Makefiles. This commit removes those and adds the code to the makefiles which included them using make's conditional processing. X-Gentoo-Bug: 387441 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=387441
* fix random typosMike Frysinger2011-10-16
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* runscript: simplify livecd-functions.sh loadingMike Frysinger2011-09-18
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Revert "Mount /run as early as possible"Christian Ruppert2011-09-12
| | | | | This reverts commit 5ed4d084d95608e40cb21888c18a8f381a44cd69. /run needs to be mounted after /proc.
* Use checkpath to create /run/lockWilliam Hubbs2011-09-07
|