Subject: Re: The new rc.d stuff...
To: John Nemeth <jnemeth@victoria.tc.ca>
From: Greywolf <greywolf@starwolf.com>
List: current-users
Date: 03/27/2000 23:33:33
On Mon, 27 Mar 2000, John Nemeth wrote:

# On Aug 8,  5:45am, Mason Loring Bliss wrote:
# } 
# } Enclosed are my sshd and atalkd scripts, in case anyone wants random examples
# } to peruse, along with my rc.local.conf file. The atalkd script is incomplete
# } and would be better off as a series of individual scripts for each requisite
# } daemon, but it makes for a good example of how to do "quick and dirty" con-
# } versions. The sshd thing should work with either OpenSSH or Datafellows
# } without modification, IIRC.
# } 
# } #!/bin/sh
# } 
# } # PROVIDE: atalkd
# } # REQUIRE: xdm
# 
#      Silly question, but why is a filesystem daemon dependent on an X
# daemon?
# 
# } [snip]
# } 
# }   if [ -f /usr/pkg/sbin/timelord ]; then
# } 	  /usr/pkg/sbin/timelord;		echo -n ' timelord'
# }   fi
# 
#      I sure hope this is for providing time to Macs only.

I sure hope that "/usr/pkg" is not hard-coded in (HINT!).  LOCAL_PREFIX
should be definable.  I don't have a /usr/pkg.  I have a /usr/local.
And, as I've discovered, I'm not the only one who works in this fashion.

# } kill_atalkd()
# } {
# }   echo "Killing afpd processes..."
# }   ps ax | grep afpd | grep -v grep | awk '{print $1}' | xargs -n 1 kill
# }   echo "Killing atalkd processes..."
# }   ps ax | grep atalkd | grep -v grep | awk '{print $1}' | xargs -n 1 kill
# } }
# 
#      Why don't these daemons create /var/run/*.pid files?

Indeed.

Folks, if we HAVE to do this, let's do it correctly?

AND:  What ever happened to 'ps axc | grep ...' so you don't have to
grep -v the grep?

We need to do something to shorten that pipeline.

	ps ax | awk '$0 ~ /afpd/ && $0 !~ /awk/ {print $1}' |
		xargs -n 1 kill

or,

	ps axc | awk '$0 ~ /afpd/ {print $1}' | xargs -n 1 kill

You see, we're forgetting how to do this already! :-)

# 
# }-- End of excerpt from Mason Loring Bliss
# 


				--*greywolf;
--
BSD: the power to swerve (penguins, worse than cane toads).