FvwmCommandS error in opening message fifo

Hi There!

I have a small shellscript, which checks a website, loads down some content, builds a small icon, and this icon is sent to a Button in FvwmButtons.

The Button:

*FvwmShelf: (6x2, Frame 0, Padding 2 0, Left, Id "Meteo",Icon /path/to/meteo_fetch_icon_button.png)

And the only code-snippet in the shellscript, wich updates this Button:

FvwmCommand "CHANGE_ICON Meteo $DIR'meteo_fetch_icon_button.png'"

The called function “CHANGE_ICON” is this:

[code]DestroyFunc CHANGE_ICON
AddToFunc CHANGE_ICON

  • I SendToModule FvwmButtons ChangeButton $0 Icon $1[/code]

The shellscript is called every 20 Minutes, and is the only one process, which changes this Icon with a cronjob.

And every 20 Minutes i receive an email from cron-daemon:
“No such file or directory FvwmCommand error in opening message fifo”

But

$ ps aux|grep FvwmCommand jakob 20092 0.0 0.0 13404 704 ? S 00:27 0:00 /usr/lib/fvwm/2.6.5/FvwmCommandS 11 4 none 0 8

FvwmCommandS is running… and there are two Named-Pipes in the $FVWM_USERDIR…

What’s wrong?

scientific

Oh fuck i know, where the problem is… :-/

But it is strange…

I split the shellscript in two. The first one catches the data from the website. The second one prepares the date and updates the icon in the button.

If the first script is run by root (from a cronjob), it checks all users with an uid >= 1000, if there is a config (town, key) in the ~/.meteo/ directory. If yes, download the data. If no, skip.
If this script is called by a user (from the Button…), it only checks for this user.

And the $FVWM_USERDIR isn’t passed to this script… :-/

There is a sudo-call für the second script, and i needed the option -E to pass the environment to the shell.

Now it works without Error, because the second script knows the FVWM_USERDIR.

[EDIT]
But only, if i call the script from the xterm…
From a cronjob, not.

Is there a posibillity to get the FVWM_USERDIR in the shellscript? Because i use another Userdir like in Fvwm-Crystal or Nightshade…
[/EDIT]
scientific

You have to export your new userdir before login. See bin/fvwm-nightshade. You have to do the same for your directory]
export FVWM_USERDIR=$HOME/.what-ever-directory
[/code]

  • Thomas -

It was another thing… Using sudo -E in the script. Because sudo discards the environment… And there is a sudo-command in my script.

I changed the whole thing. There is no need for a cronjob, which doesn’t get the Environment of a running fvwm-session… I start the script from an FvwmScript periodically.

Thanks for help :slight_smile:

scientific