~ubuntu-branches/ubuntu/precise/nis/precise

« back to all changes in this revision

Viewing changes to debian/nis.ypserv.upstart

  • Committer: Steve Langasek
  • Date: 2012-02-28 00:20:56 UTC
  • Revision ID: steve.langasek@canonical.com-20120228002056-u2n5yb61ld32xnof
* Convert to native upstart jobs, with a versioned dependency on
  upstart (>= 0.9.7-2) because we use the wait-for-state job.  LP: #569757.
* Depend on rpcbind (>= 0.2.0-6ubuntu1) instead of portmap to ensure our
  upstart job dependencies are satisfied.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
description     "NIS server"
 
2
author          "Steve Langasek <steve.langasek@canonical.com>"
 
3
 
 
4
# Patterned after the statd.conf job in nfs-common.
 
5
start on (started portmap ON_BOOT=
 
6
          or (started portmap ON_BOOT=y
 
7
              and ((filesystem and static-network-up) or failsafe-boot)))
 
8
stop on stopping portmap or runlevel [!2345]
 
9
 
 
10
expect daemon
 
11
respawn
 
12
 
 
13
pre-start script
 
14
        NISSERVER=false
 
15
 
 
16
        [ -f /usr/sbin/ypbind ] && [ -f /etc/defaultdomain ] || { stop; exit 0; }
 
17
 
 
18
        [ -f /etc/default/nis ] && . /etc/default/nis
 
19
 
 
20
        [ "$NISSERVER" = false ] && { stop; exit 0; }
 
21
 
 
22
        oname=$(domainname)
 
23
        nname=$(cat /etc/defaultdomain)
 
24
        if [ "$oname" != "$nname" ]; then
 
25
                echo "Setting NIS domainname to: $nname"
 
26
                domainname "$nname"
 
27
        fi
 
28
end script
 
29
 
 
30
script
 
31
        [ -f /etc/default/nis ] && . /etc/default/nis
 
32
        exec ypserv $YPSERVARGS
 
33
end script
 
34
 
 
35
post-start script
 
36
        [ -f /etc/default/nis ] && . /etc/default/nis
 
37
        if [ "$NISSERVER" = slave ] && [ -n "$NISMASTER" ]; then
 
38
                /usr/lib/yp/ypinit -s "$NISMASTER"
 
39
        fi
 
40
end script