Server Help

ASSS Questions - Simple mutli-zone setup

Mine GO BOOM - Wed Jul 07, 2004 3:13 pm
Post subject: Simple mutli-zone setup
Was thinking about a way in which ASSS could be done nicely with things like portage or pacman, and figured that a nice way to be able to support multiple zone setups on one machine, with the same ASSS executables, would be to have ASSS work out of the home folder by default.

Example: ASSS would be in /usr/bin, while the modules would be where ever is a good place to store them, with default configuration files and what not. When a user runs ASSS, it first checks the ~/asss folder. If it doesn't exist, will run a simple setup prompt for the user, where they can enter first-time things like zone name, port, etc. In the asss folder would be everything that is now normal, except won't have the ASSS executable, and the bin folder would be empty (or symlinks).

So for each zone, a server could setup a new user. Should allow for some variable, like ASSSROOT, in which you can point to a different location for your zone.

This will allow for people to keep simple updates to the core ASSS files if their distro supports a central system, like portage or pacman.
i88gerbils - Wed Jul 07, 2004 5:55 pm
Post subject:
Wouldn't it be better to keep the bin folder together, and then make /sbin/asss or /usr/bin/asss a link back to the asss folder?

Currently, I've got it arranged like /usr/local/SubSpace/asss where asss is a symlink to the current asss version folder.

you could make a shell script that does this in a roundabout way. Perhaps even using useradd -G $ZONENAME -d /home/$ZONENAME -p password username to forgo the process of creating a user for the zone. And then after creating the arena directory, ln -s $ASSHOME/arenas/$ZONENAME /home/$ZONENAME/.asss or whatever. It could also copy out default settings.

[edit]
This should work for now :d. Though it'd be better to make some more checks like if ap_multipub is enabled, and then add the $ZONEDIR to the public arena list.

Alhough this is more user-friendly I'd like command-line parameters instead.

Code: Show/Hide
#!/bin/sh
# ASSS Zone Setup - v.01
#
# need to have the correct permissions to run various programs (i.e. root)
#
# ASSS Home Directory  (e.g. /usr/local/asss-1.1.7)

ASSSHOME="/usr/local/games/SubSpace/asss"
   
echo
echo "ASSS Zone Setup - v.01"
echo
     
LOOPCHECK='n'
   
while [ $LOOPCHECK = 'n' ];
do

  echo "Directory for the zone (e.g. pb, aswz, or elim):"
  read ZONEDIR

  echo
  echo "Username for zone administrator (e.g. gerbil):"
  read USRNAME


  echo
  echo "Zone Directory: $ASSSHOME/$ZONEDIR"
  echo "Login: $USRNAME"
    echo "Is this information correct? (y or n)"
    read LOOPCHECK

  MIDCHECK=0

  while [ $MIDCHECK -eq 0 ];
  do
    case "$LOOPCHECK" in
    y | Y) MIDCHECK=1;;
    n | N) MIDCHECK=1;;
    *)
     echo
     echo "Please enter a choice (y or n):"
     read LOOPCHECK;;
    esac
  done
 
done
 
echo
echo "To add zone now, press ENTER."
echo "To cancel, press Control-C."
read cont < /dev/tty
  # zone directory
mkdir $ASSHOME/arenas/$ZONEDIR
     
# user and group add
groupadd $ZONEDIR
useradd -G $ZONEDIR -d /home/$USRNAME $USRNAME
 
# permissions
chgrp $ZONEDIR $ASSSHOME/arenas/$ZONEDIR
chown $USRNAME $ASSSHOME/arenas/$ZONEDIR

# symlink from home directory
ln -s $ASSSHOME/arenas/$ZONEDIR /home/$USRNAME/$ZONEDIR

echo "Zone Setup Complete"
echo
echo "Password for $USRNAME:"
passwd $USRNAME

Jackmn - Thu Jul 08, 2004 10:20 pm
Post subject:
I really prefer just symlinking to the ASSS directory, as I88 said.
Mine GO BOOM - Thu Jul 08, 2004 10:59 pm
Post subject:
I did intend to mean that, as this week I'm running very low on energy, as I've been working fucked up hours all week long, and will be doing so for the next few weeks. This thought only came to me as I'm attempting to fall asleep, so it isn't all completely worked out, but I'm sure Grelminar or whomever could expand on it nicely as you guys have.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group