aboutsummaryrefslogtreecommitdiff
path: root/src/rc/runscript.c
AgeCommit message (Collapse)Author
2014-07-16move the selinux_setup function into rc-selinuxJason Zaman
X-Gentoo-Bug: 516956 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=516956
2013-12-29Rename runscript to openrc-runWilliam Hubbs
This was requested by Debian, because the minicom software, which is available on Debian and other distros, has a binary named runscript. We are keeping a backward compatibility symlink for now, but this allows Debian or any other distro to safely remove the symlink. X-Gentoo-Bug: 494220 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=494220
2013-12-13runscript: clarify the message wrt schedulingWilliam Hubbs
The message about a service being scheduled to start was confusing to some of our users; I was told this wording is more clear. X-Gentoo-Bug: 493070 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=493070
2013-10-30Begin port to GNU/kFreeBSDSteven Chamberlain
This is just a minimal port to get Debian up and running; the rest will be done later.
2013-10-12convert flock() messages to verbose warningsWilliam Hubbs
Convert these messages to warnings that are only displayed if EINFO_VERBOSE is set to yes in the environment. This is based on a suggestion from Patrick Lauer <patrick@gentoo.org>. X-Gentoo-Bug: 487588 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=487588
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-02-12Fix some more warningsChristian Ruppert
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-15Add "ifstopped" command to runscriptChristian Ruppert
Signed-off-by: Christian Ruppert <idl0r@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
2011-12-11fix compile errorWilliam Hubbs
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
2011-12-11Allow init scripts to be executed with a relative pathWilliam Hubbs
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
2011-11-19rc: fix style around case_RC_COMMON_GETOPTMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-08Remove unused variableChristian Ruppert
2011-09-02Do not ignore return code for custom script functionsFlex
X-Gentoo-Bug: 380317 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=380317
2011-07-31Improve processing of service directories and conf.d filesWilliam Hubbs
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
2011-07-26runscript: rename saveDir back to save to fix compile errorWilliam Hubbs
2011-07-20rename save and save2 for clarityWilliam Hubbs
The names saveDir and saveLnk seem to better define how these variables are used.
2011-07-05Don't write into optarg, this also fixes a compiler warning.Christian Ruppert
2011-06-29drop useless "All rights reserved" noticeMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-23Fix dirname calls in runscriptChristian Ruppert
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.
2011-01-17Clean up all trailing whitespace in src/.Robin H. Johnson
2011-01-12bug 351160: make openrc exit codes LSB compliantEray Aslan
* status on a stopped service now has a return code of 3 (was 1) * starting an already started service now has a return code of 0 (was 1) * stopping an already stopped service now has a return code of 0 (was 1)
2010-12-03Avoid race condition in runscript (bug #319865)Thomas Pfaff
Under normal conditions, runscript creates one child and waits for its termination, which is signaled by a pipe write from the SIGCHLD sighandler. When running killprocs however more than one SIGHCLD signal is generated, at least on all of my amd64 boxes running on real hardware and in vmware. When the first SIGCHLD occurs svc_exec leaves the loop and closes the pipe. Subsequent SIGCHLDs during the close can lead to a race condition and create an EBADF error in the pipe write (pipe is closed but the file handle is still != -1). We avoid this by blocking SIGHCHLD during the pipe close.
2010-04-09restore init.d pause optionMike Frysinger
2010-03-17Fix two leaks.Roy Marples
2010-01-08random spelling fixesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-04Allow init scripts to show their dependencies easierRoy 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-01Warn about going inactive correctly.Roy Marples
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-17If already started or stopped, abort.Roy Marples
2009-05-05Fix compile on NetBSD and FreeBSDRoy Marples
2009-05-01Add (c) to CopyrightRoy Marples
2009-04-30Add -Z, --dry-run option to show which services we would start/stopRoy Marples
without actually doing so. Fixes #151.
2009-04-30Avoid more gcc warning about not checking return values ...Roy Marples
2009-04-30Fix parensJuan RP
2009-04-28Don't start services when their need dependency is brokenRoy Marples
2009-04-24Cast to intRoy Marples
2009-04-24Describe interval unitsRoy Marples
2009-04-23Improve style for KNFRoy Marples
2009-04-23Improve the service timeout code and reduce the timeout to 60 seconds.Roy Marples
Don't process any dependencies when changing runlevels and called outside of RC otherwise we can deadlock.
2009-04-18Don't leak the lock fd.Roy Marples
2009-04-18Fix compile on FreeBSD.Roy Marples
2009-04-18Move status to runscript.sh so init scripts can override it, #159Roy Marples
Return 32 if crashed, #163
2009-04-17Using fifos for locking can be error prone.Roy Marples
flocks are safer, as we only use tmpfs for our lock files. I don't know how this works for inactive just yet though ...
2009-01-13yes should be YESRoy Marples
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
2008-12-23Our error messages don't have full stops at the endRoy Marples
2008-12-23Typo.Roy Marples