1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $NetBSD: amd,v 1.6 2000/09/19 13:04:38 lukem Exp $
| 3# $NetBSD: amd,v 1.10 2002/04/29 12:08:17 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/amd 98184 2002-06-13 22:14:37Z gordon $
|
4# 5 6# PROVIDE: amd
| 5# 6 7# PROVIDE: amd
|
7# REQUIRE: rpcbind mountall ypbind
| 8# REQUIRE: rpcbind mountall ypbind nfsclient 9# BEFORE: DAEMON 10# KEYWORD: FreeBSD NetBSD
|
8 9. /etc/rc.subr 10 11name="amd"
| 11 12. /etc/rc.subr 13 14name="amd"
|
12rcvar=$name 13command="/usr/sbin/${name}" 14load_rc_config $name
| 15rcvar=`set_rcvar`
|
15
| 16
|
16command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid' 17required_files="/etc/amd.conf" 18required_dirs="$amd_dir" 19required_vars="rpcbind"
| 17case `${CMD_OSTYPE}` in 18FreeBSD) 19 start_cmd="echo 'Starting amd.'; /usr/sbin/${name} &" 20 start_precmd="amd_precmd" 21 ;; 22NetBSD) 23 command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid' 24 required_dirs="$amd_dir" 25 required_files="/etc/amd.conf" 26 required_vars="rpcbind" 27 command="/usr/sbin/${name}" 28 ;; 29esac
|
20
| 30
|
| 31amd_precmd() 32{ 33 case `${CMD_OSTYPE}` in 34 FreeBSD) 35 if ! checkyesno nfs_client_enable ; then 36 force_depend nfsclient || return 1 37 fi 38 if [ -z "`check_process rpcbind`" \ 39 -a ! `checkyesno portmap_enable` ]; then 40 force_depend rpcbind || return 1 41 fi 42 43 case ${amd_map_program} in 44 [Nn][Oo] | '') 45 ;; 46 *) 47 amd_flags="${amd_flags} `eval ${amd_map_program}`" 48 ;; 49 esac 50 51 case "${amd_flags}" in 52 '') 53 if [ ! -r /etc/amd.conf ]; then 54 warn 'amd will not load without arguments' 55 return 1 56 fi 57 ;; 58 *) 59 amd_flags="-p ${amd_flags} > /var/run/amd.pid 2> /dev/null" \ 60 ;; 61 esac 62 ;; 63 esac 64 return 0 65} 66 67load_rc_config $name
|
21run_rc_command "$1"
| 68run_rc_command "$1"
|