aboutsummaryrefslogtreecommitdiff
path: root/src/librc
AgeCommit message (Collapse)Author
2011-10-29Use pattern rules instead of suffix rulesWilliam Hubbs
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.
2011-07-13Fix rc_service_value_get() to return multiple lines as wellChristian Ruppert
As introduced in bug 372547 using service_get_value() in the init scripts or using rc_service_value_get() directly will only return one line. This patch fixes it by using the new rc_getfile() function, it returns even multiple lines. We're still using a char *, so the lines will be appended instead of added into new element. X-Gentoo-Bug: 372547 X-Gentoo-Bug-URL: http://bugs.gentoo.org/372547
2011-07-13Add a new function, bool rc_getfile(const char *, char **, size_t *)Mike Frysinger
<snip> Read the entire @file into the buffer and set @len to the size of the buffer when finished. For C strings, this will be strlen(buffer) + 1. Don't forget to free the buffer afterwards! </snip> We also fix bug 374899 by adding this new function. X-Gentoo-Bug: 374899 X-Gentoo-Bug-URL: http://bugs.gentoo.org/374899
2011-07-09Do not skip similar config optionsChristian Ruppert
OpenRC goes through the config and checks each option for duplicates. Lets say we're on "rc_logger" currently and its the last option in the config file and we previously defined rc_logger_path. It now goes through all previous config options and compares those against the current one "rc_logger" *but* it compares only the first N bytes, in this case strlen("rc_logger"). So it strips the _path from "rc_logger_path" which ends up into "rc_logger" and it compares that against the current one (also "rc_logger"), it would then simply override the previous definition. This patch fixes this behaviour to always compare the full option / variable names.
2011-06-29drop useless "All rights reserved" noticeMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-28Use RC_CONF instead of the hardcoded /etc/rc.confChristian Ruppert
2011-06-03clean up gitignore filesMike Frysinger
Rather than listing explicit object files, ignore all of them in the whole tree. Also ignore patch/gdb related files throughout. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-28cc.mk: move debug.mk out of end MakefilesMike Frysinger
Since we always want debug.mk whenever we include cc.mk, move the include out of the Makefiles and into cc.mk itself. This also fixes an include order bug in rc/Makefile where debug.mk is included before cc.mk and breaks the default CFLAGS setup in cc.mk. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-28librc: tweak style: foo () -> foo()Mike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-27fix rc_service_extra_commands return valueJames Le Cuirot
If there were no extra commands, rc_service_extra_commands returned a list containing a single empty string. This changes that to return an empty list, which is more consistent with what you would expect. X-Gentoo-Bug: 360013 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=360013
2011-04-27fix list returned by rc_service_extra_commandsWilliam Hubbs
This function was returning the setting of the variable $opts, which is not correct. $opts was used in baselayout-1, but it is replaced by $extra_commands and $extra_started_commands in openrc. This does not appear to break backward compatibility since this function does not appear to be used anywhere in the openrc code. Thanks to James Le Cuirot for the original patch. X-Gentoo-Bug: 360013 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=360013
2011-04-09typo fixWilliam Hubbs
X-Gentoo-Bug: 217999 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=217999
2011-02-04remove unnecessary shell callsWilliam Hubbs
The main makefile, init.d/Makefile and src/librc/Makefile all contain several shell calls which can be handled as make conditionals. This switches them to conditionals.
2011-01-31use immediate evaluation for shell callsWilliam Hubbs
This reworks the shell calls in the makefiles to use immediate evaluation and should improve parallel building. X-Gentoo-Bug: 289264 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=289264
2011-01-17librc: delete trailing newlinesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-17Document that rc_sys_v{1,2} should not be used outside of OpenRC.Robin H. Johnson
2011-01-17Bug #351570: Fix hidden functions visibility for rc_deptree_load_file.Robin H. Johnson
2011-01-17Bug #351570: Hidden function fixes: rc_conf_value.Robin H. Johnson
Refactor rc_conf_value into librc for use in library context. Also requires moving: - rc_conf internal static - Defines: PROFILE_ENV, SYS_WHITELIST, USR_WHITELIST, RC_PATH_PREFIX moved to rc.h with new RC_ prefix added. - Defines: RC_CONF, RC_CONF_OLD moved to rc.h. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-17Style fix: "char *foo" not "char* foo".Robin H. Johnson
2011-01-17Style fix: /* */ comments not // comments.Robin H. Johnson
2011-01-17Style fix: "while (" not "while(".Robin H. Johnson
2011-01-17Style fix: "if (" not "if(".Robin H. Johnson
2011-01-17Clean up all trailing whitespace in src/.Robin H. Johnson
2011-01-17Factor out new function rc_deptree_load_file to aid in debugging deptree ↵Robin H. Johnson
files from users. Loads from a given filename instead of the hardcoded RC_DEPTREE_CACHE define.
2011-01-05Make sure old rc_sys code never runs if the rc_sys variable exists.Robin H. Johnson
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-05Remove broken automatic LXC subsystem detection.Robin H. Johnson
Any system using cgroups was being detected as an LXC system. This was triggering on OpenVZ under RHEL6 as well as the "automated per tty task groups" as discussed on the LKML. All LXC users should now switch to the new rc_sys variable introduced in the previous patch. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-01-05Implement explicit selection of subsystem types.Robin H. Johnson
- Fixes bugs #347583, #349389, both of which were triggered by cgroups being detected as the LXC subsystem type. - Makes it much easier to select "prefix" type. - "rc -S" will now print a warning if you have not configured rc_sys in /etc/rc.conf - All other semantics of rc_sys are unchanged in this patch. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2010-01-08random spelling fixesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-14Only allow one service to be provided by default.Roy Marples
Fixes Gentoo #293139.
2009-11-04Add support for Linux Containers, fixes #202.Roy Marples
Patch by bug reporter.
2009-09-21Don't quote optsRoy Marples
2009-07-20Don't provide ourself, fixes #190Roy Marples
2009-07-01We should use -feature instead of nofeature.Roy Marples
This matches the ifconfig and Gentoo USE flag syntax and is hopefully easier to read. Fixes #178.
2009-06-21Use rc_getline instead of assuming a fixed kernel cmdline length.Roy Marples
This is now requires as COMMAND_LINE_SIZE isn't exposed by kernel headers anymore. Fixes #177.
2009-05-23Move non compiled libraries from /lib/rc to /libexec/rcRoy Marples
OpenRC version is now stored as plaintext in /libexec/rc/version Plugins (cursplash, splashutils) will have to be re-compiled to pickup the new directories. State data needs to be moved from /lib/rc/init.d to /libexec/rc/init.d as well.
2009-05-05Fix compile on NetBSDRoy Marples
2009-05-02Add runlevel stacking, #88Roy Marples
This implementation has the limitation that you cannot have a stacked runlevel and service of the same name in a runlevel.
2009-05-01Add (c) to CopyrightRoy Marples
2009-04-30Go back to gitRoy Marples
2009-04-28Don't start services when their need dependency is brokenRoy Marples
2009-04-25Use kill for the pid check as it's fast.Roy Marples
2009-04-24We should match the full variable name.Roy Marples
2009-04-23Improve style for KNFRoy Marples
2009-02-28Set errno when service does not exist better.Roy Marples
2009-02-12Fix return value for tests.Roy Marples
2009-01-29Clean up some compiler warnings.Roy Marples
2009-01-13rc_newer/older_than only report file if time_t is a pointer, so itRoy Marples
should take precedence in the argument list.
2009-01-12We now warn about clock skewsRoy Marples
rc-update -u will force a regen of the dep tree rc_newer_than and rc_olderthan now take another two parameters for newest/oldest file and mtime
2009-01-12CopyrightRoy Marples
2009-01-12Use snprintf instead of strlcpy to save on size if not available.Roy Marples