~andreserl/maas/packaging_bzr1693

« back to all changes in this revision

Viewing changes to debian/maas-dhcp.maas-dhcp-server.upstart

  • Committer: Tarmac
  • Author(s): Scott Moser
  • Date: 2013-10-03 14:06:36 UTC
  • mfrom: (203.1.1 packaging.1231693)
  • Revision ID: tarmac-20131003140636-lvykp443n11frhu9
[r=andreserl][bug=1231693][author=smoser] revert maas-dhcp-server upstart job to quantal-behavior-only.

This knowingly stops saucy level packages from running with
isc-dhcpd-server from precise. That is intended because we are more
interested in supporting isc-dhcpd-server from the cloud-archive which
will be a newer version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
respawn
39
39
script
40
 
    RELEASE=`lsb_release --codename --short`
41
40
    INTERFACES=`cat "${INTERFACES_FILE}"`
42
41
 
43
42
    # Allow dhcp server to write lease and pid file.
47
46
    # As of Quantal, the leases file must be owned by root:root (even though
48
47
    # the daemon will run under an unprivileged user).
49
48
    # In Precise, ownership was supposed to be dhcpd:dhcpd.
 
49
    #
 
50
    # maas packages on saucy are only supported with newer isc-dhcp via
 
51
    # the cloud-archive.  See bug 1231693 for more information, including
 
52
    # a patch that would actually work to support all, but is complex.
 
53
    
50
54
    mkdir -p $LEASES_DIR
51
 
    if [ "$RELEASE" = "precise" ]; then
52
 
        owner_group="dhcpd:dhcpd"
53
 
        dhcpd_owner_opts=""
54
 
    else
55
 
        owner_group="root:root"
56
 
        dhcpd_owner_opts="-user dhcpd -group dhcpd"
57
 
    fi
58
 
    chown $owner_group $LEASES_DIR
 
55
    chown root:root $LEASES_DIR
59
56
    [ -e $LEASES_FILE ] || touch $LEASES_FILE
60
57
    for LFILE in $LEASES_FILE $LEASES_FILE~; do
61
58
        if [ -e $LFILE ]; then
62
 
            chown $owner_group $LFILE
 
59
            chown root:root $LFILE
63
60
            chmod a+r $LFILE
64
61
        fi
65
62
    done
66
63
 
67
 
    exec /usr/sbin/dhcpd ${dhcpd_owner_opts} -f -q -4 -pf $PID_FILE -cf $CONFIG_FILE -lf $LEASES_FILE $INTERFACES
 
64
    exec /usr/sbin/dhcpd -user dhcpd -group dhcpd -f -q -4 -pf $PID_FILE -cf $CONFIG_FILE -lf $LEASES_FILE $INTERFACES
68
65
end script