forked from LibreSchool/libreschool-nfs
support for /etc/exports generation
This commit is contained in:
parent
76850f6e3c
commit
b125a36a78
@ -1,12 +1,3 @@
|
||||
%define distroversion 6.9
|
||||
%define distrorelease Final
|
||||
|
||||
%define version 0.1.3
|
||||
%define release 1
|
||||
Version: %{version}
|
||||
Release: %{release}%{?dist}
|
||||
|
||||
|
||||
Summary: LibreSchool NFS home profiles configuration
|
||||
Name: libreschool-nfs
|
||||
Version: 6.9
|
||||
@ -18,6 +9,7 @@ Source0: %{name}-%{version}.tar.gz
|
||||
Source1: COPYING
|
||||
URL: %{url_prefix}/%{name}
|
||||
Requires: libreschool-release
|
||||
Requires: nethserver-directory
|
||||
Requires: nfs-utils
|
||||
BuildRequires: nethserver-devtools
|
||||
|
||||
@ -35,19 +27,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{genfilelist} $RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist
|
||||
echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
|
||||
|
||||
|
||||
|
||||
#nota bene: con la configurazione attuale, showmount non riporta nessun mount
|
||||
#questo succede perche' showmount si appoggia a roba di NFS v2 e v3, mentre noi usiamo solo v4 e le porte per il resto sono chiuse di default
|
||||
|
||||
|
||||
%files -f %{name}-%{version}-%{release}-filelist
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post
|
||||
chkconfig nfs on
|
||||
chkconfig rpcbind on
|
||||
/sbin/service nfs start >/dev/null 2>&1 || :
|
||||
/sbin/e-smith/db configuration set nfs service \
|
||||
status enabled \
|
||||
TCPPort 2049 \
|
||||
@ -57,6 +42,22 @@ chkconfig rpcbind on
|
||||
TCPPort 111 \
|
||||
UDPPort 111 \
|
||||
access private
|
||||
/sbin/e-smith/expand-template /etc/exports
|
||||
/sbin/service nfs start >/dev/null 2>&1 || :
|
||||
/sbin/service rpcbind start >/dev/null 2>&1 || :
|
||||
/usr/sbin/exportfs -r
|
||||
/sbin/e-smith/signal-event firewall-adjust
|
||||
/usr/bin/ldapmodify -Y EXTERNAL -f /usr/share/libreschool-nfs/patch.ldif >/dev/null 2>&1 || :
|
||||
|
||||
%postun
|
||||
#if [ "$1" = 1 ]; then
|
||||
# #upgrade
|
||||
#fi
|
||||
if [ "$1" = 0 ]; then
|
||||
#uninstallation
|
||||
/sbin/e-smith/expand-template /etc/exports
|
||||
/usr/sbin/exportfs -r
|
||||
fi
|
||||
|
||||
%changelog
|
||||
* Sat Nov 4 2017 Paolo Asperti <paolo@asperti.com> - 6.9-1
|
||||
|
12
root/etc/e-smith/templates/etc/exports/50libreschool-nfs
Normal file
12
root/etc/e-smith/templates/etc/exports/50libreschool-nfs
Normal file
@ -0,0 +1,12 @@
|
||||
#
|
||||
# 50libreschool-nfs
|
||||
#
|
||||
{
|
||||
use esmith::InterfacesDB;
|
||||
my $ndb = esmith::InterfacesDB->open_ro() || return;
|
||||
my $LocalIP = $ndb->green()->prop('ipaddr') || return;
|
||||
my $LocalNM = $ndb->green()->prop('netmask') || return;
|
||||
sprintf "/var/lib/nethserver/home\t%s/%s(rw,no_root_squash,sync,no_subtree_check)\n", $LocalIP, $LocalNM;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user