Re: Hi aghain

From: Tel Janin Aellinsar (icarus@Loomis.Berkshire.NET)
Date: 04/01/96


On Mon, 1 Apr 1996, Hades wrote:

> Ok, had a question about crontabs and whatnot a few days ago and got a lot
> of responses... what I need to know is what should I do for a cron script
> that will basically do this:
> 
> if the ppp is not running, start it.
> if bin/circle is not running, start it.
> 
> And if the system auto-reboots, will these cron scripts run if the mud
> account user is not logged in, and if they won't, how can I get my mud to
> start running automatically on a reboot without putting it in the rc.local
> (as it would eb run as root)

Cron saves the crontab files in /var/spool/crontab/user or something like 
that.  Therefore, when cron restarts, it'll reload all the necessary 
files.  Just create the crontab as the mud user and cron should do a 
setuid-type thing and run the MUD as the mud user.

If you are really lax about security on your system, you can make the 
Circle executable setuid on exec, as well as setgid on exec.  This will 
make it run as the owner no matter who actually starts the process.  The 
problem, obviously, is that if someone can get circle to copy a file 
(say, /bin/sh) to a public directory, that user will be able to gain 
access to the mud user/group.  This is why very few programs should be 
setuid root, and why there are so many problems with sendmail (it isn't 
setuid root, but it does a lot of similar stuff while running).  Anyway, 
you turn on the setuid on exec bit by chmod u+s <fn>, or chmod ug+s <fn> 
if you want setgid on exec as well.  I don't remember the octal notation 
for this (chmod 4760 <fn>?).  This way you can run circle from rc.local, 
which is much easier than having cron do it.  Be very careful with 
permissions here.  I don't think circle's that bad about security, but 
then, I don't know circle *that* well (and I'm not a hacker, either).

Have fun!

________________________________________________________________________
Tel Janin Aellinsar                       http://www.crocker.com/~icarus
McCoy Enterprises Corporation          Shayol Ghul Resort and Health Spa
Berserker Dragon, Knights of the Cosmos             icarus@BERKSHIRE.NET



This archive was generated by hypermail 2b30 : 12/18/00 PST