~ubuntu-branches/ubuntu/trusty/maradns/trusty

« back to all changes in this revision

Viewing changes to build/deadwood.startup

  • Committer: Package Import Robot
  • Author(s): Nicholas Bamber
  • Date: 2012-01-06 08:47:03 UTC
  • mfrom: (1.1.17) (10.1.12 experimental)
  • Revision ID: package-import@ubuntu.com-20120106084703-e3kw2c5a6djne2gw
Tags: 2.0.04-1
* Allowed watch file to pick up 2.x releases
* New upstream release
* Refreshed patches
* Added override to stop deletion of server/MaraDNS.c.orig
* Added patch to stop corruption of deadwood source code
* Added public domain stanza trying to give useful information about
  the public domain status (or otherwise) of certain files.
* Updated doc-base index file
* Split out documentation into separate package as it is written from
  an upstream point of view
* Added askmara-tcp tool to maradns-zoneserver package
* Added experimental maradns-deadwood package (Closes: #612229)
* Turned on compilation for IPv6 (Closes: #477787)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
# Copyright 2005-2006,2011 Sam Trenholme
 
3
 
 
4
# TERMS
 
5
 
 
6
# Redistribution and use in source and binary forms, with or without
 
7
# modification, are permitted provided that the following conditions
 
8
# are met:
 
9
 
 
10
# 1. Redistributions of source code must retain the above copyright
 
11
#    notice, this list of conditions and the following disclaimer.
 
12
# 2. Redistributions in binary form must reproduce the above copyright
 
13
#    notice, this list of conditions and the following disclaimer in the
 
14
#    documentation and/or other materials provided with the distribution.
 
15
 
 
16
# This software is provided 'as is' with no guarantees of correctness or
 
17
# fitness for purpose.
 
18
 
 
19
# This is a script which stops and starts the MaraDNS process
 
20
# The first line points to bash because I don't have a true Solaris /bin/sh
 
21
# to test this against.
 
22
 
 
23
# The following is a pointer to the MaraDNS program
 
24
if [ -x "/usr/sbin/Deadwood" ] ; then
 
25
        DEADWOOD="/usr/sbin/Deadwood"
 
26
elif [ -x "/usr/local/sbin/Deadwood" ] ; then
 
27
        DEADWOOD="/usr/local/sbin/Deadwood"
 
28
elif [ -x "/usr/local/bin/Deadwood" ] ; then
 
29
        DEADWOOD="/usr/local/bin/Deadwood"
 
30
elif [ -x "/usr/bin/Deadwood" ] ; then
 
31
        DEADWOOD="/usr/bin/Deadwood"
 
32
else
 
33
        echo unable to find Deadwood
 
34
        exit 1
 
35
fi
 
36
 
 
37
# The following is a pointer to the duende daemonizer
 
38
if [ -x "/usr/sbin/duende" ] ; then
 
39
        DUENDE="/usr/sbin/duende"
 
40
elif [ -x "/usr/local/sbin/duende" ] ; then
 
41
        DUENDE="/usr/local/sbin/duende"
 
42
elif [ -x "/usr/local/bin/duende" ] ; then
 
43
        DUENDE="/usr/local/bin/duende"
 
44
elif [ -x "/usr/bin/duende" ] ; then
 
45
        DUENDE="/usr/bin/duende"
 
46
else
 
47
        echo unable to find duende
 
48
        exit 1
 
49
fi
 
50
 
 
51
# The following is the directory we place MaraDNS log entries in
 
52
LOGDIR="/var/log"
 
53
 
 
54
# Show usage information if this script is invoked with no arguments
 
55
if [ $# -lt 1 ] ; then
 
56
    echo Usage: $0 \(start\|stop\|restart\)
 
57
    exit 1
 
58
fi
 
59
 
 
60
# If invoked as stop or restart, kill *all* MaraDNS processes
 
61
if [ $1 = "stop" -o $1 = "restart" ] ; then
 
62
    echo Sending all Deadwood processes the TERM signal
 
63
    ps -e | awk '{print $1":"$NF}' | grep Deadwood | grep -v $$ | \
 
64
      cut -f1 -d: | xargs kill > /dev/null 2>&1
 
65
    echo waiting 5 seconds
 
66
    sleep 5
 
67
    echo Sending all Deadwood processes the KILL signal
 
68
    ps -e | awk '{print $1":"$NF}' | grep Deadwood | grep -v $$ | \
 
69
      cut -f1 -d: | xargs kill -9 > /dev/null 2>&1
 
70
    echo MaraDNS should have been stopped
 
71
    if [ $1 = "stop" ] ; then
 
72
        exit 0
 
73
    fi
 
74
fi
 
75
 
 
76
# If invoked as start or restart, start the Deadwood processes
 
77
if [ $1 = "start" -o $1 = "restart" ] ; then
 
78
    echo Starting Deadwood process
 
79
    $DUENDE $DEADWOOD 
 
80
    exit 0
 
81
fi
 
82