Date: Thu, 4 Sep 2008 13:37:07 +0200 From: Polytropon <freebsd@edvax.de> To: =?UTF-8?Q?Sa=C5=A1a?= Stupar <sasa@stupar.homelinux.net> Cc: freebsd-questions@freebsd.org Subject: Re: Automatically starting user programs on boot Message-ID: <20080904133707.123134e2.freebsd@edvax.de> In-Reply-To: <3bd584700067958b3d0e6b681c98a709.squirrel@posta.homelinux.net> References: <3bd584700067958b3d0e6b681c98a709.squirrel@posta.homelinux.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 4 Sep 2008 13:06:54 +0200 (CEST), Saša Stupar <sasa@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, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080904133707.123134e2.freebsd>