Automatically starting user programs on boot

Polytropon freebsd at edvax.de
Thu Sep 4 11:37:13 UTC 2008


On Thu, 4 Sep 2008 13:06:54 +0200 (CEST), Saša Stupar <sasa at stupar.homelinux.net> wrote:
> Hi!
> 
> On my FBSD 7 server I also use screen with rtorrent. In case of server
> reboot (power outage, server goes on UPS then power down) the user need
> manually to login, then start screen and then rtorrent. Is it possible to
> start this procedure automatically and of course as certain user and not
> as root?
> I was thinking about .startup file or something in users home directory.

No need to reinvent the wheel. :-)

The solution is quite simple, allthough it is to be considered a
security risk, and maybe it's a bit ugly. Here's what I would
suggest you to do:

1. Modify /etc/gettytab as follows:

	default:\
		...

	autologin:\
		:al=<USERNAME>:tc=Pc:

	a|std.110|110-baud:\
		...

where <USERNAME> is the name of the user who wants the screen
and rtorrent running.

2. After that, go to this user's home directory and create or modify
his ~/.login file to contain the proper commands to start the
screen sessions and rtorrent.

Please note that it might be possible to have another file changed
if the C Shell is not this user's shell. BASH has another file
for startup, I think.



-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list