aboutsummaryrefslogtreecommitdiff
path: root/src/rc
AgeCommit message (Collapse)Author
2013-07-25Add support for DragonFly BSDGary
2013-07-19rc-status: fix typoAlexander V Vershilov
X-Gentoo-Bug: 477318 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=477318
2013-07-16rc-status: fix -a to show all servicesAlexander V Vershilov
We need to unset rc_svcname so that all of the services are added to the list to display. X-Gentoo-Bug: 409787 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=409787
2013-05-02Add service appletWilliam Hubbs
The service applet is equivalent to rc-service. This was added so that we will be more compatible with Debian and Fedora. Reported-by: cardoe@gentoo.org X-Gentoo-Bug: 468168 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=468168
2013-05-01fix the build for non-selinux systemsWilliam Hubbs
The symlinks should be created only if MKSELINUX=yes, not if it just has a value.
2013-04-28rc: allow switching runlevels without stopping servicesWilliam Hubbs
OpenRC, by default, stops all services that are not listed in a runlevel when rc is used to switch runlevels. This adds a -n/--no-stop command line option to rc which tells it to skip stopping the services which are not in the runlevel. Reported-by: gentoo@thoth.purplefrog.com X-Gentoo-Bug: 372585 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=372585
2013-02-25rc-service: add usage messageAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-25rc-status: improve usage message accuracy and consistencyAndrew Gregory
This makes it more clear that many of the options are used as an alternative to a runlevel. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-25rc-update: improve usage message accuracy and consistencyAndrew Gregory
The old message did not indicate that the runlevel argument was optional for add and del or that it could be used with show. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-25rc: add usage messageAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-15runscript: retry prefix flock if it is interrupted by a signalAlexander Mezin
Reported-by: Pacho Ramos <pacho2@gentoo.org> X-Gentoo-Bug: 434800 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=434800
2012-10-27Checkpath: print the path when correcting the ownerWilliam Hubbs
Checkpath was printing the path it was working with unless it was correcting the owner. In this case, it was printing "checkpath", which is not very useful. Reported-by: <devurandom@gmx.net> X-Gentoo-Bug: 439014 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439014
2012-10-24mountinfo: respect the -q command line optionWilliam Hubbs
Previously, we were setting the quiet flag before the command line was parsed. Since the flag is only used once, we can just read the environment variable which is set by the parsing process. Reported-by: <devurandom@gmx.net> X-Gentoo-Bug: 439010 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=439010
2012-10-17Spacing fixesWilliam Hubbs
2012-10-09checkpath: fix bool valuesWilliam Hubbs
Use true/false for bool values instead of 0/1. Reported-by: <vapier@gentoo.org>
2012-10-09checkpath: change the owner/group only when requested to do soWilliam Hubbs
Fix checkpath so that it only changes the owner/group if -o is on the command line. Reported-by: <flameeyes@gentoo.org> X-Gentoo-Bug: 437560 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=437560
2012-09-14Typo: emtpy -> emptyChristian Ruppert
Reported-by: Walter <walter@pratyeka.org> X-Gentoo-Bug: 430146 X-Gentoo-Bug-URL: https://bugs.gentoo.org/430146
2012-09-12Silence the right get_pid() callChristian Ruppert
2012-09-12Silence get_pid(), OpenRC will give the process some time to create the PID ↵Christian Ruppert
file and the first get__pid() call may fail.
2012-09-09add RC_PREFIX environment variableWilliam Hubbs
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.
2012-08-19Do not silence errorsChristian Ruppert
2012-08-18Fix quiet usageChristian Ruppert
EINFO_QUIET will always been unset when we first do unsetenv("EINFO_QUIET") and later query it again anyway..
2012-05-23rc: fix inverted string compare logicMike Frysinger
X-Gentoo-Bug: 417227 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=417227 Reported-by: sphakka <marcoep@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-16rc: fix thinko in applet collapseMike Frysinger
We want to lookup the service based on the applet name. Reported-by: Christian Ruppert <idl0r@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-06rc: collapse the applet if statements into a single array walkMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-06add a new ARRAY_SIZE macro and use itMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-26Disable some questionable linesChristian Ruppert
Caused by bug 412589 I was looking at the do_mark_service() function and quickly found that the segfault is caused by a strlen() call against a NULL pointer. I also noticed it's using "/exclusive/%s.%s" so svcname.pid, all other functions are just using the svcname.. So it seems that svcname.pid was/is never used and thus not necessary at all. In relation to the above, the if statement in the do_mark_service() function ("if (ok && svcname && strcmp(svcname, service) == 0) {") needs to be fixed/improved as svcname and service are almost always equal, see my comment in the function for further details. Signed-off-by: Christian Ruppert <idl0r@gentoo.org> Reported-by: Patrick McLean <chutzpah@gentoo.org> X-Gentoo-Bug: 412589 X-Gentoo-Bug-URL: https://bugs.gentoo.org/412589
2012-04-24Remove duplicate getenv("RC_SVCNAME") callChristian Ruppert
2012-03-26librc: Do not output error messages from within the library.William Hubbs
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
2012-02-23Skip pam if running as rootWilliam Hubbs
Reported-by: Piotr Karbowski <piotr.karbowski@gmail.com> X-Gentoo-Bug: 386623 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=386623
2012-02-20rc: remove calls to rc_sys_v2 and rc_sys_v1William Hubbs
These separate calls are no longer needed since we do not warn about falling back to automatic detection.
2012-02-20remove the warning about falling back to autodetectionJory A. Pratt
2012-02-12Fix some more warningsChristian Ruppert
2012-02-12Use size_t instead of intChristian Ruppert
2012-02-11Remove unused/useless function single_user()Christian Ruppert
2012-01-31fstabinfo: add --remount optionWilliam Hubbs
This adds a --remount/-R option to fstabinfo. This new option works like --mount, but it adds the necessary options to remount a file system that is already mounted. Reported-by: Piotr Karbowski <piotr.karbowski@gmail.com> X-Gentoo-Bug: 401573 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=401573
2012-01-28Do not unlink the temp. log during shutdownChristian Ruppert
Also ignore errors in case of EROFS (Read-Only file systems) Reported-by: Maxim Kammerer X-Gentoo-Bug: 401115 X-Gentoo-Bug-URL: https://bugs.gentoo.org/401115
2012-01-28Do not loop flock()Christian Ruppert
There's no need to loop until flock was successfully as flock() would simply block till a previous lock has been released. There's more to do to fix it properly, see my comments in the patch. Reported-by: James Le Cuirot <chewi@aura-online.co.uk> X-Gentoo-Bug: 360013 X-Gentoo-Bug-URL: https://bugs.gentoo.org/360013
2012-01-26Add -W/--writable function to checkpathChristian Ruppert
Checkpath -W will use access(3p) to determine whether or not a path is writable. This is more accurate than test(1p) because it also takes into account whether or not the filesystem is mounted read-only. Modified by William Hubbs to add the man page update.
2012-01-26Add is_writable() function to check whether a path is writable or notChristian Ruppert
2012-01-24Disable parallel startup in interactive modeChristian Ruppert
2012-01-23Per the systemd tmpfiles implementation, we need to watch out for umask ↵Robin H. Johnson
during initial creation of files as well as potentially changing permissions later. Also do not abort if the items exist already, per truncate rules in tmpfiles. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-23Ensure that when -F is passed, existing files are truncated properly.Robin H. Johnson
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-23Respin features.h usage so that we correctly test for features before we use ↵Robin H. Johnson
them. Some BSD libc implementations may have one or the other flag, but not both. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-01-23Revert "Drop include for features.h"Robin H. Johnson
This reverts commit 30a565f80d6056ccabadf77e347cf17067133f7e.
2012-01-22Drop include for features.hWilliam Hubbs
The following information is taken from the feature_test_macros man page: <features.h> is a Linux/glibc-specific header file. Other systems have an analogous file, but typically with a different name. This header file is automatically included by other header files as required: it is not necessary to explicitly include it in order to employ feature test macros. Reported-by: Tibor Vago <tibor.vago@gmail.com> X-Gentoo-Bug: 399635 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=399635
2012-01-15Add "ifstopped" command to runscriptChristian Ruppert
Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
2012-01-15Rename proc_getent to rc_proc_getent and make it globalChristian Ruppert
2012-01-09rc/checkpath: tmpfiles.d backend creation codeRobin H. Johnson
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>
2011-12-31Do not exit immediately when a service has been stopped alreadyChristian Ruppert
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