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
Solved

Timer program

Posted on 2000-03-01
7
255 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
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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 50 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

808 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