Subject: Re: The new rc.d stuff...
To: Robert Elz <kre@munnari.OZ.AU>
From: Mason Loring Bliss <mason@acheron.middleboro.ma.us>
List: current-users
Date: 03/18/2000 16:25:27
--yEPQxsgoJgBvi8ip
Content-Type: text/plain; charset=us-ascii
On Sun, Mar 19, 2000 at 04:22:34AM +1100, Robert Elz wrote:
> That "ps ax | grep atalkd | grep -v grep" technique is one I have
> seen many times, and always wondered why
>
> ps axc | grep atalkd
>
> isn't used instead.
Hm. I'd never thought of it, nor evidently seen it anywhere. I'm using it
now, however. Thanks!
FWIW, a properly functional Netatalk script is attached.
--
Mason Loring Bliss mason@acheron.middleboro.ma.us E w i g e
awake ? sleep : dream; http://acheron.ne.mediaone.net B l u m e n k r a f t
--yEPQxsgoJgBvi8ip
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=atalkd
#!/bin/sh
# PROVIDE: atalkd
# REQUIRE: xdm
. /etc/rc.subr
. /etc/rc.conf
name="atalkd"
start_cmd="do_atalkd"
stop_cmd="kill_atalkd"
do_atalkd()
{
echo -n 'Starting AppleTalk daemons:'
if [ -f /usr/pkg/sbin/atalkd ]; then
/usr/pkg/sbin/atalkd; echo -n ' atalkd'
fi
if [ -f /usr/pkg/bin/nbprgstr ]; then
/usr/pkg/bin/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation
/usr/pkg/bin/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
echo -n ' nbprgstr'
fi
if [ -f /usr/pkg/sbin/papd ]; then
/usr/pkg/sbin/papd; echo -n ' papd'
fi
if [ -f /usr/pkg/sbin/afpd ]; then
/usr/pkg/sbin/afpd; echo -n ' afpd'
fi
if [ -f /usr/pkg/sbin/timelord ]; then
/usr/pkg/sbin/timelord; echo -n ' timelord'
fi
echo '.'
}
kill_atalkd()
{
echo -n "Killing AppleTalk daemons:"
ps acx | grep afpd | awk '{print $1}' | xargs -n 1 kill
echo -n " afpd"
ps acx | grep atalkd | awk '{print $1}' | xargs -n 1 kill
echo -n " atalkd"
ps acx | grep papd | awk '{print $1}' | xargs -n 1 kill
echo -n " papd"
ps acx | grep timelord | awk '{print $1}' | xargs -n 1 kill
echo -n " timelord"
echo "."
}
run_rc_command "$1"
--yEPQxsgoJgBvi8ip--