FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-28-2012, 02:38 PM
 
Default Improve leafnode

Leafnode on Debian uses a script do-fetch-news, which cron run
periodically, that checks the variable $NETWORK in
/etc/news/leafnode/debian-config. This variable can have two possible
values: "PPP" and "permanent".

I think that a third value is missing, we can call it "online". Useful
when leafnode runs on mobile devices for example.

Can you suggest me a brief way to improve it. I suppose I can insert a
script in /etc/network/if-up.d/ which checks when online and thes edits
/etc/news/leafnode/debian-config accordingly. I also noticed that exists
another script, network-test, that I can use for this. But I have one
questions:

1. I don't understand if to trigger a script putting it into
/etc/network/if-up.d/ is enough to run it when an interface goes up.

Any clue?
Thanks in advance.
--
Un cinico e' uno che quando annusa i fiori cerca intorno la bara.
-- Russel Lynes


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87fwak1icr.fsf@father.nostromo.wy">http://lists.debian.org/87fwak1icr.fsf@father.nostromo.wy
 
Old 05-28-2012, 03:25 PM
Camaleón
 
Default Improve leafnode

On Mon, 28 May 2012 16:38:12 +0200, daniele.g wrote:

> Leafnode on Debian uses a script do-fetch-news, which cron run
> periodically, that checks the variable $NETWORK in
> /etc/news/leafnode/debian-config. This variable can have two possible
> values: "PPP" and "permanent".
>
> I think that a third value is missing, we can call it "online". Useful
> when leafnode runs on mobile devices for example.

(...)

"ppp" should cope that scenario (non-permanent connections) or what's
what you are missing? :-?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jq05ch$rhl$6@dough.gmane.org">http://lists.debian.org/jq05ch$rhl$6@dough.gmane.org
 
Old 05-29-2012, 12:29 PM
 
Default Improve leafnode

Camaleón <noelamac@gmail.com> writes:

> On Mon, 28 May 2012 16:38:12 +0200, daniele.g wrote:
>
>> Leafnode on Debian uses a script do-fetch-news, which cron run
>> periodically, that checks the variable $NETWORK in
>> /etc/news/leafnode/debian-config. This variable can have two possible
>> values: "PPP" and "permanent".
>>
>> I think that a third value is missing, we can call it "online". Useful
>> when leafnode runs on mobile devices for example.
>
> (...)
>
> "Ppp" should cope that scenario (non-permanent connections) or what's
> what you are missing? :-?

PPP only triggers when a ppp* interface goes up. I'd like to make it
more general. A solution I'm working on is a script which use sed to
toggle $NETWORK between PPP and permanent when the laptop is online, I
only would like to know how to run this script from inside interfaces
--
Non ci fossero le donne, gli uomini vivrebbero come dei.
-- Thomas Dekker


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 877gvvjhlf.fsf@father.nostromo.wy">http://lists.debian.org/877gvvjhlf.fsf@father.nostromo.wy
 
Old 05-30-2012, 03:43 PM
Camaleón
 
Default Improve leafnode

On Tue, 29 May 2012 14:29:32 +0200, daniele.g wrote:

> Camaleón <noelamac@gmail.com> writes:
>
>> On Mon, 28 May 2012 16:38:12 +0200, daniele.g wrote:
>>
>>> Leafnode on Debian uses a script do-fetch-news, which cron run
>>> periodically, that checks the variable $NETWORK in
>>> /etc/news/leafnode/debian-config. This variable can have two possible
>>> values: "PPP" and "permanent".
>>>
>>> I think that a third value is missing, we can call it "online". Useful
>>> when leafnode runs on mobile devices for example.
>>
>> (...)
>>
>> "Ppp" should cope that scenario (non-permanent connections) or what's
>> what you are missing? :-?
>
> PPP only triggers when a ppp* interface goes up.

When there's a Internet connection (dial-up, ppp dsl, umts...) in place,
right?

> I'd like to make it more general.

More general in what way, exactly? What kind of scenario do you have in
mind? I ask because your suggestion (if found useful by the package
maintainers) could be also added in the Debian package without needing to
use to a sed script or something like that.

> A solution I'm working on is a script which use sed to toggle $NETWORK
> between PPP and permanent when the laptop is online, I only would like
> to know how to run this script from inside interfaces

I'm not sure if that would work as you expect given the way it is
configured now because the service has been already started so in order
to alter the $NETWORK variable you'll have to restart or reload the
leafnode service every time that variable changes, is that what you
want? :-?

Anyway, you can take a look at the networking docs:

http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_scripting_with_the_ifupdown_system

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jq5f72$l92$11@dough.gmane.org">http://lists.debian.org/jq5f72$l92$11@dough.gmane.org
 
Old 05-31-2012, 03:10 PM
 
Default Improve leafnode

Camaleón <noelamac@gmail.com> writes:


[...]

>> Ppp only triggers when a ppp* interface goes up.
>
> When there's a Internet connection (dial-up, ppp dsl, umts...) in place,
> right?

Right, the script /etc/ppp/ip-up.d/leafnode triggers when ppp0 is
established.

>> I'd like to make it more general.
>
> More general in what way, exactly? What kind of scenario do you have in
> mind? I ask because your suggestion (if found useful by the package
> maintainers) could be also added in the Debian package without needing to
> use to a sed script or something like that.

In few words: a system wide cronjob already, periodically (every hour),
tests if leafnode is configured in PPP or permanent mode. If PPP it skips
over, if permament fetchnews is launched. I set it as PPP because I
don't want my syslog flooded with error messages about missing
connection.

[1] /etc/cron.d/leafnode
--8<---------------cut here---------------start------------->8---
# Cron entries for Leafnode.
# Run /etc/news/leafnode/do-fetch-news every hour.
8 * * * * news if [ -x /etc/news/leafnode/do-fetch-news ]; then /etc/news/leafnode/do-fetch-news; fi
--8<---------------cut here---------------end--------------->8---

[2] /etc/news/leafnode/do-fetch-news
--8<---------------cut here---------------start------------->8---
# Get configuration
. /etc/news/leafnode/debian-config

...

# Get new news.
if [ "$NETWORK" = "permanent" -a -x /usr/sbin/fetchnews ]; then
/usr/sbin/fetchnews
fi
--8<---------------cut here---------------end--------------->8---

I think it could be smarter.

>> A solution I'm working on is a script which use sed to toggle $NETWORK
>> between PPP and permanent when the laptop is online, I only would like
>> to know how to run this script from inside interfaces

> I'm not sure if that would work as you expect given the way it is
> configured now because the service has been already started so in order
> to alter the $NETWORK variable you'll have to restart or reload the
> leafnode service every time that variable changes, is that what you
> want? :-?

No, but please note that $NETWORK variable is read every time that the
cronjob starts, at worst I will have a one hour lag.

> Anyway, you can take a look at the networking docs:
>
> Http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_scripting_with_the_ifupdown_system
>
> Greetings,

Thanks.
--
- Cosa si deve fare per avere le mani sempre ben curate?
- Niente!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87zk8owfmt.fsf@father.nostromo.wy">http://lists.debian.org/87zk8owfmt.fsf@father.nostromo.wy
 
Old 05-31-2012, 03:51 PM
Camaleón
 
Default Improve leafnode

On Thu, 31 May 2012 17:10:18 +0200, daniele.g wrote:

> Camaleón <noelamac@gmail.com> writes:
>
>>> I'd like to make it more general.
>>
>> More general in what way, exactly? What kind of scenario do you have in
>> mind? I ask because your suggestion (if found useful by the package
>> maintainers) could be also added in the Debian package without needing
>> to use to a sed script or something like that.
>
> In few words: a system wide cronjob already, periodically (every hour),
> tests if leafnode is configured in PPP or permanent mode. If PPP it
> skips over, if permament fetchnews is launched. I set it as PPP because
> I don't want my syslog flooded with error messages about missing
> connection.

(...)

I see. You can join this bug report and expose your suggestions there:

leafnode: Cron job could be smarter.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652028

The more you are requesting for the same (or similar) feature to be added,
the better :-)

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2012.05.31.15.51.06@gmail.com">http://lists.debian.org/pan.2012.05.31.15.51.06@gmail.com
 

Thread Tools




All times are GMT. The time now is 01:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org