ACUA HOWTO




It has occurred to me that the package has become a tad 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 everything you need to do -- only information specific to answering the question at hand is given. In other words, don't think of this HOWTO as a substitute for the documentation -- it is intended to supplement the documentation.



Q.

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:

A.

In acua.config, enable (uncomment):
In acua_adduser, set
then create users with
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:
Get cron to run acua renew nightly.



Q.

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.

A.

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:
To avoid kicking users off solely because of this time class limit unless the system is busy you should ensure the following are enabled (uncommented) in acua.config:
Every night get cron to refresh time class limits with:


Q.

[ from Allen Bolderoff ]

How do I accomplish the following subscription plan?

"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."

A.

In the default acua.config, time class 0 is "all day, every day". We will make use of this time class in implementing this subscription plan.

Subscribe a user to this plan with something like:

Now the fun part - every day we want to add an hour to their time bank, without allowing the accumulated time to grow beyond 4 hours. This can be accomplished by getting cron to do the following every night:

Add 1 hour to the appropriate users' time bank.
Simple! :) Notice that the -s switch was passed to acua modRec -- this allows an easy way to ensure that the time accumulated does not grow beyond 4 hours.



Q.

I want ACUA to enforce a daily time limit and a monthly time limit. How can I do this?

A.

Suppose you want user gump to have a time limit of 900 minutes for the month, and 60 minutes for the day. You could accomplish this as follows:

Notice that gump was given a 60-minute time limit for time class 0. Time class 0, in the default acua.config means "all the time". This means that whenever gump 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:
The time remaining for the monthly time limit is refreshed by doing a complete renewal out of root's monthly crontab:

Q.

I have multiple dial-up servers. How well can ACUA cope with this?

A.

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 acua_users file. If you don't want each machine to use the same acua.config, you can just make a symlink like:
Then the dial-up servers can NFS-share /usr/lib/acua without sharing acua.config.



Q.

How well does ACUA work with mgetty's AutoPPP feature?

A.

Very well. Insert the following into your ip-up script:
acua_login will determine the calling user's UID based on the terminal device.

NOTE: When a user starts PPP manually from the shell, the arguments "ipparam 1" should be passed into pppd in order to prevent acua_login from being called a second time.



Q.

[ from James Spooner ]

I am trying to arrange four different accounts...

Heavy Surfer: $40/month for max. 80 hours off peak, 20 hours peak-time.

Light Surfer: $35/month for max. 80 hours off peak.

Weekend Surfer: $30/month for max. 60 hours weekend traffic.

Weekday Surfer: $30/month for max. 100 hours weekday traffic.

Is this possible?

A.

This, and much more is possible ;-]. To support these account types, we'll need the following time classes:
User accounts should be created in a de-activated state with:
Here is how we could handle each type of user:

Heavy Surfers get 100 hours, of which 80 may be prime-time hours:
Light Surfers get 80 off-peak hours: Weekend Surfers get 60 weekend hours: Weekday Surfers get 100 weekday hours: Normally, I suggest that a "acua renew -c" be done nightly, but in your case that would not work. Time class limits should never be renewed in this configuration.



Robert Davidson
Last modified: Sat Dec 16 14:19:23 EST 2000