From owner-freebsd-questions@FreeBSD.ORG Thu Sep 4 11:37:13 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084111065690 for ; Thu, 4 Sep 2008 11:37:13 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id BA2488FC13 for ; Thu, 4 Sep 2008 11:37:12 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-195-20-67.dynamic.qsc.de [92.195.20.67]) by mx01.qsc.de (Postfix) with ESMTP id DF58450E4D; Thu, 4 Sep 2008 13:37:10 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id m84Bb7lA013399; Thu, 4 Sep 2008 13:37:07 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 4 Sep 2008 13:37:07 +0200 From: Polytropon To: =?UTF-8?Q?Sa=C5=A1a?= Stupar Message-Id: <20080904133707.123134e2.freebsd@edvax.de> In-Reply-To: <3bd584700067958b3d0e6b681c98a709.squirrel@posta.homelinux.net> References: <3bd584700067958b3d0e6b681c98a709.squirrel@posta.homelinux.net> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re: Automatically starting user programs on boot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2008 11:37:13 -0000 On Thu, 4 Sep 2008 13:06:54 +0200 (CEST), Saša Stupar 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=:tc=Pc: a|std.110|110-baud:\ ... where 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, ...