[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: init script output



> I would, of course, prefer a solution with the lsb functions. What
> I want is to know when fail2ban started and when I accidentally
> tried to start it while the daemon was already running.
BTW - it seems that /etc/init.d/skeleton does not provide any additional
status (which you requested), that is why I did it the way it is now (I
believe)

case "$1" in
  start)

        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac

so if providing additional information is what everybody agrees upon, 1)
cases should have additional log_daemon_msg I assume to report "(is already
running)" or "(was not running)" accordingly...

As for LSB compliance: shouldn't usage message be printed using log_success_msg
as well (as quite a few init scripts doing that already (eg portmap))?
if so - initscripts should get a fresh (yet 1 more heh heh) bugreport
filed...


-- 
                                  .-.
=------------------------------   /v\  ----------------------------=
Keep in touch                    // \\     (yoh@|www.)onerussian.com
Yaroslav Halchenko              /(   )\               ICQ#: 60653192
                   Linux User    ^^-^^    [175555]


Attachment: pgpuGs67oU7uj.pgp
Description: PGP signature


Reply to: