Browse code

use environment settings in nfs-server and nfs-mountd service

Change-Id: I7d6a02f8d62fefa4671f5854a6cc700d5c07e24f
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3448
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

Priyesh Padmavilasom authored on 2017/08/09 04:44:27
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+[Unit]
1
+Description=NFS Mount Daemon
2
+DefaultDependencies=no
3
+Requires=proc-fs-nfsd.mount
4
+After=proc-fs-nfsd.mount
5
+After=network.target local-fs.target
6
+BindsTo=nfs-server.service
7
+
8
+[Service]
9
+Type=forking
10
+EnvironmentFile=/etc/default/nfs-utils
11
+ExecStart=/usr/sbin/rpc.mountd $MOUNTD_OPTS
0 12
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+[Unit]
1
+Description=NFS server and services
2
+DefaultDependencies=no
3
+Requires= network.target proc-fs-nfsd.mount
4
+Requires= nfs-mountd.service
5
+Wants=rpcbind.socket
6
+Wants=rpc-statd.service nfs-idmapd.service
7
+Wants=rpc-statd-notify.service
8
+
9
+After= local-fs.target
10
+After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
11
+After= nfs-idmapd.service rpc-statd.service
12
+Before= rpc-statd-notify.service
13
+
14
+[Service]
15
+Type=oneshot
16
+RemainAfterExit=yes
17
+EnvironmentFile=/etc/default/nfs-utils
18
+ExecStartPre=/usr/sbin/exportfs -r
19
+ExecStart=/usr/sbin/rpc.nfsd $NFSD_OPTS
20
+ExecStop=/usr/sbin/rpc.nfsd 0
21
+ExecStopPost=/usr/sbin/exportfs -au
22
+ExecStopPost=/usr/sbin/exportfs -f
23
+
24
+ExecReload=/usr/sbin/exportfs -r
25
+
26
+[Install]
27
+WantedBy=multi-user.target
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        NFS client utils
2 2
 Name:           nfs-utils
3 3
 Version:        2.1.1
4
-Release:        2%{?dist}
4
+Release:        3%{?dist}
5 5
 License:        GPLv2+
6 6
 URL:            http://sourceforge.net/projects/nfs
7 7
 Group:          Applications/Nfs-utils-client
... ...
@@ -12,6 +12,8 @@ Source2:        nfs-client.target
12 12
 Source3:        rpc-statd.service
13 13
 Source4:        rpc-statd-notify.service
14 14
 Source5:        nfs-utils.defaults
15
+Source6:        nfs-server.service
16
+Source7:        nfs-mountd.service
15 17
 Vendor:         VMware, Inc.
16 18
 Distribution:   Photon
17 19
 BuildRequires:  krb5
... ...
@@ -56,9 +58,9 @@ install -m644 %{SOURCE2} %{buildroot}/lib/systemd/system/
56 56
 install -m644 %{SOURCE3} %{buildroot}/lib/systemd/system/
57 57
 install -m644 %{SOURCE4} %{buildroot}/lib/systemd/system/
58 58
 install -m644 %{SOURCE5} %{buildroot}/etc/default/nfs-utils
59
-install -m644 systemd/nfs-server.service %{buildroot}/lib/systemd/system/
59
+install -m644 %{SOURCE6} %{buildroot}/lib/systemd/system/
60 60
 install -m644 systemd/proc-fs-nfsd.mount %{buildroot}/lib/systemd/system/
61
-install -m644 systemd/nfs-mountd.service %{buildroot}/lib/systemd/system/
61
+install -m644 %{SOURCE7} %{buildroot}/lib/systemd/system/
62 62
 
63 63
 %files
64 64
 %defattr(-,root,root)
... ...
@@ -71,6 +73,9 @@ install -m644 systemd/nfs-mountd.service %{buildroot}/lib/systemd/system/
71 71
 /lib/systemd/system/*
72 72
 
73 73
 %changelog
74
+*   Tue Aug 8 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.1-3
75
+-   Alter nfs-server and nfs-mountd service files to use
76
+-   environment file and port opts.
74 77
 *   Tue May 23 2017 Xiaolin Li <xiaolinl@vmware.com> 2.1.1-2
75 78
 -   Build with python3.
76 79
 *   Sat Apr 15 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.1-1