Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jun 2005 08:33:54 -0700 (PDT)
From:      Mitch Parks <mitch@kuoi.asui.uidaho.edu>
To:        "Michael W. Lucas" <mwlucas@blackhelicopters.org>
Cc:        stable@freebsd.org
Subject:   Re: /usr/local/etc/rc.d/*.sh not working?
Message-ID:  <20050614082632.L1139@kuoi.asui.uidaho.edu>
In-Reply-To: <20050614150240.GA62949@bewilderbeast.blackhelicopters.org>
References:  <20050614150240.GA62949@bewilderbeast.blackhelicopters.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 14 Jun 2005, Michael W. Lucas wrote:

>
> I'm certain this is documented somewhere, but danged if I can find it.
>
> I have a whole variety of custom scripts in /usr/local/etc/rc.d.  For
> years now, simply giving them a name ending in .sh and making them
> executable has been sufficient to make them start on boot.
>
> On 5.x, it's not.  And now, having upgraded to 4.11-s on some older
> boxes and running portupgrade -a, it's not.
>
> Obviously these scripts need something else.  There's no fancy rcNG
> infrastructure in them; is rcNG a requirement for startup scripts now?
> Any pointers on where I can find the right documentation?
>

You might want to look at `man rc.d`. There are example scripts there.

When I went to 5.x I updated all of my rc.d scripts to use what's labeled 
there as the "old style" format like:

The following is a simple, hypothetical example of an old-style
/usr/local/etc/rc.d/ script, which would start a daemon at boot time, 
and kill it at shutdown time.

      #!/bin/sh -
      #
      #    initialization/shutdown script for foobar package

      case "$1" in
      start)
              /usr/local/sbin/foo -d && echo -n ' foo'
              ;;
      stop)
              kill `cat /var/run/foo.pid` && echo -n ' foo'
              ;;
      *)
              echo "unknown option: $1 - should be 'start' or 'stop'" >&2
              ;;
      esac


SEE ALSO
      kill(1), rc.conf(5), init(8), rcorder(8), rc.subr(8), reboot(8),
      savecore(8)

HISTORY
      The rc utility appeared in 4.0BSD.

FreeBSD 5.4                  November 4, 2002              FreeBSD 5.4




        | Mitch Parks * mitch@uidaho.edu |

    "I bring you love and deeper understanding."
                 - Kate Bush



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050614082632.L1139>