Running process on startup as a user

2007-09-13 Thread Jack Barnett


Using FreeBSD 6.2 x86.

I have a script called:

/home/foo/scripts/MyScript.sh
The user is 'foo'.  The password is 'bar'.

What I'm trying to do is run the MyScript.sh command on startup (that 
way if the box reboots, then this users process also re-starts it's self).


thoughts?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Running process on startup as a user

2007-09-13 Thread Philip Hallstrom

Using FreeBSD 6.2 x86.

I have a script called:

/home/foo/scripts/MyScript.sh
The user is 'foo'.  The password is 'bar'.

What I'm trying to do is run the MyScript.sh command on startup (that way if 
the box reboots, then this users process also re-starts it's self).


thoughts?


Create a crontab entry for the 'foo' user that reads:

@reboot /home/foo/scripts/MyScript.sh

http://www.freebsd.org/cgi/man.cgi?query=crontabsektion=5
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Running process on startup as a user

2007-09-13 Thread Duane Hill

On Thu, 13 Sep 2007 at 13:15 -0500, [EMAIL PROTECTED] confabulated:



Using FreeBSD 6.2 x86.

I have a script called:

/home/foo/scripts/MyScript.sh
The user is 'foo'.  The password is 'bar'.

What I'm trying to do is run the MyScript.sh command on startup (that way if 
the box reboots, then this users process also re-starts it's self).


thoughts?


You could put the script in a crontab for that user:

@reboot /bin/sh /home/foo/scripts/MyScript.sh

According to 'man 5 crontab', @reboot runs the script once at startup.

--
  _|_
 (_| |
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Running process on startup as a user

2007-09-13 Thread Manolis Kiagias


Jack Barnett wrote:

 Using FreeBSD 6.2 x86.

 I have a script called:

 /home/foo/scripts/MyScript.sh
 The user is 'foo'.  The password is 'bar'.

 What I'm trying to do is run the MyScript.sh command on startup (that
 way if the box reboots, then this users process also re-starts it's
 self).

 thoughts?


Looks like a good job for a user crontab:

Login as the foo user, type:

crontab -e

Insert the line:

@reboot   /home/foo/scripts/MyScript.sh

Save, exit, you are done. Look at man 5 crontab for more details and
possible caveats.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Running process on startup as a user

2007-09-13 Thread Eric Crist

On Sep 13, 2007, at 1:15 PMSep 13, 2007, Jack Barnett wrote:



Using FreeBSD 6.2 x86.

I have a script called:

/home/foo/scripts/MyScript.sh
The user is 'foo'.  The password is 'bar'.

What I'm trying to do is run the MyScript.sh command on startup  
(that way if the box reboots, then this users process also re- 
starts it's self).


thoughts?



/etc/crontab allows you to actually specify the user to run the  
process as in the 6th field.  An entry such as:


@reboot foo /home/foo/scripts/MyScript.sh

Would work for running the process at startup.  The following entry  
is an example for running a script as user for every Monday on 3pm:


00 03* * 1 foo /home/foo/scripts/MyScript.sh

And, as others have already said, you can just put the following  
entry in user foo's crontab:
* Note, you can access that user's crontab by loggin in as that user  
and typing crontab -e, or as root by typing crontab -e -u foo:


@reboot /home/foo/scripts/MyScript.sh

HTH
-
Eric F Crist
Secure Computing Networks


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]