Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > d1e507ceb705c9c00262d2e9c7e0e795 > files > 83

acua-3.03-4mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>ACUA HOWTO</title>
</head>
<body background=back.gif bgcolor=White link=Blue vlink=Black alink=Black>
<h1><center>ACUA HOWTO</center></h1>
<hr size=5>
<br>
<br>
It has occurred to me that the package has become a <i>tad</i> complicated as it has become more powerful.  I think it will be very useful to provide concrete examples of how to accomplish specific objectives using the package.  One thing to note is that the answers given here do not tell you <b>everything</b> you need to do -- only information specific to answering the question at hand is given.  In other words, don't think of this <b>HOWTO</b> as a substitute for the documentation -- it is intended to <b>supplement</b> the documentation.<br>
<br>
<hr>
<br>
<h2>Q.</h2>
Our school has a 16-modem dial-up.  Access is provided free of charge to faculty and students.  The only restrictions we want to impose are as follows:<br>
<ul>
<li>A user who has been online for 2 hours in the day is not <i>necessarily</i> allowed to be online when all the lines are busy.</li>
<li>Faculty/staff are vastly more important than students, so we want to give them priority.  To be precise: if all lines are busy, and there are both faculty and students online who have used their 2 "guaranteed" hours, we will kick a student off the dial-up and not a faculty member.</li>
</ul>
<h2>A.</h2>
In <b>acua.config</b>, enable (uncomment):<br>
<ul>
<li>MaxKick</li>
<li>SmartBoot</li>
<li>SessionSmartBoot</li>
<li>IdleSmartBoot</li>
</ul>
In <a href="acua_addUser.html">acua_adduser</a>, set<br>
<ul>
<li>DEFAULT_EXPIRY=0</li>
<li>DEFAULT_TLIMIT=120</li>
<li>DEFAULT_SLIMIT=120</li>
<li>DEFAULT_PRIORITY=4</li>
</ul>
then create users with<br>
<ul>
<a href="acua_addUser.html">acua addUser</a> &lt;login></b>
</ul>
If you are creating a faculty user, you will need to modify their priority to make it higher than the default (students').  You can do this with:<br>
<ul>
<a href="acua_modRec.html">acua modRec</a> &lt;login> priority = 5<br>
</ul>
Get cron to run <a href="acua_renew.html">acua renew</a> nightly.<br>
<br>

<hr>
<br>
<h2>Q.</h2>
I want to sell a certain type of account where access during "prime-time" is restricted.  I.e. the affected users will only be guaranteed a total of 30 minutes between 7pm and 10pm Mon-Fri.  However, I don't want any users to be kicked off solely because of this restriction unless all lines are busy.<br>
<h2>A.</h2>
In the default acua.config, time class 2 is defined as 7-10pm Mon-Fri.  To modify an account to have a 30-minute time limit during this time class, you can do:<br>
<ul>
<a href="acua_modRec.html">acua modRec</a> &lt;login> cLeft 2 = 30<br>
<a href="acua_modRec.html">acua modRec</a> &lt;login> cLimit 2 = 30<br>
</ul>
To avoid kicking users off <b><i>solely</i></b> because of this time class limit unless the system is busy you should ensure the following are enabled (uncommented) in acua.config:<br>
<ul>
<li>MaxKick</li>
<li>TimeClassSmartBoot</li>
</ul>
Every night get cron to refresh time class limits with:<br>
<ul>
<a href="acua renew.html">acua renew</a> -c<br>
</ul>

<hr>
<br>
<h2>Q.</h2>
[ from <a href="mailto:allen@gist.net.au">Allen Bolderoff</a> ]<br>
<br>
How do I accomplish the following subscription plan?<br>
<br>
"A user begins the month with 0 minutes in their time bank.  Each day, 60 minutes are added to their time bank, with the restriction that no more than 4 hours may be accumulated in a user's time bank.  A user is free to use the accumulated time as they see fit."
<br>
<h2>A.</h2>
In the default <b>acua.config</b>, time class 0 is "all day, every day".  We will make use of this time class in implementing this subscription plan.<br>
<br>
Subscribe a user to this plan with something like:<br>
<br>
<ul>
<a href="acua subscribe.html">acua subscribe</a> &lt;login> 30d 240<br>
<a href="acua_modRec.html">acua modRec</a> &lt;login> tLeft = 0<br>
<a href="acua_modRec.html">acua modRec</a> &lt;login> +0<br>
</ul>
Now the fun part - every day we want to add an hour to their <b><i>time bank</i></b>, without allowing the accumulated time to grow beyond 4 hours.  This can be accomplished by getting cron to do the following every night:<br>
<br>
Add 1 hour to the appropriate users' <b><i>time bank</i></b>.<br>
<ul>
<a href="acua_forEach.html">acua forEach</a> -r 0 <a href="acua_modRec.html">acua modRec</a> -s "{}" tLeft += 60<br>
</ul>
Simple!  :)  Notice that the <b>-s</b> switch was passed to <a href="acua_modRec.html">acua modRec</a> -- this allows an easy way to ensure that the time accumulated does not grow beyond 4 hours.<br>
<br>

<hr>
<br>
<h2>Q.</h2>
I want ACUA to enforce a daily time limit <b><i>and</i></b> a monthly time limit.  How can I do this?
<h2>A.</h2>
Suppose you want user <b>gump</b> to have a time limit of 900 minutes for the month, and 60 minutes for the day.  You could accomplish this as follows:<br>
<br>
<ul>
<a href="acua_addRec.html">acua addRec</a> gump 0 900 -1 4 0 60<br>
</ul>
Notice that <b>gump</b> was given a 60-minute time limit for time class 0.  Time class 0, in the default <b>acua.config</b> means "all the time".  This means that whenever <b>gump</b> is online, time will be deducted from this 60-minute limit.  This daily time limit is refreshed by doing the following out of root's daily crontab:<br>
<ul>
<a href="acua_renew.html">acua renew</a> -c<br>
</ul>
The time remaining for the monthly time limit is refreshed by doing a complete renewal out of root's monthly crontab:
<ul>
<a href="acua renew.html">acua renew</a><br>
</ul>

<hr>
<br>
<h2>Q.</h2>
I have multiple dial-up servers.  How well can <b>ACUA</b> cope with this?
<h2>A.</h2>
Very well.  The current method is to have "/usr/lib/acua" NFS mounted on each dial-up server.  NFS-compatible file locking is used when accessing the <b>acua_users</b> file.  If you don't want each machine to use the same <b>acua.config</b>, you can just make a symlink like:<br>
<ul>
<b><i>/usr/lib/acua/acua.config -> /etc/acua.config</i></b>
</ul>
Then the dial-up servers can NFS-share /usr/lib/acua without sharing <b>acua.config</b>.<br>
<br>

<hr>
<br>
<h2>Q.</h2>
How well does <b>ACUA</b> work with mgetty's <b><i>AutoPPP</i></b> feature?
<h2>A.</h2>
Very well.  Insert the following into your <b>ip-up</b> script:<br>
<ul>
if [ "$6" != "1" ]; then<br>
<ul>
/usr/sbin/<a href="acua_login.html">acua_login</a> &lt; $2 || {<br>
  <ul>
  kill -HUP $PPID<br>
  exit<br>
  </ul>
}<br>
</ul>
fi
</ul>
<a href="acua_login.html">acua_login</a> will determine the calling user's UID based on the terminal device.<br>
<br>
<b>NOTE:</b> When a user starts PPP manually from the shell, the arguments "ipparam 1" should be passed into pppd in order to prevent <a href="acua_login.html">acua_login</a> from being called a second time.<br>
<br>

<hr>
<br>
<h2>Q.</h2>
[ from <a href="mailto:spoons@midland.co.nz">James Spooner</a> ]<br>
<br>
I am trying to arrange four different accounts...<br>
<br>
Heavy Surfer: $40/month for max. 80 hours off peak, 20 hours peak-time.<br>
<br>
Light Surfer: $35/month for max. 80 hours off peak.<br>
<br>
Weekend Surfer: $30/month for max. 60 hours weekend traffic.<br>
<br>
Weekday Surfer: $30/month for max. 100 hours weekday traffic.<br>
<br>
Is this possible?<br>
<h2>A.</h2>
This, and much more is possible ;-].  To support these account types, we'll need the following time classes:<br>
<ul>
<li>Time class 0 = "weekdays" = 1-5:0-24</li>
<li>Time class 1 = "weekends" = 6-0:0-24</li>
<li>Time class 2 = "prime-time" = 0-6:19-22 (or whatever you like)</li>
</ul>
User accounts should be created in a de-activated state with:<br>
<ul>
<a href="acua_addRec.html">acua addRec</a> &lt;login> 0 0<br>
</ul>
Here is how we could handle each type of user:<br>
<br>
Heavy Surfers get 100 hours, of which 80 may be prime-time hours:<br>
<ul>
<a href="acua_subscribe.html">acua subscribe</a> &lt;login> 30d 6000 -1 4 -1 -1 4800<br>
</ul>
Light Surfers get 80 off-peak hours:
<ul>
<a href="acua_subscribe.html">acua subscribe</a> &lt;login> 30d 4800 -1 4 -1 -1 0<br>
</ul>
Weekend Surfers get 60 weekend hours:
<ul>
<a href="acua_subscribe.html">acua subscribe</a> &lt;login> 30d 3600 -1 4 0<br>
</ul>
Weekday Surfers get 100 weekday hours:
<ul>
<a href="acua_subscribe.html">acua subscribe</a> &lt;login> 30d 6000 -1 4 -1 0<br>
</ul>
Normally, I suggest that a "<a href="acua_renew.html">acua renew</a> -c" be done nightly, but in your case that would not work.  Time class limits should never be renewed in this configuration.<br>
<br>
<br>

<hr size=5>
<address><a href="mailto:acua@acua.ebbs.com.au">Robert Davidson</a></address>
<!-- Created: Tue Mar 11 14:47:17 CST 1997 -->
<!-- hhmts start -->
Last modified: Sat Dec 16 14:19:23 EST 2000
<!-- hhmts end -->
</body>
</html>