Jump to content

line in /etc/ppp/ip-up.local is not executed correctly


baudolino
 Share

Recommended Posts

I want that, whenever pppd connects to the internet, a certain window applet (wmWeather) to be automatically executed (to appear

on my screen). My script /etc/ppp/ip-up.local is executed (I checked this using the "touch /tmp/hello", which does what is

suppose to do), but the applet does not appear on the screen.

Here is the script:

 

/etc/ppp/ip-up.local

--------------------------[start]

#!/bin/bash

/usr/X11R6/bin/wmWeather -station KTTN

 

touch /tmp/hello

 

exit 0

--------------------------[end]

 

Now, I know that /etc/ppp/ip-up (which calls /etc/ppp/ip-up.local):

1. runs as a root,

2. changes the PATH,

3. sets the standard input, output and error for all commands inside to /dev/null,

but i don't see how any of these will explain why the line executing wmWeather in /etc/ppp/ip-up.local, which is for sure is

executed, does not pop-up the applet on the screen.

 

Leads that did not get me anywhere:

1. /etc/ppp/ip-up.local runs ok, when called from a command line.

2. I looked inside the source code of the applet, and all commands have complete paths (so a changed PATH shouldn't be a problem).

3. The following lines from man pppd regarding ip-up did not get me anywhere either.

 

/etc/ppp/ip-up

A program or script which is executed when the link is available

for sending and receiving IP packets (that is, IPCP has come

up). It is executed with the parameters

 

interface-name tty-device speed local-IP-address remote-IP-address ipparam

 

Any leads are gratefully appreciated.

 

baudolino

clueless as always

Link to comment
Share on other sites

I asume that the script /etc/ppp/ip-up.local works since you tested it with "touch", and I also asume that wmWeather works when you launch it at command line. So my best bet is to think that the problem is related to the enviroment where it is launched, also you should think that the script is launched as root (see note 1).

You might want to try the following:

 

if [ ! $DISPLAY ]; then 

    export DISPLAY=:0.0

fi



/usr/X11R6/bin/wmWeather -station KTTN

 

(1) As you lauch that script as root, you need to be sure that root is able to launch graphical apps into your user's enviroment. To avoid dealing with this, you can make your users able to connect theirselves to internet following the guidelines at http://www.mandrakeuser.org/docs/

 

(2) I don't think launching graphical apps from such kind of scripts as a good idea.

 

HTH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...