Page 1 of 1

[semi-Solved] LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 06:41
by fanthom
Hi all,
another bug is waiting for a solution :)

the story:
Lxde menu doesn't get updated after inserting porteus module. i have found that ~/.cache/menu/* file needs to be updated to achieve the goal.
Solution from here:
http://wiki.lxde.org/en/LXPanel

Code: Select all

#!/bin/bash
killall lxpanel
file=`find ~/.cache/menus -name "*" -type f`
rm ${file}
lxpanel -p LXDE &
works but there must be a better way io doing it.
proof: when i do 'installpkg vlc-1.1.7-x86_64-2alien.txz' then /home/guest/.cache/menu/* file is updated as well as lxde menu without killing lxpanel.

please help me figuring out how to update /home/guest/.cache/menu/* without killing lxpanel (installpkg does it somehow).

Cheers

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 10:59
by tiger
I suppose lxde menu-cache daemon doesn't monitor adding of *.desktop files to /usr/share/applications by aufs (maybe it's aufs problem, but most likely it's menu-cache though). But menu-cache daemon does monitor *.desktop files normally copied to /usr/share/applications. You can check it by manual copying/removing *.desktop files in /usr/share/applications. Donna know how to fix this at this moment (will keep trying to figure it out).
Clearing cache and restarting lxpanel thru lxpanelctl (like below) works the problem out. So, in this case, lxpanel finds *.desktop added by aufs (?so, maybe we need to patch menu-cache somehow?).

Code: Select all

#!/bin/bash
file=`find ~/.cache/menus -name "*" -type f`
rm ${file}
lxpanelctl restart
UPD:
Even modifying *.desktop file in /usr/share/applications recovers menu-cache daemon's sight :). So, f.e. activating vlc.xzm and modifying vlc.desktop (f.e. touch -m vlc.desktop), brings vlc to lxde menu.

UPD2:
Restarting of menu-cached doesn't help.

UPD3:
touch -m /usr/share/application also works the problem out.

UPD4:
Something strange:

1) Activate vlc.xzm
2) Delete /usr/share/applications/vlc.desktop
3) Deactivate vlc.xzm
4) Activate vlc.xzm

vlc.desktop - doesn't appear in /usr/share/applications anymore (?something's wrong with aufs branches?)
Is it allright?

UPD5:
Several activate/deactivate of a module hangs up the system :%)

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 17:22
by ponce
tiger wrote:UPD:
Even modifying *.desktop file in /usr/share/applications recovers menu-cache daemon's sight :). So, f.e. activating vlc.xzm and modifying vlc.desktop (f.e. touch -m vlc.desktop), brings vlc to lxde menu.
I think that's it, great job tiger!

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 17:44
by tiger
ponce wrote:
tiger wrote:UPD:
Even modifying *.desktop file in /usr/share/applications recovers menu-cache daemon's sight :). So, f.e. activating vlc.xzm and modifying vlc.desktop (f.e. touch -m vlc.desktop), brings vlc to lxde menu.
I think that's it, great job tiger!
maybe, but we still have a problem... and no suitable way to fix it....

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 19:28
by Hamza
@tiger

Please respect this rule !
* No Quote pyramids.

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 19:36
by tiger
@Hamza - what's the rule you talk about? I'm
miss clued

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 09 Mar 2011, 20:38
by Hamza
@tiger,

Looks at Forum Rules

You must read the rules before to post any messages.

Re: LXDE - update ~/.cache/menu/16e*** file

Posted: 12 Mar 2011, 12:45
by fanthom
i have written long explanation but was logged out automatically as per long delay and it's all lost now :(

short story:
.desktop files must appear in writable aufs branch (/mnt/live/memory/changes) to be catch up by 'menu-cache' demon. this can be done in two ways:
- 'installpkg' as it copies all files into live fs
- 'touch' utility which updates time stamp on a file when module is inserted (mounted) into live fs and causes that .desktop file appears in /mnt/live/memory/changes/usr/share/application.

i have added extra function to activate which checks if .desktop files exists in a module and touches them. deactivate does the same but removes it from /usr/share/application.

i still see one potential bug:
user boots porteus with changes parameter - > activates a module -> shuts down porteus -> removes xzm from /porteus/modules under other OS -> boots up porteus -> still gets .desktop in /usr/share/applications as it was never removed by deactivate script.
looks like we need to live with these workarounds until aufs matures on 2.6.38 kernel with xz compression for squashfs.

i have tried aufs-utils (didnt play with aubrsync, auchk, auplink - just 'mount.aufs' helper). if you want to make an experiments here they are:
http://www.mediafire.com/file/oce5gddok ... 4-1ftm.xzm
may need to update initrd.xz as well to be 100% sure that all branches are mounted with aufs-utils. tried that already but same bugs exists.

Thanks a lot for your help guys (especially tiger and ponce).
will release SP1 for BETA tonight so you can test new acitvate/deactivate scripts.

Cheers

Posted after 2 days 13 hours 37 minutes:
Re: [semi-Solved] LXDE - update ~/.cache/menu/16e*** file
@tiger
Something strange:

1) Activate vlc.xzm
2) Delete /usr/share/applications/vlc.desktop
3) Deactivate vlc.xzm
4) Activate vlc.xzm

vlc.desktop - doesn't appear in /usr/share/applications anymore (?something's wrong with aufs branches?)
Is it allright?
this time it's not an aufs bug (what a relief!), it's a feature :)
when you delete a file which belongs to a module inserted into aufs then special file is created in 'rw' aufs branch, example:
after:
rm /usr/share/applications/cups.desktop
you get:
/mnt/live/memory/changes/usr/share/applications/.wh.cups.desktop
what's the purpose of this .wh.cups.desktop file?
it makes this file invisible in the live system even after reboot (in case when you are saving changes with 'changes=' cheatcode).

aufs writable branch has 2 features:
1) let's you add files to the live fs
2) lets you remove files from modules which are creating live fs (it's a 'fake' remove, the files are still inside the modules - you just can't see them)

if you want to make deleted files visible again you need to:
1) copy deleted file back to live fs:
cp /mnt/live/memory/images/002-xorg.xzm/usr/share/applications/cups.desktop /usr/share/applications
now blocking .wh. file in /mnt/live/memory/changes/usr/share/applications/ gets wiped out
2) delete .wh. file manually and then activate module (not recommended)

Cheers