From owner-freebsd-questions Fri Mar 8 1:18:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from kirk.izrsolutions.com (kirk.izrsolutions.com [195.26.33.2]) by hub.freebsd.org (Postfix) with ESMTP id 6F95237B405 for ; Fri, 8 Mar 2002 01:18:50 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by kirk.izrsolutions.com (Postfix) with ESMTP id 311081E481; Fri, 8 Mar 2002 09:18:49 +0000 (GMT) Received: from drex.staff.izr.com (drex.staff.izr.com [195.26.33.16]) by kirk.izrsolutions.com (Postfix) with ESMTP id 406291E45D; Fri, 8 Mar 2002 09:18:48 +0000 (GMT) Received: by drex.staff.izr.com (Postfix, from userid 1001) id 0CFFC33783; Fri, 8 Mar 2002 09:18:47 +0000 (GMT) Date: Fri, 8 Mar 2002 09:18:47 +0000 From: Mark Drayton To: Andreas Ntaflos Cc: freebsd-questions@freebsd.org Subject: Re: Starting daemon only for user; gotta be simple? Message-ID: <20020308091847.B29331@drex.staff.izr.com> Mail-Followup-To: Andreas Ntaflos , freebsd-questions@freebsd.org References: <20020307181919.A94491@Deadcell.ant> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020307181919.A94491@Deadcell.ant>; from ntaflos.andreas@gmx.net on Thu, Mar 07, 2002 at 06:19:19PM +0100 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Andreas, Andreas Ntaflos (ntaflos.andreas@gmx.net) wrote: > Hi all, This is about fetchmail, but also a general question on how to > start a process or daemon at login time or boot time only once. > > I want to have fetchmail running in daemon mode, so I put the > according entry into my .fetchmailrc: set daemon 900 for example. > But the daemon gets started only when I run fetchmail once manually > on the command line. > > I am looking for a way to have this task automated. A script in > /usr/local/etc/rc.d comes into mind, but this would start polling > for mail only for root wouldn't it? Putting 'fetchmail' into .login > would start it anytime the .login script is executed, that's every > time I log into a new virtual terminal. A cron job for fetchmail is > another workaround which in fact I used for months before I > discovered the set daemon option. > > Of course, I could write a script that checks which tty I log into > and execute fetchmail (or anything else) only when it's ttyv0 for > example. But is there a better way to do such things? An equivalent > to /usr/local/etc/rc.d only for regular users instead of root? I may > have not R enough of TFM but I did not stumble across anything that > would answer my question. man 5 crontab: Instead of the first five fields, one of eight special strings may appear: string meaning ------ ------- @reboot Run once, at startup. How about this? > I hope that was not too confusing, excuse my English, I am a quite > exhausted and tired after a long day in school :) It's better than mine and I'm English! Cheers, -- Mark Drayton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message