diff options
author | Chong.Lu@windriver.com <Chong.Lu@windriver.com> | 2014-09-29 16:22:54 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-10-16 07:00:59 +0200 |
commit | 91939fda6ba7546d2e24730a1a225691015231b6 (patch) | |
tree | 9718f23775733883d8026a1144a43a5a4542795d /meta-oe | |
parent | d1951db22a9971a1bb7cf25810ec3bdc9669a6f1 (diff) | |
download | meta-openembedded-91939fda6ba7546d2e24730a1a225691015231b6.tar.gz |
samba: add systemd service file
Add systemd service for samba.
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba.inc | 32 | ||||
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba/nmb.service | 12 | ||||
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba/smb.service | 13 | ||||
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba/winbind.service | 12 |
4 files changed, 68 insertions, 1 deletions
diff --git a/meta-oe/recipes-connectivity/samba/samba.inc b/meta-oe/recipes-connectivity/samba/samba.inc index 3da056223..439282166 100644 --- a/meta-oe/recipes-connectivity/samba/samba.inc +++ b/meta-oe/recipes-connectivity/samba/samba.inc | |||
@@ -8,11 +8,18 @@ SRC_URI = "http://samba.org/samba/ftp/stable/samba-${PV}.tar.gz \ | |||
8 | file://init.samba \ | 8 | file://init.samba \ |
9 | file://init.winbind \ | 9 | file://init.winbind \ |
10 | file://tdb.pc \ | 10 | file://tdb.pc \ |
11 | file://nmb.service \ | ||
12 | file://smb.service \ | ||
13 | file://winbind.service \ | ||
11 | " | 14 | " |
12 | 15 | ||
13 | S = "${WORKDIR}/samba-${PV}/source" | 16 | S = "${WORKDIR}/samba-${PV}/source" |
14 | 17 | ||
15 | inherit autotools-brokensep update-rc.d | 18 | inherit autotools-brokensep update-rc.d systemd |
19 | |||
20 | SYSTEMD_PACKAGES = "${PN} winbind" | ||
21 | SYSTEMD_SERVICE_${PN} = "nmb.service smb.service" | ||
22 | SYSTEMD_SERVICE_winbind = "winbind.service" | ||
16 | 23 | ||
17 | SAMBAMMAP = "no" | 24 | SAMBAMMAP = "no" |
18 | SAMBAMMAP_libc-glibc = "yes" | 25 | SAMBAMMAP_libc-glibc = "yes" |
@@ -103,6 +110,29 @@ do_install_append() { | |||
103 | 110 | ||
104 | # usershare mount place | 111 | # usershare mount place |
105 | mkdir -p ${D}${localstatedir}/lib/samba/usershares | 112 | mkdir -p ${D}${localstatedir}/lib/samba/usershares |
113 | |||
114 | # Remove sysinit script if sysvinit is not in DISTRO_FEATURES | ||
115 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then | ||
116 | rm -rf ${D}${sysconfdir}/init.d/ | ||
117 | fi | ||
118 | |||
119 | install -d ${D}${systemd_unitdir}/system | ||
120 | for i in nmb smb winbind; do | ||
121 | install -m 0644 ${WORKDIR}/$i.service ${D}${systemd_unitdir}/system | ||
122 | done | ||
123 | sed -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
124 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
125 | -i ${D}${systemd_unitdir}/system/*.service | ||
126 | } | ||
127 | |||
128 | DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" | ||
129 | pkg_postinst_${PN} () { | ||
130 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then | ||
131 | if [ -n "$D" ]; then | ||
132 | OPTS="--root=$D" | ||
133 | fi | ||
134 | systemctl $OPTS mask samba.service | ||
135 | fi | ||
106 | } | 136 | } |
107 | 137 | ||
108 | pkg_postinst_libnss-winbind () { | 138 | pkg_postinst_libnss-winbind () { |
diff --git a/meta-oe/recipes-connectivity/samba/samba/nmb.service b/meta-oe/recipes-connectivity/samba/samba/nmb.service new file mode 100644 index 000000000..91b997533 --- /dev/null +++ b/meta-oe/recipes-connectivity/samba/samba/nmb.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=Samba NMB Daemon | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/var/run/nmbd.pid | ||
8 | ExecStart=@SBINDIR@/nmbd | ||
9 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-connectivity/samba/samba/smb.service b/meta-oe/recipes-connectivity/samba/samba/smb.service new file mode 100644 index 000000000..bc0707a34 --- /dev/null +++ b/meta-oe/recipes-connectivity/samba/samba/smb.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=Samba SMB Daemon | ||
3 | After=syslog.target network.target nmb.service winbind.service | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/var/run/smbd.pid | ||
8 | LimitNOFILE=16384 | ||
9 | ExecStart=@SBINDIR@/smbd | ||
10 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-connectivity/samba/samba/winbind.service b/meta-oe/recipes-connectivity/samba/samba/winbind.service new file mode 100644 index 000000000..bff6fb8e1 --- /dev/null +++ b/meta-oe/recipes-connectivity/samba/samba/winbind.service | |||
@@ -0,0 +1,12 @@ | |||
1 | i[Unit] | ||
2 | Description=Samba Winbind Daemon | ||
3 | After=syslog.target network.target nmb.service | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/var/run/winbindd.pid | ||
8 | ExecStart=@SBINDIR@/winbindd | ||
9 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||