User Tools

Site Tools


linux:arch_home_directories

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:arch_home_directories [2014/09/22 23:00]
walter [Daemons]
linux:arch_home_directories [2021/05/02 21:36] (current)
Line 1: Line 1:
 +====== Home Directories on Arch Linux ======
 +
 ====== Client Config ====== ====== Client Config ======
  
Line 5: Line 7:
 Install Required Packages ​ Install Required Packages ​
 <​code>​ <​code>​
-pacman -S rpcbind nfs-utils nfsidmap ​ntp+pacman -S rpcbind nfs-utils nfsidmap
 </​code>​ </​code>​
  
Line 20: Line 22:
 </​file>​ </​file>​
 <​file|/​etc/​fstab>​ <​file|/​etc/​fstab>​
-172.29.0.6:/​nfs-dir /​mount-point nfs4 rw,hard,intr 0 0+172.29.0.6:/​nfs-dir /​mount-point nfs4 rw,hard,defaults ​0 0
 </​file>​ </​file>​
-<​file|/​etc/​ntp.conf> +<​file|/​etc/​systemd/​timesyncd.conf> 
-# The NFS Server +[Time] 
-server ​172.29.0.6 ​iburst +NTP=172.29.0.6 ​172.29.0.
- +FallbackNTP=0.us.pool.ntp.org ​1.us.pool.ntp.org 2.us.pool.ntp.org
-# Only allow read-only access from localhost +
-restrict default ignore +
-restrict 127.0.0.1 +
-restrict 172.29.0.6 mask 255.255.255.255+
 </​file>​ </​file>​
  
Line 38: Line 36:
   * rpcbind   * rpcbind
   * nfs-common   * nfs-common
-  * nptd+  * systemd-timesyncd (timedatectl set-ntp true)
  
 Start rpcbind then nfs-common, then you will be able to mount the nfs directories,​ add these entries to rc.conf in the daemons array after the network/​net-profiles entries. Start rpcbind then nfs-common, then you will be able to mount the nfs directories,​ add these entries to rc.conf in the daemons array after the network/​net-profiles entries.
Line 51: Line 49:
 Install Required Packages ​ Install Required Packages ​
 <​code>​ <​code>​
-pacman -S rpcbind nfs-utils nfsidmap+pacman -S rpcbind nfs-utils nfsidmap ​openntpd
 </​code>​ </​code>​
  
Line 58: Line 56:
 Change the lines in these files to the values defined. Change the lines in these files to the values defined.
  
-<​file|/​etc/​idmapd.conf>​ +
-Domain = acm.cs +
-</​file>​ +
-<​file|/​etc/​conf.d/​nfs-common>​ +
-NEED_IDMAPD="​yes"​ +
-</​file>​+
 The number of nfsd threads in increased from the default to improve preformance. The number of nfsd threads in increased from the default to improve preformance.
 <​file|/​etc/​conf.d/​nfs-server>​ <​file|/​etc/​conf.d/​nfs-server>​
Line 70: Line 63:
 </​file>​ </​file>​
 Configure the NTP server to sync against the US NTP pool and make sure that clients on the LAN have access Configure the NTP server to sync against the US NTP pool and make sure that clients on the LAN have access
-<​file|/​etc/​ntp.conf> +<​file|/​etc/​ntpd.conf> 
-server 0.us.pool.ntp.org iburst +sample ntpd configuration filesee ntpd.conf(5)
-server 1.us.pool.ntp.org iburst +
-server 2.us.pool.ntp.org iburst +
-server 3.us.pool.ntp.org iburst +
-#This next part will make it sync the time from the internal clock if it can't get out to the internet +
-#The time may be wrongbut clients on the LAN will still be sync'd with the server preventing shews with NFS served files +
-server 127.127.1.0  +
-fudge  127.127.1.0 stratum 10+
  
-you should not need to modify the following paths +Addresses ​to listen on (ntpd does not listen by default) 
-driftfile /​var/​lib/​ntp/​ntp.drift +listen on 0.0.0.0
-logfile /​var/​log/​ntp.log+
  
-If you want to deny all machines (including your own) +sync to a single server 
-from accessing the NTP server, uncomment:​ +#​server ​ntp.example.org
-restrict default nomodify nopeer notrap noquery+
  
- +use a random selection of NTP Pool Time Servers 
-To deny other machines from changing the +see http://support.ntp.org/​bin/​view/​Servers/​NTPPoolServers 
-configuration but allow localhost: +servers ​us.pool.ntp.org
-#restrict default nomodify nopeer +
-restrict 127.0.0.1 +
- +
-restrict 0.us.pool.ntp.org ​mask 255.255.255.255 nomodify notrap noquery +
-restrict 1.us.pool.ntp.org ​mask 255.255.255.255 nomodify notrap noquery +
-restrict 2.us.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery +
-restrict 3.us.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery +
- +
-# To allow machines within your network to synchronize +
-# their clocks with your server, but ensure they are +
-# not allowed to configure the server or used as peers +
-# to synchronize against, uncomment this line. +
-+
-restrict 172.29.0.0 mask 255.255.255.0 nomodify notrap+
 </​file>​ </​file>​
  
Line 121: Line 91:
   * nfs-client.target   * nfs-client.target
   * nfs-server.service   * nfs-server.service
-  * nptd.service+  * opennptd.service
  
 Start rpcbind, then nfs-common, and then nfs-server, then you will be able to mount the nfs directories,​ add these entries to rc.conf in the daemons array after the network/​net-profiles entries. Start rpcbind, then nfs-common, and then nfs-server, then you will be able to mount the nfs directories,​ add these entries to rc.conf in the daemons array after the network/​net-profiles entries.
Line 136: Line 106:
 </​file>​ </​file>​
  
-Copy /​var/​lib/​nfs to a separate directory called /​var/​lib/​nfs.d then add this file to /etc/rc.d and add it to the daemons line in rc.d +Copy /​var/​lib/​nfs to a separate directory called /​var/​lib/​nfs.d then add these files to setup the systemd service.
-<​file|/​etc/​rc.d/​nfsvartemp>​ +
-#​!/​bin/​bash +
-. /​etc/​rc.conf +
-. /etc/rc.d/functions+
  
-case "​$1"​ in +<file|/etc/systemd/system/nfsvartemp.service> 
- start) + 
- stat_busy '​Resetting NFS dir /var/lib/nfs' +[Unit] 
- cp -R /var/lib/nfs.d/* /​var/​lib/​nfs +Description=NFS Tempfs Setup 
- stat_done +Before=nfsd.service 
- ;; + 
-  +[Service] 
- stop) +Type=oneshot 
- stat_busy 'This does nothing'​ +ExecStart=/​usr/​local/​sbin/​nfsvartemp 
- stat_done + 
- ;; +[Install] 
- restart) +WantedBy=multi-user.target
- $0 stop +
- ;; +
-  +
- *) +
- echo "​Usage:​ $0 {start|stop|restart}"​ +
-esac+
  
 </​file>​ </​file>​
  
 +<​file|/​usr/​local/​sbin/​nfsvartemp>​
 +#!/bin/bash
 +cp -R /​var/​lib/​nfs.d/​* /​var/​lib/​nfs
 +</​file>​
 +
 +Lastly
 +<​code>​
 +systemctl enable nfsvartemp.service
 +</​code>​
linux/arch_home_directories.1411426816.txt.gz · Last modified: 2021/05/02 21:36 (external edit)