summaryrefslogtreecommitdiff
path: root/src/librc
Commit message (Collapse)AuthorAge
* librc: fix off-by-one bugNatanael Copa2013-10-04
| | | | | | | We need allocate space for both the added leading '-' and the trailing '\0'. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
* Fix stacked runlevel supportAlexander V Vershilov2013-09-20
| | | | | | | | | | | | | | | Patch was provided by Max Hacking <max.gentoo.bugzilla@hacking.co.uk> and slightly fixed by Alexander Vershilov <qnikst@gentoo.org> and William Hubbs <williamh@gentoo.org>. Fixes: 1). Rebase to newest OpenRC version. 2). Remove code style fixes. Port to currect code style. 3). Fix rc_runlevel_stack instead of introducing new function. 4). Make get_runlevel_chain a private function. X-Gentoo-Bug: 467368 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=467368
* Add support for DragonFly BSDGary2013-07-25
|
* Fix autodetection of lxcNatanael Copa2013-04-09
| | | | | | | | | The /proc/1/environ contains various \0 terminated strings. The current code will only work when the search string is in the first of those. To fix this we look for strings in entire buffer. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
* make BINDIR and SBINDIR available to input filesAndrew Gregory2013-02-23
| | | | | | | | | | | BINDIR and SBINDIR can be set independently of PREFIX and may not be set to PREFIX/bin as scripts currently assume. Note from William Hubbs: This adds @BINDIR@ and @SBINDIR@ macros to the sed commands run to convert *.in files to the executable form. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* 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
* set the RC_UNAME environment variable when updating dependenciesWilliam Hubbs2012-10-04
| | | | | | | This is needed because the network script uses this variable in the depend() function but it wasn't exported when this was run. Reported-by: <aaly90@gmail.com>
* fix RC_SVCDIR on prefix systemsWilliam Hubbs2012-09-20
| | | | | | | | On prefix systems, RC_SVCDIR was being defined based on the host operating system. This is not correct because there will not be a /run directory in a prefix. This commit moves RC_SVCDIR on prefix systems to the same location as on non-Linux systems.
* add RC_PREFIX environment variableWilliam Hubbs2012-09-09
| | | | | This will be used by init scripts which want to be able to run in a Gentoo Prefix installation. RC_PREFIX will contain the prefix offset.
* Bring Back prefix supportWilliam Hubbs2012-07-26
| | | | | We now have a team member who is interested in OpenRC on prefix, so I am bringing it back to the main tree.
* 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
* Reduce overhead by leaving rc_deptree_update_needed() as soon as possibleChristian Ruppert2012-04-26
| | | | | | There's no need to check any further if we're returning true anyway. Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
* librc: Do not output error messages from within the library.William Hubbs2012-03-26
| | | | | | | | | This fixes a compile issue. Also, it is cleaner to have the client output error messages as opposed to having the library do this. Reported-by: Ewoud Kohl van Wijngaarden <gentoo@kohlvanwijngaarden.nl> X-Gentoo-Bug: 409743 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=409743
* librc: make rc_proc_getent available for all operating systemsWilliam Hubbs2012-02-25
| | | | | | This looks up an option on the kernel command line. For now, itworks on linux and returns NULL on the bsds, but we are definitely open to patches for that side.
* Fix rc_proc_getent() undeclared on BSDChristian Ruppert2012-02-25
| | | | | | X-Gentoo-Bug: 405713 X-Gentoo-Bug-URL: https://bugs.gentoo.org/405713 Reported-by: Dmitri Bogomolov <4glitch@gmail.com>
* Remove prefix supportopenrc-0.9.9William Hubbs2012-02-21
| | | | | I spoke with the prefix team sometime back and was told that they do not have an interest in using OpenRC on prefix systems.
* Fix some more warningsChristian Ruppert2012-02-12
|
* Complain about loading /etc/conf.d/rcWilliam Hubbs2012-01-30
| | | | | | | | Openrc was quietly loading this file if it existed and this was causing some issues, so now openrc loads the file and complains about it. Hopefully the warning message will convince everyone to remove this file and migrate the settings to @SYSCONFDIR@/rc.conf where they belong.
* WhitespaceChristian Ruppert2012-01-26
|
* Override rc.conf options onlyChristian Ruppert2012-01-24
|
* small style fixWilliam Hubbs2012-01-20
|
* style fixesWilliam Hubbs2012-01-16
|
* Allow overriding of rc.conf options via kernel cmdlineChristian Ruppert2012-01-15
| | | | | | | | This adds a new function that allows us to override some specific rc.conf options via the kernel cmdline aka /proc/cmdline. This makes esp. sense in cases where a rc_parallel enabled system has boot issues. Simply disable rc_parallel by appending rc_parallel=no to your kernel cmdline.
* Rename proc_getent to rc_proc_getent and make it globalChristian Ruppert2012-01-15
|
* add support for extra_stopped_commandsWilliam Hubbs2011-11-16
|
* add auto detection for lxcWilliam Hubbs2011-11-07
| | | | | | Reported-by: Francesco Riosa <francesco+gentoo_bugzilla@pnpitalia.it> X-Gentoo-Bug: 384151 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=384151
* 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.
* Fix rc_service_value_get() to return multiple lines as wellChristian Ruppert2011-07-13
| | | | | | | | | | | 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
* Add a new function, bool rc_getfile(const char *, char **, size_t *)Mike Frysinger2011-07-13
| | | | | | | | | | | | | | <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
* Do not skip similar config optionsChristian Ruppert2011-07-09
| | | | | | | | | | | | | | | 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.
* drop useless "All rights reserved" noticeMike Frysinger2011-06-29
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Use RC_CONF instead of the hardcoded /etc/rc.confChristian Ruppert2011-06-28
|
* clean up gitignore filesMike Frysinger2011-06-03
| | | | | | | | | 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>
* cc.mk: move debug.mk out of end MakefilesMike Frysinger2011-05-28
| | | | | | | | | 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>
* librc: tweak style: foo () -> foo()Mike Frysinger2011-05-28
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix rc_service_extra_commands return valueJames Le Cuirot2011-04-27
| | | | | | | | | 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
* fix list returned by rc_service_extra_commandsWilliam Hubbs2011-04-27
| | | | | | | | | | | | | | 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
* typo fixWilliam Hubbs2011-04-09
| | | | | X-Gentoo-Bug: 217999 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=217999
* remove unnecessary shell callsWilliam Hubbs2011-02-04
| | | | | | 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.
* use immediate evaluation for shell callsWilliam Hubbs2011-01-31
| | | | | | | | 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
* librc: delete trailing newlinesMike Frysinger2011-01-17
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Document that rc_sys_v{1,2} should not be used outside of OpenRC.Robin H. Johnson2011-01-17
|
* Bug #351570: Fix hidden functions visibility for rc_deptree_load_file.Robin H. Johnson2011-01-17
|
* Bug #351570: Hidden function fixes: rc_conf_value.Robin H. Johnson2011-01-17
| | | | | | | | | | | 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>
* Style fix: "char *foo" not "char* foo".Robin H. Johnson2011-01-17
|
* Style fix: /* */ comments not // comments.Robin H. Johnson2011-01-17
|
* Style fix: "while (" not "while(".Robin H. Johnson2011-01-17
|
* Style fix: "if (" not "if(".Robin H. Johnson2011-01-17
|
* Clean up all trailing whitespace in src/.Robin H. Johnson2011-01-17
|
* Factor out new function rc_deptree_load_file to aid in debugging deptree ↵Robin H. Johnson2011-01-17
| | | | files from users. Loads from a given filename instead of the hardcoded RC_DEPTREE_CACHE define.