~mpontillo/maas/packaging-python-apt-fix

« back to all changes in this revision

Viewing changes to debian/maas-dhcp.maas-dhcpd6.service

  • Committer: MAAS Lander
  • Author(s): Andres Rodriguez
  • Date: 2015-04-01 11:48:17 UTC
  • mfrom: (370.1.3 packaging)
  • Revision ID: maas_lander-20150401114817-twk6zqkzvopxhoxq
[r=rvb][bug=][author=andreserl] Fix systemd DHCPd units to correctly run in Vivid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
ConditionPathExists=/var/lib/maas/dhcpd-interfaces
9
9
 
10
10
[Service]
 
11
# Allow dhcp server to write lease and pid file as 'dhcpd' user
11
12
ExecStartPre=/bin/mkdir -p /run/maas/dhcp
12
 
# Allow dhcp server to write lease and pid file as 'dhcpd' user
13
 
ExecStartPre=/bin/chown dhcpd:dhcpd /run/maas/dhcp
 
13
ExecStartPre=/bin/chown root:root /run/maas/dhcp
14
14
# The leases files need to be root:root even when dropping privileges
 
15
ExecStartPre=/bin/mkdir -p /var/lib/maas/dhcp
 
16
ExecStartPre=/bin/chown root:root /var/lib/maas/dhcp
 
17
# Start the daemon
15
18
ExecStart=/bin/sh -ec '\
16
 
    CONFIG_FILE=/etc/maas/dhcpd6.conf; \
17
 
    INTERFACES_FILE=/var/lib/maas/dhcpd-interfaces; \
18
 
    [ -e /var/lib/maas/dhcp/dhcpd6.leases ] || touch /var/lib/maas/dhcp/dhcpd6.leases; \
 
19
    INTERFACES=$(cat /var/lib/maas/dhcpd-interfaces); \
 
20
    LEASES_FILE=/var/lib/maas/dhcp/dhcpd6.leases; \
 
21
    [ -e $LEASES_FILE ] || touch $LEASES_FILE; \
19
22
    chown root:root /var/lib/maas/dhcp /var/lib/maas/dhcp/dhcpd6.leases*; \
20
 
    exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid -cf $CONFIG_FILE $INTERFACES_FILE'
 
23
    exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid \
 
24
        -cf /etc/maas/dhcpd6.conf -lf $LEASES_FILE $INTERFACES'
21
25
 
22
26
[Install]
23
27
WantedBy=multi-user.target