You are not logged in.

#1 2005-06-15 06:40:41

midas
Member
Registered: 2005-06-08
Posts: 12
Website

Local Repository- hosts.allow help

I have several machines on a local network, and so to save tons of time and bandwidth, I created a local repository on a master arch machine.

This quick howto is cleaned up by me.. it is based on the arch wiki page here.

server 192.168.15.120
client 192.168.15.121

1. serverside
on your server create an nfs share readwrite for all pc on your lan

$ pacman -S portmap
$ pacman -S nfs-utils

edit /etc/exports to include share

$ echo "/var/cache/pacman/pkg  192.168.15.0/255.255.255.0(rw,no_root_squash,sync)" >> /etc/exports

add portmap, netfs, nfslock and nfsd to DAEMONS in /etc/rc.conf
reboot or run these commands

$  /etc/rc.d/portmap restart
$  /etc/rc.d/nfslock restart
$  /etc/rc.d/nfsd restart
$  /etc/rc.d/netfs restart

To check the nfsshare
$ exportfs
$ rpcinfo -p 192.168.10.120


2. on all clients-

$ mv /var/cache/pacman/pkg /var/cache/pacman/pkgorg
$ mkdir /var/cache/pacman/pkg

$ mount -o rw,nolock 192.168.15.121:/var/cache/pacman/pkg /var/cache/pacman/pkg
or if you want it to mount automatically
$ echo "192.168.15.120:/var/cache/pacman/pkg /var/cache/pacman/pkg    nfs    rw,nolock" >> /etc/fstab
to mount
$ mount -a

Check mount
$ df -ah

edit /etc/pacman.conf to look like this
[code=]
[current]
Server = file:///var/cache/pacman/pkg
Include = /etc/pacman.d/current

[extra]
Server = file:///var/cache/pacman/pkg
Include = /etc/pacman.d/extra
[/code]

$ touch /bin/alsync
edit to look like the following
[code]
#!/bin/bash
cd /var/cache/pacman/pkg
wget -N ftp://ftp.archlinux.org/current/os/i686/current.db.tar.gz
wget -N ftp://ftp.archlinux.org/extra/os/i686/extra.db.tar.gz
[/code]

$ chmod 777 /bin/alsync

Copy /bin/alsync to your client computers.


3. Starting the process on client computer

$ alsync
$ pacman -Syu
$ pacman -S anypcknamehere


My problem came when trying to mount the share.  I would get the message [code]mount: RPC: program not registered[/code]

I changed the servers /etc/hosts.deny from [code]ALL: ALL: DENY[/code] to [code]#ALL: ALL: DENY[/code] and then it worked.


QUESTION: How can I only allow hosts on my 192.168.15.0 network to access the share?

QUESTION: How can I setup hosts.deny or hosts.allow to automatically run the alsync script?-- this will make sure that my client computers are syncing with an updated current and extra database.

Offline

#2 2005-06-15 07:13:30

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: Local Repository- hosts.allow help

Sorry you had the trouble. Don't know if this will work since I have never setup Arch this way before but this is how I setup my sshd.
Try editing the /etc/hosts.allow file to this:

ALL: 192.168.15.0

and change your /etc/hosts.deny back to:

ALL: ALL: DENY

This should keep everyone out that does not have the ip address 192.168.15.0

Offline

#3 2005-06-15 07:59:18

midas
Member
Registered: 2005-06-08
Posts: 12
Website

Re: Local Repository- hosts.allow help

QUESTION:  How would I specify the network 192.168.15.0/24?

QUESTION:  How can I set it up so that I can run a custom shell script when an instance in hosts.deny happens?

QUESTION:  Is SFS a better solution than NFS?

Offline

#4 2005-06-15 10:58:04

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: Local Repository- hosts.allow help

1. 192.168.15.0/255.255.255.0
2. Not sure what you mean here. Do you want alsync to run on the client every time a pacman command is issued? Might be easier to run it as a cron job.
3. Don't know about SFS - must look it up...

Offline

#5 2005-06-15 14:03:13

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: Local Repository- hosts.allow help

QUESTION: How would I specify the network 192.168.15.0/24?

To use a range of ip addresses use:

# hosts.allow
ALL: starting ip/ending ip

QUESTION: How can I set it up so that I can run a custom shell script when an instance in hosts.deny happens?

Never tried this, but I found out through google http://www.geekcomix.com/cgi-bin/classn … e_Firewall :

# hosts.deny
ALL: ALL: spawn=programname & deny

QUESTION: Is SFS a better solution than NFS?

Don't know this either but you can check out this website that compares various filesystems:
http://www.lugatgt.org/articles/nfs/

Offline

#6 2005-06-16 01:09:17

midas
Member
Registered: 2005-06-08
Posts: 12
Website

Re: Local Repository- hosts.allow help

Ok, thats enough of that kind of help.

I appreciate it your comments, but they have gotten me nowhere, I figured some poweruser would have a couple config files handy.. but this is the newbie forum.

Anyways I'm done using the local repository for today, so no rush.

Offline

#7 2005-06-16 19:15:59

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: Local Repository- hosts.allow help

Apologies that our answers did not live up to your expectations  lol

Offline

#8 2005-06-27 00:17:14

midas
Member
Registered: 2005-06-08
Posts: 12
Website

Re: Local Repository- hosts.allow help

Thats ok, I didn't mean it like that guys..

Its a stupid question anyway, I mean, this is basic *nix that I'm asking about, I was just to busy to find the answer myself.  I figured other people using this would already have an easy solution specific to the best distro ever.. archlinux.

Any help is apprecitated, sorry for being rude before-- wink

Offline

Board footer

Powered by FluxBB