Skip to content

Commit

Permalink
disable unused services for SMB and NFS
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Feb 23, 2018
1 parent d3c7354 commit e3a19b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions etc/nextcloudpi-config.d/NFS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install()
apt-get update
apt-get install --no-install-recommends -y nfs-kernel-server
systemctl disable nfs-kernel-server
systemctl mask nfs-blkmap

cat > /etc/systemd/system/nfs-common.services <<EOF
[Unit]
Expand Down
12 changes: 11 additions & 1 deletion etc/nextcloudpi-config.d/samba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ install()
apt-get update
apt-get install --no-install-recommends -y samba
update-rc.d smbd disable
update-rc.d nmbd disable

# the directory needs to be recreated if we are using nc-ramlogs
grep -q mkdir /etc/init.d/smbd || sed -i "/\<start)/amkdir -p /var/log/samba" /etc/init.d/smbd
Expand All @@ -47,7 +48,13 @@ EOF

configure()
{
[[ $ACTIVE_ != "yes" ]] && { service smbd stop; update-rc.d smbd disable; echo "SMB disabled"; return; }
[[ $ACTIVE_ != "yes" ]] && {
service smbd stop
update-rc.d smbd disable
update-rc.d nmbd disable
echo "SMB disabled"
return
}

# CHECKS
################################
Expand Down Expand Up @@ -107,6 +114,9 @@ EOF
update-rc.d smbd enable
service smbd start

update-rc.d nmbd enable
service nmbd start

echo "SMB enabled"
}

Expand Down
5 changes: 5 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ EOF
systemctl start nc-provisioning
}

# adjust services
systemctl mask nfs-blkmap
grep -q '^ACTIVE_=yes$' /usr/local/etc/nextcloudpi-config.d/samba.sh || \
update-rc.d nmbd disable

} # end - only live updates

exit 0
Expand Down

0 comments on commit e3a19b9

Please sign in to comment.