contrib/rc_nobash
2006-11-13 21:12:21 +01:00
..
.footprint abiword: initial release 2006-11-13 21:12:21 +01:00
.md5sum abiword: initial release 2006-11-13 21:12:21 +01:00
inittab abiword: initial release 2006-11-13 21:12:21 +01:00
Pkgfile abiword: initial release 2006-11-13 21:12:21 +01:00
rc abiword: initial release 2006-11-13 21:12:21 +01:00
rc.conf abiword: initial release 2006-11-13 21:12:21 +01:00
rc.dev abiword: initial release 2006-11-13 21:12:21 +01:00
rc.local abiword: initial release 2006-11-13 21:12:21 +01:00
rc.modules abiword: initial release 2006-11-13 21:12:21 +01:00
rc.multi abiword: initial release 2006-11-13 21:12:21 +01:00
rc.rescue abiword: initial release 2006-11-13 21:12:21 +01:00
rc.shutdown abiword: initial release 2006-11-13 21:12:21 +01:00
rc.single abiword: initial release 2006-11-13 21:12:21 +01:00
README abiword: initial release 2006-11-13 21:12:21 +01:00
service abiword: initial release 2006-11-13 21:12:21 +01:00

I created this modified rc package with the following in mind:

1) Replace bashisms with plain POSIX sh

Which means they work with whatever shell you have installed as
/bin/sh, also with bash, so no worries here, just as long as you
realize the rc.conf file should not contain arrays, but variables,
so your services line should look like:

    SERVICES="net xfs xdm crond portmap nfsclient sshd"


2) Try to detect udev or devfs.

3) Avoid using tempfiles when not necessary.

4) Source rather than execute files if possible.

5) Avoid code duplication.

6) Avoid sending usefull errors to /dev/null

7) Added the script /sbin/service which saves code-duplication and
   it is a simple frontend for /etc/rc.d/service


Why did I want to get rid of bash. Well:

~% ls -l /bin/mksh
-rwxr-xr-x  1 root root 184K aug 21 15:38 /bin/mksh

Do you get it now? :-)


Stuff you may want to add to /etc/pkgadd.conf:

      UPGRADE	      ^etc/rc$		      YES
      UPGRADE	      ^etc/rc.conf$	      NO
      UPGRADE	      ^etc/rc.dev$	      YES
      UPGRADE	      ^etc/rc.local$	      NO
      UPGRADE	      ^etc/rc.modules$	      NO
      UPGRADE	      ^etc/rc.multi$	      YES
      UPGRADE	      ^etc/rc.rescue$	      YES
      UPGRADE	      ^etc/rc.shutdown$	      YES
      UPGRADE	      ^etc/rc.single$	      YES