| Optimizing the rc.d. - geomyidae - A small C-based gopherd. | |
| git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri… | |
| Log | |
| Files | |
| Refs | |
| Tags | |
| README | |
| LICENSE | |
| --- | |
| commit b3b6d54e4122244a89b50987b122a135b6b40586 | |
| parent 866af53f96a6cc52a99b7103f72a8e31dedaee84 | |
| Author: Christoph Lohmann <[email protected]> | |
| Date: Sun, 29 Apr 2012 08:24:01 +0200 | |
| Optimizing the rc.d. | |
| Diffstat: | |
| M rc.d/Archlinux.rc.d | 55 ++++++++++++++++-------------… | |
| 1 file changed, 28 insertions(+), 27 deletions(-) | |
| --- | |
| diff --git a/rc.d/Archlinux.rc.d b/rc.d/Archlinux.rc.d | |
| @@ -4,33 +4,34 @@ | |
| . /etc/rc.d/functions | |
| . /etc/conf.d/geomyidae | |
| -PID=`pidof -o %PPID /usr/bin/geomyidae` | |
| +PID=$(pidof -o %PPID /usr/bin/geomyidae) | |
| case "$1" in | |
| - start) | |
| - stat_busy "Starting geomyidae" | |
| - [ -z "$PID" ] && /usr/bin/geomyidae $GEOMYIDAE_ARGS 2>&1 | |
| - if [ $? -gt 0 ]; then | |
| - stat_fail | |
| - else | |
| - add_daemon geomyidae | |
| - stat_done | |
| - fi | |
| - ;; | |
| - stop) | |
| - stat_busy "Stopping geomyidae" | |
| - [ ! -z "$PID" ] && kill $PID &>/dev/null | |
| - if [ $? -gt 0 ]; then | |
| - stat_fail | |
| - else | |
| - rm_daemon geomyidae | |
| - stat_done | |
| - fi | |
| - ;; | |
| - restart) | |
| - $0 stop | |
| - $0 start | |
| - ;; | |
| - *) | |
| - echo "usage: $0 {start|stop|restart}" | |
| + start) | |
| + stat_busy "Starting geomyidae" | |
| + [ -z "$PID" ] && /usr/bin/geomyidae $GEOMYIDAE_ARGS 2>&1 | |
| + if [ $? -gt 0 ]; then | |
| + stat_fail | |
| + else | |
| + add_daemon geomyidae | |
| + stat_done | |
| + fi | |
| + ;; | |
| + stop) | |
| + stat_busy "Stopping geomyidae" | |
| + [ -n "$PID" ] && kill $PID &>/dev/null | |
| + if [ $? -gt 0 ]; then | |
| + stat_fail | |
| + else | |
| + rm_daemon geomyidae | |
| + stat_done | |
| + fi | |
| + ;; | |
| + restart) | |
| + $0 stop | |
| + $0 start | |
| + ;; | |
| + *) | |
| + echo "usage: $0 {start|stop|restart}" | |
| esac | |
| exit 0 | |
| + |