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

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

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

Post#1 by fanthom » 09 Mar 2011, 06:41

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
Please add [Solved] to your thread title if the solution was found.

User avatar
tiger
White ninja
White ninja
Posts: 4
Joined: 02 Jan 2011, 11:48
Location: RF

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

Post#2 by tiger » 09 Mar 2011, 10:59

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 :%)
No signature for now...

User avatar
ponce
Contributor
Contributor
Posts: 89
Joined: 28 Dec 2010, 10:15
Location: IT
Contact:

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

Post#3 by ponce » 09 Mar 2011, 17:22

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!

User avatar
tiger
White ninja
White ninja
Posts: 4
Joined: 02 Jan 2011, 11:48
Location: RF

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

Post#4 by tiger » 09 Mar 2011, 17:44

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....
No signature for now...

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

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

Post#5 by Hamza » 09 Mar 2011, 19:28

@tiger

Please respect this rule !
* No Quote pyramids.
NjVFQzY2Rg==

User avatar
tiger
White ninja
White ninja
Posts: 4
Joined: 02 Jan 2011, 11:48
Location: RF

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

Post#6 by tiger » 09 Mar 2011, 19:36

@Hamza - what's the rule you talk about? I'm
miss clued
No signature for now...

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

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

Post#7 by Hamza » 09 Mar 2011, 20:38

@tiger,

Looks at Forum Rules

You must read the rules before to post any messages.
NjVFQzY2Rg==

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

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

Post#8 by fanthom » 12 Mar 2011, 12:45

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
Please add [Solved] to your thread title if the solution was found.

Post Reply