[linux-elitists] Per-user network up and down scripts

Don Marti dmarti@zgp.org
Sat Nov 29 17:37:56 PST 2008


begin Brian quotation of Wed, Nov 26, 2008 at 02:55:21PM -0600:
> On Wed, Nov 26, 2008 at 2:45 PM, Nathaniel Smith <njs@pobox.com> wrote:
> > On Wed, Nov 26, 2008 at 8:40 AM, Don Marti <dmarti@zgp.org> wrote:
> >> There's other stuff that I want to do when the net
> >> comes up or down that should run as me, not root.
> >> (Sync my IMAP mail, open ssh "master" connections
> >> which are tied to me, and so on.)
> >
> > Another approach (used by a number of desktop apps these days) is to
> > listen for D-Bus signals from NetworkManager.  For a slightly
> > different use case mostly (Firefox switching between "offline" and
> > "online" mode, Pidgin triggering an automatic reconnection attempt,
> > etc.) where the interested apps are already resident in memory, and of
> > course it assumes you're using NetworkManager, but one could create a
> > little session daemon who just listens for such events and then runs
> > scripts, for instance.
> 
> Alternatively, a script that sits in /etc/network/if-up.d and checks
> all users' home directories for a script to run as that user would be
> a viable package. If Don's concern is polluting etc with unmanaged
> files, getting that into his distro would set things right.

Yes -- I have NetworkManager on this system (Debian
testing) and the scripts in /etc/network/*.d get run
at the right times.  So it doesn't really make sense
to have to start up a process as part of my session
just to listen for D-Bus signals and run the scripts,
when the system-level scripts are already getting run.
I have mostly short-lived processes, not big things
that stay running all the time.  Except Evolution, but
I'm looking for something to replace that.  I like the
"I Want Sandy" approach of having a virtual assistant
address that you copy on the mail you send out saying
that you're going to do something, or the mail you
send out telling someone else to do something, and
then getting reminders.

-- 
Don Marti                                        +1 510-814-0932
http://zgp.org/~dmarti/                          +1 510-332-1587 mobile
dmarti@zgp.org


More information about the linux-elitists mailing list