summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* rc/checkpath: tmpfiles.d backend creation codeRobin H. Johnson2012-01-09
| | | | | | | | | | This commit provides the checkpath applet with feature parity to systemd's tmpfiles.c create_item function. Very similarly to the systemd function, it does NOT do any of the cleanup work in this function. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Do not exit immediately when a service has been stopped alreadyChristian Ruppert2011-12-31
| | | | | | | | | | | | | | | The old behaviour was to exit(EXIT_SUCCESS) in case the service has been stopped already, even if further commands has been passed to the init script (like zap, start). So using for example /etc/init.d/foo stop zap start would abort immediately after "stop" if the service has been stopped already. Though there may be cases were we need it to proceed with the remaining commands, zap and start in this case. This patch fixes the behaviour to continue and proceed with the remaining commands whenever necessary. X-Gentoo-Bug: 371845 X-Gentoo-Bug-URL: https://bugs.gentoo.org/371845
* Code style fixesChristian Ruppert2011-12-30
|
* Compare stricter in proc_getentChristian Ruppert2011-12-30
| | | | | | The new proc_getent compares stricter so that e.g. "ro" doesn't match root=/dev/sdaN anymore. So it has to be either "ro" or "ro=".
* Don't try to write the log during sysinitChristian Ruppert2011-12-29
| | | | | | | | During the sysinit and shutdown runlevels the logfile destination may be read-only. Skip the error messages in this case. X-Gentoo-Bug: 390645 X-Gentoo-Bug-URL: https://bugs.gentoo.org/390645
* Use RC_LEVEL_SHUTDOWNChristian Ruppert2011-12-29
|
* Remove useless rc_runlevel_get() callChristian Ruppert2011-12-29
| | | | The current runlevel will be passed to rc_logger_open() already.
* Don't print error when the logfile isn't writeable during shutdownChristian Ruppert2011-12-29
| | | | | | | | | | | The logfile or its basedir may be read-only during shutdown because the directory may be umounted or read-only remounted already. In this case we simply skip this error. This is related to a comment in bug 390645 but the initial bug is not fixed through this commit. X-Gentoo-Bug: 390645 X-Gentoo-Bug-URL: https://bugs.gentoo.org/390645
* fix compile errorWilliam Hubbs2011-12-11
| | | | | | | | | A variable used in the previous commit was actually removed in another commit; that is why I didn't catch it. Reported-by: Duncan < 1i5t5.duncan@cox.net> X-Gentoo-Bug: 394369 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=394369
* 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
* rc: usage: do not output non-printable short options in usageMike Frysinger2011-11-19
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* rc: usage: optimize help string alignment output a littleMike Frysinger2011-11-19
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* rc: fix style around case_RC_COMMON_GETOPTMike Frysinger2011-11-19
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* 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>
* Fix compile warningWilliam Hubbs2011-11-17
|
* add support for extra_stopped_commandsWilliam Hubbs2011-11-16
|
* mountinfo: Do not error out if realpath failsMike Frysinger2011-11-15
| | | | | | Reported-By: Dennis Schridde <devurandom@gmx.net> X-Gentoo-Bug: 383333 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=383333
* ssd: fix building when SYS_ioprio_set is missingMike Frysinger2011-11-09
| | | | | | Older glibc's might not provide this. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* 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.
* Use the real/actual path when looking for mountsChristian Ruppert2011-09-08
| | | | /proc/mounts contains real/actual paths so we should do the same in mountinfo.
* Remove unused variableChristian Ruppert2011-09-08
|
* Do not ignore return code for custom script functionsFlex2011-09-02
| | | | | X-Gentoo-Bug: 380317 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380317
* Start-stop-daemon: remove call to pam_authenticateDiego2011-09-01
|
* Libeinfo: do not suppress ewarn() messagesWilliam Hubbs2011-08-22
| | | | | | | | | | The ewarn() function was affected by the EINFO_QUIET environment variable which lead to warning messages being suppressed. Warnings should not be suppressed. Reported-by: Hanno Boeck <hanno@gentoo.org> X-Gentoo-Bug: 380073 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380073
* Improve processing of service directories and conf.d filesWilliam Hubbs2011-07-31
| | | | | | | | | | | symbolic links should not be followed in an attempt to work out the name of the service we are running. Also, @sysconfdir@/conf.d should be tried as a backup directory for configuration files. I would like to thank Robin Johnson for his input on this change. X-Gentoo-Bug: 350910 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=350910
* runscript: rename saveDir back to save to fix compile errorWilliam Hubbs2011-07-26
|
* rename save and save2 for clarityWilliam Hubbs2011-07-20
| | | | | The names saveDir and saveLnk seem to better define how these variables are used.
* 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.
* Rename rc_logger_path to rc_log_pathChristian Ruppert2011-07-06
|
* Improve loggingChristian Ruppert2011-07-05
| | | | | | | | | Add "e" (O_CLOEXEC) to all fopen() calls. Remove system() call and replace it by fopen() and friends. This also fixes bug 368933 X-Gentoo-Bug: 368933 X-Gentoo-Bug-URL: https://bugs.gentoo.org/368933
* Don't write into optarg, this also fixes a compiler warning.Christian Ruppert2011-07-05
|
* Add --startas/-a back to the optstringChristian Ruppert2011-06-30
| | | | | X-Gentoo-Bug: 373609 X-Gentoo-Bug-URL: https://bugs.gentoo.org/373609
* 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
|
* Only print the deprecation warning for --chuid/-c when using itJoe Harvell2011-06-27
| | | | | The deprecation warning has been printed when using the replecement functions as well, bug 373243.
* Warn if deprecated commandline options are used for start-stop-daemonChristian Ruppert2011-06-05
|
* 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>
* rc-update: sort "show" outputMike Frysinger2011-05-28
| | | | | | X-Gentoo-Bug: 367305 X-Gentoo-Bug-URL: http://bugs.gentoo.org/367305 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>
* rc: delete now unused local "i" variableMike Frysinger2011-05-28
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Fix dirname calls in runscriptChristian Ruppert2011-05-23
| | | | | | runscript will try to get the dir and basename of a file/link in case it contains at least one slash. This patch gives a temporary copy of the path to the dirname() function since dirname() can modify its argument.
* 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
* new implementation of applet optionWilliam Hubbs2011-02-16
| | | | | | | | | | This reworks the implementation of the --applet option so that it is processed in run_applets() and does not require two calls to the getopts_long() function. It is based on code by Robin Johnson and Chris Richards. X-Gentoo-Bug: 351712 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=351712
* make version option commonWilliam Hubbs2011-02-14
| | | | | This reworks the code for the version option so that it is part of the parser loop and is a common option to all applets.