Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Oct 2014, 22:38
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
MUT2 buggy edition
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 5 [69 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
Knuke

Joined: 14 Feb 2008
Posts: 1

PostPosted: Thu 14 Feb 2008, 17:45    Post subject: Another MUT problem
Subject description: Subject says it all
 

Ahoy There!

The other day I was working in the Wobbly version of NOP301. I used MUT to mount my Vista partition so I could read some files. Normally, I immediately unmount the partition and close MUT when I am done with it, but I forgot this time, and I switched to another desktop to do some other work. After a time, I realized that I needed to read those files again, so I opened up MUT in the second desktop to mount the Vista partition. MUT reported that the partition was still mounted (as it should have done), so I read the files, unmounted the partition, and closed MUT.

I did some more work in that second desktop, and then switched back to the first desktop. There was MUT, still running, and still reporting that the Vista partition was mounted. I hit the unmount button, and my computer went into doorstop mode - black screen, no keyboard, no mouse, nothing to do but turn it off and back on.

When I booted up the machine, Wobbly reported that I had shut it down improperly, and that I needed to run the Xorgwizard again. I tried this, but immediately after choosing Xorg, the machine went into doorstop mode again. Fortunately I had Puppy301 on another partition, so I booted into that, mounted the Wobbly partition, copied xconfig.bak into xconfig, and successfully restored my Xorg settings. I rebooted into Wobbly, and all was fine except for the sound.

I tested the behavior of MUT on Puppy301, and it does not allow for 2 instances of MUT to be running simultaneously - which is a good idea. If it is running on one desktop, and you try to start another instance of MUT in another desktop, it simply moves the first instance of MUT into the current desktop.

I think that the bug in Wobbly could be easily fixed with a short Bash launcher script that checks to see if MUT is already running before launching another instance. I would write one myself, but it has been a couple of decades since I have done any programming of any sort, and it would take me some time to read up on all of that again. I'm pretty busy these days doing other stuff. I know that there are people who do that sort of thing on a daily basis, and this would be a five minute hack to write and test.

I think that Wobbly is a fantastic achievement for such a small distro, and well worth the effort to fix. It might save a new user from hosing their config files, and not knowing how to recover.

All the best! -Knuke
Back to top
View user's profile Send private message 
raffy

Joined: 25 May 2005
Posts: 4777
Location: Manila

PostPosted: Thu 14 Feb 2008, 19:56    Post subject: script  

I guess Mozilla Seamonkey has that script in /usr/local/bin - making sure that there is only one instance of Mozilla running (am using Firefox now).

MUT2 acts as a daemon and consumes 3-4% of power of my 800 mhz Celeron CPU.

_________________
Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
Back to top
View user's profile Send private message 
JB4x4

Joined: 30 Jul 2006
Posts: 256

PostPosted: Thu 14 Feb 2008, 20:16    Post subject:  

Jesse,

Sorry, but no-go on CD/DVD eject controls. I have attached the output from the tests you have asked about.

JB
mut-test-1.tar.gz
Description 
gz

 Download 
Filename  mut-test-1.tar.gz 
Filesize  8.5 KB 
Downloaded  251 Time(s) 
Back to top
View user's profile Send private message Yahoo Messenger 
mcewanw

Joined: 16 Aug 2007
Posts: 2346
Location: New Zealand

PostPosted: Thu 14 Feb 2008, 21:43    Post subject: conceptually identical  

Code:

./mut mutclient --foreground --debug --nothreads > test1.txt


I realise looking above that what you call the "mutclient" is conceptually identical to my IPC program "wiak", so I probably don't need a copy of your source code to interface wiak to your mut server. In terms of interprocess comms, mutt works in exactly the same way as any of the backend servers I write when creating a wiak application. It writes to stdout, allowing the other parts of the program to pick up the data from there. So it is wiak-compatible in my parlance.

In other words, the programming model is the same as what I use writing wiakapps. A UI/GUI which is used as no more than a user interface sends events to an interprocess comms client (pipe, or message queue or socket) and the receiving daemon/backend server, processes the received command, and responds accordingly; it then communicates back, when required, by simply writing to stdout. In mutt2 you combine two of the functions into mutt itself, whereas I call wiak twice for the same effect in my wiakapps.

Even the way mutt is terminated is the same conceptually; your IPC client sends an option to the server:

Code:
./mut --exit


In such a system, using wiak, it looks like this:
Code:
./wiak --quit


Interesting. I haven't seen that exact model used before I published wiakrecord (the first wiak offering, which also uses a backend server written in C - which can be run as a daemon too). In fact, I have been advocating this methodology of writing system apps on my wiak pages, because of its flexibility in terms of allowing alternative user interfaces to be written or coded in an alternative coding languages; using stdout for comms output, as used here, and in wiakapps allows even bash to interface easily with the backend server, as in wiakrecord and mut2, even when that is written in C.

Anyway, if I am correct in how your system communicates/operates, I could certainly interface with it easily with wiak for the purposes of Speakpup or whatever. I wouldn't need the source code for that, simply the output codes your server writes out to stdout and their translation in terms of action/purpose.

Code:

mut2 GUI in tcl/tk, keypress event sending to backend server:

   "play" {    ;# Play the stopped audio CD
          catch "exec  $::mut/mut mutclient --drivecmd play $dev"
          }
  "pause" {    ;# Pause the playing the audio CD
          catch "exec  $::mut/mut mutclient --drivecmd pause $dev"
          }
   "stop" {    ;# stop Playing the audio CD
          catch "exec  $::mut/mut mutclient --drivecmd stop $dev"
          }

            
wiakrecord GUI in gtkdialog3, keypress event sending to backend server:

   <button>
      <input file stock=\"gtk-media-record\"></input>
      <action>\"wiakmv --zid 40006 --send go -l 3\"</action>
   </button>
   <button>
      <input file stock=\"gtk-media-pause\"></input>
      <action>\"wiakmv --zid 40006 --send pause -l 3\"</action>
      <action>\"wiakmv --zid 40006 --type 2 --send pause -l 3\"</action>
   </button>
   <button>
      <input file stock=\"gtk-media-stop\"></input>
      <action>\"wiakmv --zid 40006 --send stop -l 3\"</action>
      <action>\"wiakmv --zid 40006 --type 2 --send stop -l 3\"</action>
   </button>
   <button>
      <input file stock=\"gtk-media-play\"></input>
      <action>\"wiakmv --zid 40006 --type 2 --send stop -l 3\"</action>
      <action>\"wiakmv --zid 40006 --type 2 --send go -l 3\"</action>
   </button>
Back to top
View user's profile Send private message Visit poster's website 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Fri 15 Feb 2008, 00:19    Post subject: Re: conceptually identical  

Hi mcewanw,

I think I actually had a look at waik when I was considering the IPC for mut client and mut server. But what I wanted to achieve was slightly outside the waik box, and using an external app for the comms would have introduced a small extra delay, and I also wanted interactive sessions, and the ability to send C structures across in a compatible method, for that I used some aspects of xml tags that I have heard about in soap, but soap was way way an overkill for what I needed.
But yes, you're right there are very similar fundamentals about the IPC used in MUT2 and waik.
As you're a seasoned C programmer, you might quite enjoy having a look at MUT2's simple IPC, its actually quite a small piece of code, if I recell correctly.
MUT2's IPC strategy is that the MUT2 server maintains a list of C structures that describe the hardware list/state, and when the client connects, it can issue commands or request a copy of the structure data to be sent over, its an interactive session, so the client can do all the steps it needs to perform a conceptual operation.
The client and server are all compiled in one binary, so all the structure parameters are always identical, and then the client can just directly access all the parameters in the structures for each of the mut client interfaces.

Jesse
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 2346
Location: New Zealand

PostPosted: Fri 15 Feb 2008, 01:12    Post subject: Re: conceptually identical  

Jesse wrote:

The client and server are all compiled in one binary, so all the structure parameters are always identical, and then the client can just directly access all the parameters in the structures for each of the mut client interfaces.
Jesse


wiak is actually a child of morfi (which I have only published in binary form as yet); there is a copy of wiak embedded inside morfi. I also embed wiak inside morfi to avoid the delay of also using the external wiak and both share identical structure parameters for the same reason you have adopted that strategy in mut2 (indeed, morfi can be used a "big" wiak). However, though wiak can send C structures over to morfi (or two morfi's to each other) I didn't need that facility in wiakrecord and haven't decided what I want the C structure passing for yet - I just recognised that it would be useful for some complex data passing purposes.

Anyway, I'm happy to see you building your project in the manner you are. It opens doors in terms of making it easy to interface with. The only thing about it that I wonder about, is your developing the server as a daemon in order to maintain state information. It may not consuming much in the way of system resources, but it is a small continuous drain. Since I imagined that mut would not be called regularly, I thought you might have been able to store status info in a structured file or small database of somesort allowing mut only to be started when required. But I haven't thought much about the issues involved in such a utility, so I'm sure you have your reasons for making it a daemon.

I used to play chess quite well as a school boy, but later, at university I finally started reading chess books and my own chess playing style went to hell. Though I am curious about your own code therefore, at this moment, when I am still developing the wiak family, I prefer therefore to look as little as possible at others code (unless I hit the blank page of vanished inspiration)! I know that may not make much sense, but its just a theory I have. Once my projects are all going to my satisfaction, then I like to look at alternative similar projects for renewed inspiration and ideas (it is probably only at that stage that my own work becomes any good).

I would, however, always acknowledge, in my distributions, using any portion of another projects code, algorithm, or more important and fundamental than these, any conceptual idea; the latter is the main creative part really. Using a special inter-process communication client, such as in the wiak-driven applications and now mutclient in mut2, to simplify and enhance the button-press event handling of the GUI/UI in a client/server arrangement is quite new and unique from my explorations. It separates the main processing into a separate backend server and allows a great deal of flexibility in User Interface client design. I'm glad I noticed this thread.

I might however be interested at this stage in the response codes sent out by mut2 daemon to the mutclient so that I can experiment with interfacing to it. That would indeed be easier than sifting through your source code looking for what is written out and when. Whether I'd get round to writing a possible commandline client is another matter; too few hours in the day at present! Smile

Last edited by mcewanw on Sat 16 Feb 2008, 21:30; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
cb88


Joined: 28 Jan 2007
Posts: 1169
Location: USA

PostPosted: Fri 15 Feb 2008, 01:24    Post subject:  

jesse how distro independant is MUT2? if you think it is worth a try i could give it a go on slackware... and is running it as a user supported? would a pop up to allow permissions be needed to mount things?
_________________
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30
Back to top
View user's profile Send private message Visit poster's website 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Fri 15 Feb 2008, 02:18    Post subject:  

Hi cb88,

The mut executable is statically linked, so there are no library requirements for it, but the gui component requires everything attached to tcl/tk to be present.
The mut executable gets a lot of its information from the /sys which is a Linux Kernel 2.6 only thing, so that rules out some early Puppy distros that used 2.4, and other non- 2.6 Kernel distros.

MUT2 does not attempt to do anything about username permissions. It is programmed with the assumption that it can use and access what is allowed by the kernel, running it under another distro like slackware and as a non-root user will limit its functionalty, for example mut will not be able to read partition tables from the hard disk, so there will be no partition information to display on drives.

I just tried now on my work machine which is Fedora 6, and you can see the names of the drives, but that is about it. Running as root user allows it to see all the information.

MUT2 would probably be considered as a serious security risk by security experts, theres no user permissions to speak of, and another program on the same computer with evil intent could ask mut to unmount the root filesystem, which is very bad for any Linux box. The MUT2 communicates with itself on a TCP/IP address 127.0.0.2, I'm not sure if those can be fudged on a network to get into a Linux Box.

MUT2 pretty much has to be run as root for it to provide any useful information. You'll probably be ok running it on other distros as root user. You only need the background daemon running as root, the gui will work with it from any username. This is another security risk.
I'm interested to know how it works for you on slackware?

Jesse
Back to top
View user's profile Send private message 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Fri 15 Feb 2008, 09:30    Post subject: Re: Another MUT problem
Subject description: Subject says it all
 

Hi Kune,

Yes there were quite a few design issues with the first MUT.
And I think there are less design issues with the MUT2, but its still buggy at the moment.

I've been thinking about the problem you mentioned about MUT, (0.1.1?) that you had problems with, I think what happened to kill your system dead was the fuser commad that it issues before attempting to unmount the partition on the second attempt.
I think that fuser command is the culpret, and as you found out quite a bad strategy, as the fuser command refering to an umounted mount point refers to the underlying filesystem, the root filesystem in your case, and all processes using a file on that filesystem got told a signal SIGKILL, which kills them outright, including X and all X applications with a window open.

I am steering clear of that fuser comand with MUT2, but I havn't yet determined how to report a problem that the server encounters, like the unmount command failing. Perhaps that is what I should investigate next, reporting on problems is a very important step in getting them resolved.

The MUT 0.1.1 didn't autorefresh when mount points change by other programs, it did auto refresh on usb events and button clicks. The MUT2 is constantly refreshing and updating on all the aspects that it presents while the gui is open, this does use some cpu sure, but there should be virtually minimal penalty closing the gui and opening it later when you need it.

I hope that helps

Jesse
Back to top
View user's profile Send private message 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Fri 15 Feb 2008, 09:44    Post subject: Re: script  

Hi raffy,

I wonder what it is doing to use that much, I get about 0.1% to 0.4% cpu use on average when the gui is open, and that drops to 0.0% when the gui is closed. I have a CD/DVD drive and an IDE disk, and an AMD Athlon(tm) 64 X2 Dual Core Processor 4800+. Hmm, maybe thats it.
I guess the cpu load would be proportional to how many disks/drives that you have?

Jesse
Back to top
View user's profile Send private message 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Fri 15 Feb 2008, 10:05    Post subject:  

Hi JB,

Thanks for taking the time to send the output, unfortunately I've been a bit clueless, it seems that the commands that ask the drive to eject and close don't have errors reported, even if there were errors reported. I'm sorry, my bad Embarassed but it was interesting having a look through all the partition node layout on your hda that you have, I take it that they were all detected ok?
I have had a few ideas about making error reporting easier, and I do think that needs to happen considering the number of oddities that have come up so far.
I have recently been using a proram on Solaris called 'truss' its very useful for debugging and I'm trying to think of a way to make that level of tracing occur in MUT2 server, and then be reported somehow...

Jesse
Back to top
View user's profile Send private message 
nic2109

Joined: 01 Jan 2007
Posts: 406
Location: Hayslope, near Middlemarch, Midlands, England

PostPosted: Fri 15 Feb 2008, 18:44    Post subject:  

Hello; I have tried to try MUT2 but without success. I downloaded the file and expanded it into a directory of its own. The only thing that happens when I click on mut2.tcl is a vi window. See the screenshot,

Have I missed a step?

I'm keen to try it out as MUT1 had a problem which made me one of the minority that preferred pmount. My laptop has a built-in slot for SD memory cards, but MUT never ever detected it whereas pmount always did (except in early Dingo alphas).

I'm using muppy008 which is MU's build of puppy 3.01.

Nick
MUT2 Problem.png
 Description   
 Filesize   376.33 KB
 Viewed   403 Time(s)

MUT2 Problem.png


_________________
Nick
Back to top
View user's profile Send private message 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Fri 15 Feb 2008, 21:58    Post subject:  

Hi Nick,

Oh yes, there is one extra one-off step you need to do.
Right click on the mut2.tcl file in rox, on the menu "File 'mut2.tcl'" -> "Set Run Action", it will open up a window, where it says "Enter a shell command:" type in the word 'wish' so that it looks like:
wish "$@"
Then click "use command", and its all set up.
Wish is the "WIndow SHell" interpreter for tcl script files.

Jesse
Back to top
View user's profile Send private message 
nic2109

Joined: 01 Jan 2007
Posts: 406
Location: Hayslope, near Middlemarch, Midlands, England

PostPosted: Sat 16 Feb 2008, 07:32    Post subject:  

Jesse wrote:
Hi Nick,

Oh yes, there is one extra one-off step you need to do.
Right click on the mut2.tcl file in rox, on the menu "File 'mut2.tcl'" -> "Set Run Action", it will open up a window, where it says "Enter a shell command:" type in the word 'wish' so that it looks like:
wish "$@"
Then click "use command", and its all set up.
Wish is the "WIndow SHell" interpreter for tcl script files.

Jesse

Thanks Jesse.

Well that made a difference, but it's not yet "working" as the window comes up empty. Clicking on Rescan brings up another little dialogue box saying "Restart MUT daemon.....". See screenshot. Crying or Very sad

Thanks.

Later Addition:

Following the advice from an earlier post I have tried it from the command line with "interesting" results.

Code:
./mut mutclient --debug

ended with :-
Code:
ERROR: TH080F6830 DriveContext no pointer? meaning no drives?
(see mut.log1 attached for the full file) and
Code:
./mut mutclient --debug --foreground --nothread --nofork

got into a loop following the hardware scan. See mut.log2 attached for the relevant stuff.

I hope this helps. And thanks.

Nick
mut.log2.gz
Description  Output from mut with all the options.
gz

 Download 
Filename  mut.log2.gz 
Filesize  541 Bytes 
Downloaded  279 Time(s) 
mut.log1.gz
Description  Output from --debug
gz

 Download 
Filename  mut.log1.gz 
Filesize  529 Bytes 
Downloaded  265 Time(s) 
MUT2 Problem#2.png
 Description   
 Filesize   156.52 KB
 Viewed   370 Time(s)

MUT2 Problem#2.png


_________________
Nick

Last edited by nic2109 on Sat 16 Feb 2008, 16:14; edited 1 time in total
Back to top
View user's profile Send private message 
Everitt

Joined: 19 Dec 2006
Posts: 331
Location: Leeds,UK or Birmingham, UK

PostPosted: Sat 16 Feb 2008, 10:03    Post subject:  

Sorry if I'm missing something, I admit I didn't read all of the last couple of pages, just searched them for relevant terms. Embarassed

I believe there is an issue with the server under Dingo 395. I'm running
Code:
./mut --foreground --debug

in one terminal, and
Code:
./mut

in another produces correct out out from the ./mut, but produces a segfault from the server. I'm attaching a text file containing it's full output.

I believe the lines
Code:
end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 0
mut[7535]: segfault at 00000000 eip 08056be6 esp bfacf3d0 error 4
from dmesg are the only relevant ones. Hard to tell, I ran it multiple times before checking Embarassed
The same info is in /var/log/messages.

I've got an Asus m/b with a sata II hdd (two partions; ntfs and ext3) (I think it's on secondary master)
I do have a floppy disk, but I'm not sure if it works.
1 optical drive, a dvd on the primary IDE slave

Both the DVD and HDD work fine, so I don't think the hardware / puppy core are to blame.

Hope this is helpful!
Everitt
[/code]
err.txt.gz
Description 
gz

 Download 
Filename  err.txt.gz 
Filesize  3.8 KB 
Downloaded  275 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 5 [69 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1304s ][ Queries: 12 (0.0054s) ][ GZIP on ]