From: Conor Daly (conor.daly at domain met.ie)
Date: Thu 30 Aug 2001 - 13:04:26 IST
On Thu, Aug 30, 2001 at 12:33:49PM +0100 or thereabouts, kevin lyda wrote:
> On Thu, Aug 30, 2001 at 11:33:30AM +0100, Dave Airlie wrote:
> >
> > you were doing well until you said this bit :-), shudder... imagine
> > trying to figure out where something was started from, a sysadm should
> > know what system daemons he is running and use su user -c 'blah' to
> > start daemons as other users...
>
> something like the following would work. it's not tested, but it gives
> an idea of what you'd want to do.
>
> /etc/rc.d/init.d/users.inits
>
> #!/bin/sh
>
> # do all the init file inits. RUNLEVEL should be assigned. make the
> # case structure for start/stop/etc and then this bit runs the scripts:
# Figure out how to do syslog stuff and construct the relevant command here
SYSLOG_COMMAND = "whatever the usual command for syslog stuff is"
>
> for ud in `awk '$3 >= 500 {print "\"" $1 ":" $6 "\""}'`; do
> OFS=$IFS
> IFS=:
> echo $ud | read user dir
> IFS=$OFS
> for uinits in $dir/.rc$RUNLEVEL.d/*; do
> case $uinits in
> S*)
$SYSLOG_COMMAND "Starting service: "$uinits" for user: "$user" ..."
> su - $user -c $uinits start
> K*)
$SYSLOG_COMMAND "Stopping service: "$uinits" for user: "$user" ..."
> su - $user -c $uinits stop
> esac
> done
> done
With the modifications above to keep Dave happy.
Conor
-- Conor Daly Met Eireann, Glasnevin Hill, Dublin 9, Ireland Ph +353 1 8064276 Fax +353 1 8064275 ------------------------------------ 12:00pm up 16 days, 13:05, 11 users, load average: 0.00, 0.00, 0.04
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:54 GMT