Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Apr 2008 13:42:16 -0500
From:      Erik Osterholm <freebsd-lists-erik@erikosterholm.org>
To:        FreeBSD Mailing Lists <freebsd-questions@freebsd.org>
Subject:   Re: Screen inside Jails + su
Message-ID:  <20080409184216.GA16393@aleph.cepheid.org>
In-Reply-To: <20080409010503.GB15556@phoenix.nasreddine.info>
References:  <20080408220005.GA23508@phoenix.nasreddine.info> <20080409005217.GA97058@aleph.cepheid.org> <20080409010503.GB15556@phoenix.nasreddine.info>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 09, 2008 at 03:05:03AM +0200, Wael Nasreddine wrote:
> This One Time, at Band Camp, Erik Osterholm <freebsd-lists-erik@erikosterholm.org> said, On Tue, Apr 08, 2008 at 07:52:17PM -0500:
> > On Wed, Apr 09, 2008 at 12:00:05AM +0200, Wael Nasreddine wrote:
> 
> > The common way for a user to run a program at startup is to use
> > cron with the special @reboot directive instead of giving it a
> > time to run a job.
> > http://www.freebsd.org/doc/en/books/handbook/configtuning-starting-services.html
> 
> Thank you for pointing that out, could you please give me an example
> I haven't found on that page...
 
Sure.

At your shell prompt, type:
man 5 crontab

You'll find the man page for the crontab file, which includes multiple
examples of cron entries.  All of those use the time specification,
though, rather than the @reboot keyword.

An example using @reboot:
@reboot			/usr/local/bin/screen -d -m Rtorrent

You can edit the crontab for the user with this command at your shell
prompt:
crontab -u username -e

This will dump you into your editor, editing the crontab file for the
user "username".  Type in the crontab entry (for example, the one I
used as an example above), save, and try restarting the jail.

Erik



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080409184216.GA16393>