summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorChong.Lu@windriver.com <Chong.Lu@windriver.com>2014-09-29 16:22:54 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-10-16 07:00:59 +0200
commit91939fda6ba7546d2e24730a1a225691015231b6 (patch)
tree9718f23775733883d8026a1144a43a5a4542795d /meta-oe
parentd1951db22a9971a1bb7cf25810ec3bdc9669a6f1 (diff)
downloadmeta-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.inc32
-rw-r--r--meta-oe/recipes-connectivity/samba/samba/nmb.service12
-rw-r--r--meta-oe/recipes-connectivity/samba/samba/smb.service13
-rw-r--r--meta-oe/recipes-connectivity/samba/samba/winbind.service12
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
13S = "${WORKDIR}/samba-${PV}/source" 16S = "${WORKDIR}/samba-${PV}/source"
14 17
15inherit autotools-brokensep update-rc.d 18inherit autotools-brokensep update-rc.d systemd
19
20SYSTEMD_PACKAGES = "${PN} winbind"
21SYSTEMD_SERVICE_${PN} = "nmb.service smb.service"
22SYSTEMD_SERVICE_winbind = "winbind.service"
16 23
17SAMBAMMAP = "no" 24SAMBAMMAP = "no"
18SAMBAMMAP_libc-glibc = "yes" 25SAMBAMMAP_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
128DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}"
129pkg_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
108pkg_postinst_libnss-winbind () { 138pkg_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]
2Description=Samba NMB Daemon
3After=syslog.target network.target
4
5[Service]
6Type=forking
7PIDFile=/var/run/nmbd.pid
8ExecStart=@SBINDIR@/nmbd
9ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
10
11[Install]
12WantedBy=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]
2Description=Samba SMB Daemon
3After=syslog.target network.target nmb.service winbind.service
4
5[Service]
6Type=forking
7PIDFile=/var/run/smbd.pid
8LimitNOFILE=16384
9ExecStart=@SBINDIR@/smbd
10ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
11
12[Install]
13WantedBy=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 @@
1i[Unit]
2Description=Samba Winbind Daemon
3After=syslog.target network.target nmb.service
4
5[Service]
6Type=forking
7PIDFile=/var/run/winbindd.pid
8ExecStart=@SBINDIR@/winbindd
9ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
10
11[Install]
12WantedBy=multi-user.target