From owner-freebsd-questions@FreeBSD.ORG Mon Jan 2 08:24:40 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1549016A41F for ; Mon, 2 Jan 2006 08:24:40 +0000 (GMT) (envelope-from mikeala3@hotmail.com) Received: from hotmail.com (bay7-f3.bay7.hotmail.com [64.4.11.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCB0343D58 for ; Mon, 2 Jan 2006 08:24:39 +0000 (GMT) (envelope-from mikeala3@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 2 Jan 2006 00:24:39 -0800 Message-ID: Received: from 65.200.201.18 by by7fd.bay7.hotmail.msn.com with HTTP; Mon, 02 Jan 2006 08:24:39 GMT X-Originating-IP: [61.95.65.37] X-Originating-Email: [mikeala3@hotmail.com] X-Sender: mikeala3@hotmail.com From: "Mike Esquardez" To: freebsd-questions@freebsd.org Date: Mon, 02 Jan 2006 08:24:39 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 02 Jan 2006 08:24:39.0400 (UTC) FILETIME=[F940C680:01C60F75] Subject: Help with Difficult Startup Script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2006 08:24:40 -0000 Hello, I am trying to make a script that runs the following commands. This is difficult for me because I dont know how to switch users. Currently these are the commands that I am trying to script. # fetchmail –d 1000 & (this needs to be run as username mik) # su -l root # /home/mik/myfilter & (this needs to be run as root) I know I have to make the files executable and .sh extension then put them in /usr/local/etc/rc.d to get them to run at startup but I am not sure how to make these commands run as different users. Is there a way to have something like this? (i know runas isnt a real shell command) #/bin/sh runas "mik" fetchmail & runas "root" /home/mik/myfilter & Any help would be very much helpful. mik _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/