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

« back to all changes in this revision

Viewing changes to debian/nis.yppasswdd.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 password update daemon"
 
2
author          "Steve Langasek <steve.langasek@canonical.com>"
 
3
 
 
4
start on started ypserv
 
5
stop on stopping ypserv
 
6
 
 
7
respawn
 
8
expect daemon
 
9
 
 
10
pre-start script
 
11
        NISSERVER=false
 
12
 
 
13
        [ -f /usr/sbin/ypbind ] && [ -f /etc/defaultdomain ] || { stop; exit 0; }
 
14
 
 
15
        [ -f /etc/default/nis ] && . /etc/default/nis
 
16
 
 
17
        [ "$NISSERVER" = master ] || { stop; exit 0; }
 
18
end script
 
19
 
 
20
script
 
21
        YPCHANGEOK=chsh
 
22
        YPPWDDIR=/etc
 
23
 
 
24
        [ -f /etc/default/nis ] && . /etc/default/nis
 
25
 
 
26
        E=
 
27
        if [ -n "$YPCHANGEOK" ]; then
 
28
                OIFS="$IFS"; IFS="$IFS,"
 
29
                for i in $YPCHANGEOK
 
30
                do
 
31
                        case $i in
 
32
                                chsh|chfn)
 
33
                                        E="$E -e $i"
 
34
                                        ;;
 
35
                        esac
 
36
                done
 
37
                IFS="$OIFS"
 
38
        fi
 
39
        if [ -n "$YPPWDDIR" ]; then
 
40
                YPPWDDIRARGS="-D $YPPWDDIR"
 
41
        fi
 
42
        exec rpc.yppasswdd $YPPWDDIRARGS $E $YPPASSWDDARGS
 
43
end script