aboutsummaryrefslogtreecommitdiff
path: root/functions
AgeCommit message (Collapse)AuthorFiles
2009-09-24Fix stty/tput usage for columns againJim Pryor1
Cleans up double application of earlier fixes for this issue. Instead of calling $(tput cols 2>/dev/null), we now try tput cols silently to see whether it complains. If not, then we call $(tput cols) with no redirection of stderr. This way, we can get results other than 80. eliminate color when stdout is not terminal Signed-off-by: Jim Pryor <profjim@jimpryor.net> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-26Make the hook-system a bit more usableThomas Bächler1
This patch makes the hook names unique, prefixing them all with the script name (without the 'rc.') It also removes the explicit declarations of all elements of the array, bash assumes "" if they are uninitialized
2009-08-25Implement a hook-system that allows to add custom code to the initscripts at ↵Thomas Bächler1
certain places A function add_hook can be called from functions.d to register a hook function. The existing hooks are based on suggestions from Michael Towers (larch) and on the implementation of initscripts-extras-fbsplash which currently uses the strings passed to stat_busy and stat_done for this. More hooks can be added if requested. The implementation uses associative arrays and will thus only work with bash 4 or later
2009-08-22Fix in_array function2009.08-1Thomas Bächler1
In in_array a check might look like [ "!" = "@" ], which will fail because of the !, so make this check look like [ "x!" = "x@" ]. Also, when an entry is prefixed with !, it should be handled as if it was not in the array.
2009-08-05Enable in_array for prefixed daemonsAaron Griffin1
Previous code has issues with ! and @ prefixed DAEMONS Original-by: Florian Pritz <bluewind@xssn.at> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-05Revert previous commit chunk: in_array fixesAaron Griffin1
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-05Fix stty/tput usage for columnsJim Pryor1
This corrects the usage of stty and tput under various non-TTY conditions such as under cron and redirected output. [Aaron: Also corrected my USECOLOR bug I introduced last patch] Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-30functions: refactor for non-tty outputAaron Griffin1
This commit should allow rc.d scripts to be run from non-tty's, such as a cron job Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-30Shutdown non-rc.conf daemons firstAaron Griffin1
Flip the order in which daemons are shutdown. First we scan for all daemons that are NOT in rc.conf and shut those down (order is based on ls, so it is dependent on LC_COLLATE). Afterwards, we shut down all daemons in rc.conf, in order Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-29functions: Add -- to stat_append printfJacob Winther1
printf causes scripts to fail when argument starts with a dash Calling stat_append "- hello" causes the following error: /etc/rc.d/functions: line 99: printf: - : invalid option printf: usage: printf [-v var] format [arguments] [FAIL] Ref: FS#15713 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-04-02Make sure functions ends cleanlyAaron Griffin1
When errexit was set, sourcing functions caused a script to exit. Fix this by using a real 'if' instead of the [ a ] && b syntax. Also, fix the vim modeline :) Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-09Fix status display functionsAllan McRae1
The status display functions were returning the opposite of what they should have been. Also made cosmetic changes to the output. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-12-23Add some simple status display functionsAaron Griffin1
This is useful for displaying daemon status in functions like /etc/rc.d/$DAEMON status Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-12-04unset the TZ envvar in 'functions'Aaron Griffin1
This prevents a local TZ variable from breaking daemon's when started by root. Daemon's should always respect the system's /etc/localtime Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-09-18Fix bug #112292008.09-2Thomas Bächler1
2008-06-20Minor simplication for /etc/rc.d/functions.d/Natanael Copa1
Trivial simplification to make code more readable. Removes one fork so booting should be "faster". Probably not mesureable Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-05-27Allow users to ovverride daemon start and stop in rc.multi and rc.shutdownAnton Fiuman1
Signed-off-by: Anton Fiuman <llexiw@gmail.com>
2008-05-22Remove source_functions in favor of always sourcing the dirAaron Griffin1
This is an obvious oversight on my part - this change allows the overridden functions to work in daemon scripts and anything else that uses /etc/rc.d/functions by itself. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-03-08Add basic support for dependencies in rc.d scriptsRoman Kyrylych1
Example of use: DEPENDS=('dbus' 'acpid') . . . ck_depends ${DEPENDS[@]} and those daemons will be started if not running already Signed-off-by: Roman Kyrylych <roman@archlinux.org>
2008-03-08Use full path to binaries everywhereRoman Kyrylych1
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
2008-03-08Fix indentation in rc.d/functionsRoman Kyrylych1
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
2008-02-14Merge branch 'posix' into workingDan McGee1
2008-02-14functions:source_functions(): don't fail on empty dirDan McGee1
Instead of using globbing which will fail on an empty directory, use an ls call similar to other places in the initscripts which is not prone to failure. (See rc.single in the daemon shutdown for example.) Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-14Make functions sh compatibleDan McGee1
There is no reason to use bashisms in functions, so eliminate any and use printf instead of echo options which are not guaranteed to be implemented in a POSIX sh. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-14Don't assume sh == bashDan McGee1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-20Make the background black on all status textSimo Leone1
This is the easiest way to cleanup the script output on white terminals without resorting to shutting off color. It won't make everyone happy, though. Ref: FS#1186 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-12-13Fix FS#8843 (no colors in rc.sysinit output with separate /usr)Roman Kyrylych1
when tput returns exit code 3 - assume it output '8' (as written in the /usr/share/terminfo/l/linux file) Signed-off-by: Roman Kyrylych <roman@archlinux.org> Converted to if/elsif form Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-28Source /etc/rc.d/functions.d/ for additional initscript functionsAaron Griffin1
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-21Fix broken terminal detection, disable colors when the terminal is unknown.Thomas Bächler1
2007-10-21disable colors on stupid terminalsThomas Bächler1
(fixes #7369)
2007-08-15upgpkg: initscripts 2007.08-2Dan McGee1
2006-12-17added stat_append to functions, fixed fsck bugs when clock is not setThomas Bächler1
2005-06-30added new netcfg stuff for roaming network profilesJudd Vinet1
2005-03-11added support for backgrounding daemons at startup with a '@' prefix, ↵Judd Vinet1
commented out the ldconfig call at startup, added support for unicode console maps, added a hotplug_ifup() function rc.d/network for hotplug's net.agent to use
2004-02-19added cleanups by Leif AskelandJudd Vinet1
2003-10-10a little formatting improvementJudd Vinet1
2003-10-10added color to rc messages and fixed bug #168Judd Vinet1
2002-12-12modified to stat_fail to return a $retvalJudd Vinet1
2002-07-24Upgraded initscripts to 0.30.3Judd Vinet1
2002-06-11nadaJudd Vinet1
2002-04-15Updated initscriptsJudd Vinet1
2002-03-04Initial revisionJudd Vinet1