Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Timer program

Posted on 2000-03-01
7
Medium Priority
?
277 Views
Last Modified: 2013-12-16
Hi There
I need to get hold of a program or script that will allow a user a set amount of time
0
Comment
Question by:will_do
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Expert Comment

by:joe_h
ID: 2580337
what exactly do you mean? Something that logs the user out if he/she has been logged in for too long?
0
 

Author Comment

by:will_do
ID: 2581350
something that i can put block of hours into and thats all the users can use
0
 
LVL 2

Expert Comment

by:joe_h
ID: 2586876
If you need to set the same hours for all users, you can place a SCHED=... option to the appropriate /etc/default/getty.something or /etc/default/getty file. (details - man getty :)
Another option would be to have getty run a different program than the default /bin/login - perhaps a script, that would find the user name in a list of allowed hours, compare that to the current time and either call the original /bin/login or die.
Anyway, I'm sure somebody has already written such a script, but I didn't come across it yet.
0
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 

Author Comment

by:will_do
ID: 2586890
the hourly accounts are only for some ppl most of the account will be unlimited
0
 
LVL 4

Expert Comment

by:kiffney
ID: 2597340
The only way I can think to do it would be to write a script run by a cron job that parses the output of 'who' (which shows you who is logged in, and what time they logged in), checked for the users you wanted to limit, figured out if they were over limit, then kicked them off.  I've done something similar for dialin users who were using remote file mounts, but it wouldn't work for this project.  Such software must exist, however.  You might find something that would do this for you as a utility inside some BBS or ISP software for Linux.  Check on www.freshmeat.net or www.google.com.
0
 
LVL 2

Expert Comment

by:joe_h
ID: 2597473
I think we are on a good track here. Probably we'd use two components:
1. a script invoked via the getty/login mechanism that would allow the user to log-on only during the specified hours.
2. a cron-invoked script that would kick off any users who have exceeded their hours.

As kiffney suggested, I'd also recommend searching www.freshmeat.net, www.redhat.com, etc. As the last resort we can try to write this; however, I dislike re-inventing the wheel.
0
 
LVL 1

Accepted Solution

by:
hbrady earned 150 total points
ID: 2604438
There is actually a powerful package available to do just what you are looking for.  It's called clobberd and it works very well.  You can find it on the RedHat Powertools CD or
you can do a search for it at http://www.tuxfinder.com/

Once you have installed it start the daemon by running "clobberd".  Then run "clobberd localhost" to edit users, restrictions etc.  BTW, the default password is honda.

Have fun.
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question