~andreserl/maas/packaging_fix_maas_proxy

« 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-03-17 22:18:17 UTC
  • mfrom: (362.1.6 packaging.systemd)
  • Revision ID: maas_lander-20150317221817-22qdm2lqybl3kv2s
[r=andreserl,pitti][bug=1423613][author=andreserl] Add systemd support for MAAS controlled daemons.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
[Unit]
 
2
Description=MAAS instance of ISC DHCP server for IPv6
 
3
Documentation=man:dhcpd(8)
 
4
Wants=network-online.target
 
5
After=network-online.target
 
6
After=time-sync.target
 
7
ConditionPathExists=/etc/maas/dhcpd6.conf
 
8
ConditionPathExists=/var/lib/maas/dhcpd-interfaces
 
9
 
 
10
[Service]
 
11
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
 
14
# The leases files need to be root:root even when dropping privileges
 
15
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
    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'
 
21
 
 
22
[Install]
 
23
WantedBy=multi-user.target