Xref: utzoo comp.unix.questions:31389 comp.unix.wizards:25645 comp.unix.internals:2808 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!clout!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.internals Subject: Re: starting a process as another user during startup Message-ID: <1991May16.152625.23511@chinet.chi.il.us> Date: 16 May 91 15:26:25 GMT References: <8646@alpha.cam.nist.gov> Organization: Chinet - Chicago Public Access UNIX Lines: 23 In article <8646@alpha.cam.nist.gov> coleman@cam.nist.gov (Sean Sheridan Coleman X5672) writes: >What I would like to do is have the rc.local run this script >and start up this monitoring program as a part of its startup >but I want it to start the process so the user is nbsnet not >root. Is there a way to do this and if so, how? Use: su -c user "command string" My (AT&T sysV) man page gives very little information about this form but as I recall, it runs the users shell as per the passwd file as well as using the uid, and if that shell is ksh, it will execute the user's .profile, where sh will not (watch out for interactive commands!). I prefer to let init respawn this kind of program, since it can then exit under whatever conditions you want and a new copy will always restart, and a screw-up like an interactive prompt won't hang the machine like it does in the rc.d files. You probably only want it at run-level 2 and 3 anyway. Les Mikesell les@chinet.chi.il.us