fetchmail at login

2001-03-15 Thread Marcelo Chiapparini
Dear Debianers

I want a program to start automatically each time I login into my 
account. In which initializing file should I write the name of the 
program?
Thanks in advance!
-- 
___
Marcelo Chiapparini
DFT-IF/UERJ
[EMAIL PROTECTED]



Re: fetchmail at login

2001-03-15 Thread Frederico S. Munoz
On Thu, Mar 15, 2001 at 02:20:47PM -0300, Marcelo Chiapparini wrote:
> Dear Debianers
> 
> I want a program to start automatically each time I login into my 
> account. In which initializing file should I write the name of the 
> program?

You could add the command to your .bashrc file, it will be executed
after you login.

Best Regards,

fsm


-- 
[EMAIL PROTECTED]
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: fetchmail at login

2001-03-15 Thread Colin Cashman
> > I want a program to start automatically each time I login into my
> > account. In which initializing file should I write the name of the
> > program?
>
> You could add the command to your .bashrc file, it will be executed
> after you login.

Might be better to add it to his .bash_profile, unless he's got .bash_profile 
set up to read .bashrc (which, I believe, is not the
default in Debian).



Re: fetchmail at login

2001-03-15 Thread Frederico S. Munoz
On Thu, Mar 15, 2001 at 12:35:37PM -0500, Colin Cashman wrote:
> > > I want a program to start automatically each time I login into my
> > > account. In which initializing file should I write the name of the
> > > program?
> >
> > You could add the command to your .bashrc file, it will be executed
> > after you login.
> 
> Might be better to add it to his .bash_profile, unless he's got .bash_profile 
> set up to read .bashrc (which, I believe, is not the
> default in Debian).

Can't check right now, but IIRC one of them sources the other.
Still, you are probably right.

Best Regards,

fsm

-- 
[EMAIL PROTECTED]
SDF Public Access UNIX System - http://sdf.lonestar.org



Re: fetchmail at login

2001-03-15 Thread Steve Cooper
You may benefit from also checking out getmail.  It's simpler, cleaner and may 
be less prone to dropping mail (a fact advertised by
the author of getmail).  I find it works really well, particularly when 
combined with wmbiff.  Wmbiff can be set up to execute getmail
whenever its polling detects mail arriving at the server.  Since I live in X 
this works better for me than starting it at login time.
I also like that it's written in Python, and therefore theoretically easy to 
modify.

Good luck,
Steve Cooper

Colin Cashman wrote:

> > > I want a program to start automatically each time I login into my
> > > account. In which initializing file should I write the name of the
> > > program?
> >
> > You could add the command to your .bashrc file, it will be executed
> > after you login.
>
> Might be better to add it to his .bash_profile, unless he's got .bash_profile 
> set up to read .bashrc (which, I believe, is not the
> default in Debian).
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Running fetchmail at login time

2001-01-24 Thread Daniel de los Reyes
I want to run fetchmail as a daemon each time I log in but I don't want to do 
it manually.Is bash_profile the apropiate place to launch it from? How can I 
prevent it form being launched several times if I login at several consoles?

Thank's

-- 
__
Daniel de los Reyes
S2-Selling Soluciones
Valencia Spain
e-mail: [EMAIL PROTECTED]
Powered by Debian GNU-Linux 2.2r2
__



Re: Running fetchmail at login time

2001-01-24 Thread Brad Burns
Have you checked fetchmails homepage?  I remember seeing a FAQ or something 
there describing how to do this.  The gist of it revolved around 
creating/removing temporary files using ~/.bash_profile and ~/.bash_logout 
using a specific file mask, ~/.bash_logout would look for other files, and if 
only one existed, would terminate fetchmail on its way out... hmm, looking at 
the fetchmail faq, it says the script that does this, is in the contrib 
directory in the fetchmail distribution, so you may need to download it 
yourself.

On Wed, Jan 24, 2001 at 09:22:41AM +0100 or thereabouts, Daniel de los Reyes 
wrote:
> I want to run fetchmail as a daemon each time I log in but I don't want to do 
> it manually.Is bash_profile the apropiate place to launch it from? How can I 
> prevent it form being launched several times if I login at several consoles?
> 
> Thank's
> 
> -- 
> __
> Daniel de los Reyes
> S2-Selling Soluciones
> Valencia Spain
> e-mail: [EMAIL PROTECTED]
> Powered by Debian GNU-Linux 2.2r2
> __
> 
> 
> -- 
> To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
> 

-- 

--* Brad Burns *--
Fortune of the Minute:

To a Californian, the basic difference between the people and the pigeons
in New York is that the pigeons don't shit on each other.
-- From "East vs. West: The War Between the Coasts


pgp4JvIXZyGtF.pgp
Description: PGP signature


Re: Running fetchmail at login time

2001-01-24 Thread Hall Stevenson
> I want to run fetchmail as a daemon each time
> I log in but I don't want to do it manually.Is
> bash_profile the apropiate place to launch it
> from? How can I prevent it form being launched
> several times if I login at several consoles?

I don't believe fetchmail will run multiple instances of itself. I
occassionally "force" fetchmail to run in between the time it runs
normally (it's set to run every 10 or 15 minutes in daemon mode). If I
force it, it simply "wakes" the original instance. It actually outputs
something like "fetchmail daemon awakened ... process number xxx".

You could also do something like checking for fetchmail's PID and if it
already exists, not run the command again.

Regards
Hall




Re: Running fetchmail at login time

2001-01-24 Thread Vinod Kurup
Here are the scripts that I use (modified from the
ones in the contrib directory of the fetchmail distro)

~/.bash_profile
#   Start Fetchmail up when I Login.
#- modified from script in contrib section
#- 1/24/01 Vinod Kurup [EMAIL PROTECTED]

TDEV=`tty | sed -n -e "s#/dev/##p"`

if [ ! -s ~/.fetchmail.pid ]; then
echo -n "Starting fetchmail daemon..."
fetchmail -d 300
echo $TDEV > ~/.fetchmail.owner
echo "done."
fi
# END of Fetchmail startup

~/.bash_logout
#   Below is for Fetchmail clean up
#- modified from logout script in contrib section
#- 1/24/01 Vinod Kurup [EMAIL PROTECTED]

TDEV=`tty | sed -n -e "s#/dev/##p"`

if [ -s ~/.fetchmail.pid ]; then
if [ -s ~/.fetchmail.owner ]; then
OWNER=`cat ~/.fetchmail.owner`

if [ $TDEV = $OWNER ]; then
rm -rf ~/.fetchmail.owner
fetchmail -q >/dev/null 2>&1
fi
fi
fi
# END of Fetchmail clean up


HTH,

Vinod

On Wed, Jan 24, 2001 at 08:18:03AM -0500, Brad Burns wrote:
> Have you checked fetchmails homepage?  I remember seeing a FAQ or something 
> there describing how to do this.  The gist of it revolved around 
> creating/removing temporary files using ~/.bash_profile and ~/.bash_logout 
> using a specific file mask, ~/.bash_logout would look for other files, and if 
> only one existed, would terminate fetchmail on its way out... hmm, looking at 
> the fetchmail faq, it says the script that does this, is in the contrib 
> directory in the fetchmail distribution, so you may need to download it 
> yourself.
> 
> On Wed, Jan 24, 2001 at 09:22:41AM +0100 or thereabouts, Daniel de los Reyes 
> wrote:
> > I want to run fetchmail as a daemon each time I log in but I don't want to 
> > do it manually.Is bash_profile the apropiate place to launch it from? How 
> > can I prevent it form being launched several times if I login at several 
> > consoles?
> > 
> > Thank's
> > 
> > -- 
> > __
> > Daniel de los Reyes
> > S2-Selling Soluciones
> > Valencia Spain
> > e-mail: [EMAIL PROTECTED]
> > Powered by Debian GNU-Linux 2.2r2
> > __
> > 
> > 
> > -- 
> > To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
> > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
> > 
> 
> -- 
> 
> --* Brad Burns *--
> Fortune of the Minute:
> 
> To a Californian, the basic difference between the people and the pigeons
> in New York is that the pigeons don't shit on each other.
>   -- From "East vs. West: The War Between the Coasts



-- 
_
Vinod Kurup, MD
email: [EMAIL PROTECTED]
phone: 617.277.2012
cell:  617.359.5990
http://www.medicalrecords.com



Re: Running fetchmail at login time

2001-01-24 Thread D-Man

Yes, use .bash_profile.

When you invoke fetchmail, if it is already running as a daemon it
will simply wake the daemon process and cause it to check at that
time.  Then in your .bash_logout file put "fetchmail --kill" to
terminate the daemon when you logout.  (Unless you want to to run all
the time)

-D

On Wed, Jan 24, 2001 at 09:22:41AM +0100, Daniel de los Reyes wrote:
| I want to run fetchmail as a daemon each time I log in but I don't want to do 
it manually.Is bash_profile the apropiate place to launch it from? How can I 
prevent it form being launched several times if I login at several consoles?
| 
| Thank's
| 



Re: Running fetchmail at login time

2001-01-24 Thread Mike
Daniel de los Reyes wrote:
> I want to run fetchmail as a daemon each time I log in but I don't want to
> do it manually.Is bash_profile the apropiate place to launch it from? How
> can I prevent it form being launched several times if I login at several
> consoles?

Here's how I do it.  First, I wrote a script called fetchmail.sh, which is
located in my home directory.  Here's the script:

- Begin fetchmail.sh -
#! /bin/bash
LOGCOUNT=w -hsf|grep mike|wc -l
MAXCOUNT=1

case "$1" in
  start-daemon)
if [ -e ~mike/.fetchmail.pid ]
  then
  exit
fi
fetchmail -d 120
;;

  start)
if [ -e ~mike/.fetchmail.pid ]
  then
  exit
fi
fetchmail
;;

  stop-daemon)
if [ ! -e ~mike/.fetchmail.pid ]
  then
  exit
fi
if [ $LOGCOUNT -eq $MAXCOUNT ]
  then
  fetchmail --quit
fi
;;

esac
exit 0
- End fetchmail.sh -

Yes, I know that this script is kinda ugly.  But it works, and that's all I
was after.

In my ~/.bash_profile I have a call to  "~/fetchmail.sh start-daemon" and in
my ~/.bash_logout I have a call to "~/fetchmail.sh stop-daemon"

This script could probably be cleaned up some, but like I said *it* *works*
for me.
-- 
Mike Werner  KA8YSD   | He that is slow to believe anything and
  | everything is of great understanding,
'91 GS500E| for belief in one false principle is the
Morgantown WV | beginning of all unwisdom.



pgp9X5XO6ikXy.pgp
Description: PGP signature