~ubuntu-branches/ubuntu/saucy/maas/saucy-updates

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Andres Rodriguez, Scott Moser
  • Date: 2013-10-01 15:26:34 UTC
  • mfrom: (1.2.15)
  • Revision ID: package-import@ubuntu.com-20131001152634-5iw7fappx55dkd9p
Tags: 1.4+bzr1656+dfsg-0ubuntu1
[ Andres Rodriguez ]
* New upstream bugfix release.
  - Respect filters for ephemerals_script.py.
* debian/control: Depends on ubuntu-cloudimage-keyring instead of
  ubuntu-cloud-keyring; depends on python-distro-info.
* debian/control: Remove suggests on maas-dhcp and maas-dns as they are
  now dependencies.

[ Scott Moser ]
* debian/control: Bump depends on isc-dhcp-server to 4.2.4
* debian/maas-dhcp.maas-dhcp-server.upstart: Change ownership of leases
  file to root:root, and run the daemon as dhcpd:dhcpd.

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