]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSPosix/mdnsd.sh
2 # Emacs settings: -*- tab-width: 4 -*-
4 # Copyright (c) 2002-2006 Apple Computer, Inc. All rights reserved.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Linux /etc/init.d script to start/stop the mdnsd daemon.
21 # Revision 1.9 2006/09/05 20:00:14 cheshire
22 # Moved Emacs settings to second line of file
24 # Revision 1.8 2006/08/29 16:42:01 mkrochma
25 # Fix POSIX startup script
27 # Revision 1.7 2006/08/14 23:24:47 cheshire
28 # Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
30 # Revision 1.6 2004/12/07 20:30:45 cheshire
31 # Fix start-stop-daemon for Suse Linux (don't use -s TERM)
33 # Revision 1.5 2004/06/29 22:13:45 cheshire
34 # Fix from Andrew White at NICTA
36 # Revision 1.4 2004/02/05 20:23:10 cheshire
37 # Fix mdnsd.sh to work on *BSD distributions
39 # Revision 1.3 2004/01/19 22:47:17 cheshire
40 # Define killprocterm() to do "killproc $1 -TERM" for Linux
42 # Revision 1.2 2003/12/11 19:42:13 cheshire
43 # Change name "mDNSResponderd" to "mdnsd" for consistency with standard Linux (Unix) naming conventions
45 # Revision 1.1 2003/12/08 20:47:02 rpantos
46 # Add support for mDNSResponder on Linux.
48 # The following lines are used by the *BSD rcorder system to decide
49 # the order it's going to run the rc.d scripts at startup time.
53 if [ -r /usr
/sbin
/mdnsd
]; then
54 DAEMON
=/usr
/sbin
/mdnsd
56 DAEMON
=/usr
/local
/sbin
/mdnsd
59 test -r $DAEMON || exit 0
61 # Some systems have start-stop-daemon, some don't.
62 if [ -r /sbin
/start
-stop-daemon ]; then
63 START
="start-stop-daemon --start --quiet --exec"
64 # Suse Linux doesn't work with symbolic signal names, but we really don't need
65 # to specify "-s TERM" since SIGTERM (15) is the default stop signal anway
66 # STOP="start-stop-daemon --stop -s TERM --quiet --oknodo --exec"
67 STOP
="start-stop-daemon --stop --quiet --oknodo --exec"
70 kill -TERM `cat /var/run/mdnsd.pid`
78 echo -n "Starting Apple Darwin Multicast DNS / DNS Service Discovery daemon:"
84 echo -n "Stopping Apple Darwin Multicast DNS / DNS Service Discovery daemon:"
85 echo -n " mdnsd" ; $STOP $DAEMON
88 reload
|restart
|force
-reload)
89 echo -n "Restarting Apple Darwin Multicast DNS / DNS Service Discovery daemon:"
96 echo "Usage: /etc/init.d/mDNS {start|stop|reload|restart}"