From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,223a67749392a936,start X-Google-Attributes: gid10d4db,public From: amm130@alf.usask.ca (Adam McKee) Subject: BBS-Util 1.0 Released Date: 1996/01/07 Message-ID: X-Deja-AN: 134304271 followup-to: comp.os.linux.development.apps content-type: text/plain; charset=ISO-8859-1 organization: University of Saskatchewan mime-version: 1.0 newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- As of sometime today, you should be able to get the latest-and-greatest version of BBS-Util in sunsite's Incoming directory. This version of the package implements a few suggestions made by users of 0.9, and includes a few minor internal cleanups. The code is pretty simple, but it is possible I broke something when I was "cleaning it up". If I did break something, let me know and it'll be fixed right away. I'll save myself some typing, and just include the README: BBS-Util v1.0 for Linux by Adam McKee BBS-Util is a package designed to solve the basic problems associated with administrating a BBS on a Linux system. The functionality provided by the package is as follows: - account management - enforcing time limits - subscriptions (temporarily increased time limit) - providing account status information to root and users BBS-Util will _seldom_ offer a complete solution. It is designed only to meet your _administrative_ needs. You'll probably want to look into using lynx or something else as an interface for users who are not comfortable with the shell. Here is a quick summary of each utility: - --- Programs Used by Users ---------------------------------------------------- timeleft: Tells users how much time they have left before they will be booted from the system (i.e. all their processes killed with extreme prejudice ;-). daysleft: Tells users how many days they have left before their account expires. Upon expiration, an account may be either deleted or unsubscribed. (see user_renew, user_subscribe, user_unsubscribe) - --- Programs Used by Administrator -------------------------------------------- user_add : This is just a shell script that calls system-native programs to set up an account, then calls user_addrec to create a record in the BBS user database. user_addrec : Creates a record in the BBS user database. specifies the # of days the account should be allowed to exist (0 -> forever), and is the # of mins/day the user should get. You shouldn't run this directly unless you know what you are doing. user_del : A shell script that calls a system-native program to delete a user account, then calls user_delrec to remove the corresponding record in the BBS user database. user_delrec : Deletes a record from the BBS user database. This is normally run from user_del, and you shouldn't run it directly unless you know what you're doing. user_data : Shows BBS user record in a readable format. user_kick : Give a user the boot (i.e. kill all of their processes). user_purge : Remove accounts which have not been used in a certain # of days. The argument must be > 14, or the program will terminate with an error message. user_renew: At midnight (or some other time), it is necessary to renew each users's time. This is done by simply calling user_renew from root's crontab: 0 0 * * * /usr/local/bin/user_renew user_renew also takes care of expired accounts and subscriptions. user_subscribe : Give a user minutes / day for the next days. For example, you could specify that you want user "smith" to be given 90 minutes / day for the next month, and his present time limit would be restored automatically at the end of the month. user_subscribe records certain fields in the user's BBS record, so that they can be restored later by user_unsubscribe. (see user_unsubscribe) user_sync: Used to synchronize the BBS user file with the password file. Any records with a uid field that is NOT associated with a login name in /etc/passwd are deleted. Also, duplicated accounts (which, of course, shouldn't exist in the first place) are taken care of. user_sync should be run periodically just for the fun of it. user_time : Directly change the expiry date and daily time limit of a user. A argument of 0 means that there will be *no* expiry date for the user. user_touch: Modify a user's "last online" field to equal the current date. This is useful if you want to exempt certain users from the effects of user_purge. (see user_purge) user_unsubscribe : Terminate a users's subscription. This is normally called from user_expire, but can be run directly. Terminating a subscription is simply a matter of restoring a user's daily time limit and expiry date to their values before the subscription was given. user_updated: user_updated is a daemon that comes alive every 60 seconds and does the following routine: For any users currently logged in: - update their "time left" field (i.e. subtract 1 from it) - update their "last time online" field, so that user_purge can use this information. - if they have used up all of their time, give 'em the *boot*. If "guest" is not logged in, refresh his time limit. The number of minutes to give the guest user is defined in user_updated.c You'll probably want to have user_updated started automatically from one of your system's init scripts. - --- Installation Instructions ------------------------------------------------- To install BBS-Util: - run "make install" - edit "user_add", and "user_del" as required - make addition to root's crontab as outlined above You should also implement a check in /etc/profile and /etc/csh.login (and whatever other shell startup files...) to ensure that only users who actually have some time left are allowed to get an interactive session. It is also a good idea to make sure that only 1 guest user can be logged in at once. Here are examples for /etc/profile and /etc/csh.login: - --- /etc/profile: ---------------------------------------- TLEFT=`timeleft | cut -d " " -f 1` if [ "$TLEFT" = "0" ]; then echo echo No time left... sleep 2 logout fi if [ "$LOGNAME" = "guest" -a "$TLEFT" != "10" ]; then /bin/echo /bin/echo There is already one guest user using the system. /bin/echo /bin/echo Call back in $TLEFT minute\(s\). sleep 2 logout fi - --- /etc/csh.login: -------------------------------------- set TLEFT = `timeleft | cut -d " " -f 1` if ( "$TLEFT" == "0" ) then echo -n \\n echo No time left... sleep 2 logout endif if ( "$LOGNAME" == "guest" && "$TLEFT" != "10" ) then /bin/echo /bin/echo There is already one guest user using the system. /bin/echo /bin/echo Call back in $TLEFT minute\(s\). sleep 2 logout endif - ------------------------------------------------------------------------------- Bug reports, and ideas for improving BBS-Util will both be appreciated. Also, feel free to let me know if BBS-Util is working great and serving you well :-) - Adam McKee -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMPAaYIQRll5MupLRAQGd+AQAz+E+Pdh4CsaMvCm4uGkx6A8LOAQHRK2k eEnzpS2Ngg08p+WdgGy3NeMHDc+WBHP3Fvbo+sYclLq6NOXDJ06/d+xSsPs5YzoL vafEKzJTjG82E2n698d7QIDzC6Z7BcSJ1zTdEE/Xxm4M0PJfCRllmKd3mjsN7cAP B1E8WmjTuVI= =kMbF -----END PGP SIGNATURE----- -- This article has been digitally signed by the moderator, using PGP. Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature. Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember a short description of the software and the LOCATION.