diff options
author | Li xin <lixin.fnst@cn.fujitsu.com> | 2015-06-05 16:49:26 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-06-05 19:05:40 -0400 |
commit | 6a84fe282ec641a07bc258fadeba475e8d326e68 (patch) | |
tree | 8ac87f0285dcee08017ef9ec88e9869a6560cc27 | |
parent | 40639902b51f88d15de30cbe9c1d98ada4685486 (diff) | |
download | meta-openembedded-6a84fe282ec641a07bc258fadeba475e8d326e68.tar.gz |
dovecot: add systemd support and add user dovecot dovenull which is need to start dovecot service.
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
3 files changed, 51 insertions, 3 deletions
diff --git a/meta-networking/recipes-support/dovecot/dovecot/dovecot.service b/meta-networking/recipes-support/dovecot/dovecot/dovecot.service new file mode 100644 index 000000000..ca250ea5d --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot/dovecot.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=Dovecot IMAP/POP3 email server | ||
3 | After=local-fs.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=simple | ||
7 | EnvironmentFile=-@SYSCONFDIR@/sysconfig/dovecot | ||
8 | ExecStart=@SBINDIR@/dovecot -F | ||
9 | ExecReload=/bin/kill -HUP $MAINPID | ||
10 | NonBlocking=yes | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
14 | |||
diff --git a/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket b/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket new file mode 100644 index 000000000..556e1a850 --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=Dovecot IMAP/POP3 email server activation socket | ||
3 | |||
4 | [Socket] | ||
5 | #dovecot expects separate IPv4 and IPv6 sockets | ||
6 | BindIPv6Only=ipv6-only | ||
7 | ListenStream=0.0.0.0:143 | ||
8 | ListenStream=[::]:143 | ||
9 | ListenStream=0.0.0.0:993 | ||
10 | ListenStream=[::]:993 | ||
11 | KeepAlive=true | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=sockets.target | ||
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb index f733a7832..82225b002 100644 --- a/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb +++ b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb | |||
@@ -7,13 +7,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b" | |||
7 | SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \ | 7 | SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \ |
8 | file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \ | 8 | file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \ |
9 | file://building-rquota_xdr.c-depend-on-rquota.h.patch \ | 9 | file://building-rquota_xdr.c-depend-on-rquota.h.patch \ |
10 | " | 10 | file://dovecot.service \ |
11 | file://dovecot.socket" | ||
12 | |||
11 | SRC_URI[md5sum] = "037e9c9e07d9dbff54dcff09f280fc8c" | 13 | SRC_URI[md5sum] = "037e9c9e07d9dbff54dcff09f280fc8c" |
12 | SRC_URI[sha256sum] = "75592483d40dc4f76cc3b41af40caa4be80478946a699d46846d5d03e4d2e09b" | 14 | SRC_URI[sha256sum] = "75592483d40dc4f76cc3b41af40caa4be80478946a699d46846d5d03e4d2e09b" |
13 | 15 | ||
14 | DEPENDS = "openssl xz zlib bzip2 libcap" | 16 | DEPENDS = "openssl xz zlib bzip2 libcap" |
15 | 17 | ||
16 | inherit autotools pkgconfig | 18 | inherit autotools pkgconfig systemd useradd |
17 | 19 | ||
18 | PACKAGECONFIG ??= " \ | 20 | PACKAGECONFIG ??= " \ |
19 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | 21 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ |
@@ -37,7 +39,25 @@ CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \ | |||
37 | 39 | ||
38 | # hardcode epoll() to avoid running unsafe tests | 40 | # hardcode epoll() to avoid running unsafe tests |
39 | # BSD needs kqueue and uclibc poll() | 41 | # BSD needs kqueue and uclibc poll() |
40 | EXTRA_OECONF = " --with-ioloop=epoll" | 42 | EXTRA_OECONF = " --with-ioloop=epoll \ |
43 | --with-systemdsystemunitdir=${systemd_unitdir}/system" | ||
44 | |||
45 | SYSTEMD_PACKAGES = "${PN}" | ||
46 | SYSTEMD_SERVICE_${PN} = "dovecot.service dovecot.socket" | ||
47 | SYSTEMD_AUTO_ENABLE = "disable" | ||
48 | |||
49 | do_install_append () { | ||
50 | install -d 755 ${D}/etc/dovecot | ||
51 | touch 644 ${D}/etc/dovecot/dovecot.conf | ||
52 | install -m 0644 ${WORKDIR}/dovecot.service ${D}${systemd_unitdir}/system | ||
53 | sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/dovecot.service | ||
54 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/dovecot.service | ||
55 | } | ||
56 | |||
57 | USERADD_PACKAGES = "${PN}" | ||
58 | USERADD_PARAM_${PN} = "-r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovecot dovecot; \ | ||
59 | -r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovenull dovenull" | ||
60 | GROUPADD_PARAM_${PN} = "-f -r dovecot;-f -r dovenull" | ||
41 | 61 | ||
42 | FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a" | 62 | FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a" |
43 | FILES_${PN}-dev += "${libdir}/dovecot/*.so" | 63 | FILES_${PN}-dev += "${libdir}/dovecot/*.so" |