From: unruh on 11 Dec 2009 18:16 ["Followup-To:" header set to comp.os.linux.misc.] On 2009-12-11, goarilla <kevin.paulus(a)skynet.remove-this.be> wrote: > On Fri, 11 Dec 2009 17:08:31 +0000, no.top.post wrote: > >> I've got a nice system that run 'on top of' linux and which can >> read/write linux files too. In order to still be able to see the other >> system's display, instead of switching to linux when I 'run' some simple >> linux commands I could perhaps eg. 1. write to a 'known special' file: >> "ls /usr/*" 2. which would, via some daeamon mechanism: >> read the 'known special' file and execute >> eg. "ls /usr/* > SpecialRetrnFile" >> 3. read/display "SpecialRetrnFile" >> >> How could I implement the linux daemon mechanism ? Or are their other >> more sophisticated but not too complex methods of doing such >> client-server transactions? A "less nice" but easy way would be to have cron run a program every minute to check on the mtime of the file, and if it is recent, run the program you want it to run . You will have a 1 min latency, which may be OK or not. Otherwise you could run a loop with a sleep in it to keep checking the file mtime and if it is recent, run the program. No daemons necessary. cron costs nothing, the "sleep" costs a bit. >> >> == TIA. >> >> PS. right now, I'm writing this with 'the other system' >> which will "News.Send <theFile>"; but will use the linux ppp to post >> the News. >> >> PSS. I just did: 'top > /root/top' >> But '/root/top' is accumulating instead of renewing ?! > > > i'm assuming here but it seems that your 'nice system' > creates files in a directory within the system hierachy (which > you shouldn't do if it can be avoided) > > and that you need a linux program (newer kernels received a nice mechanism > for doing this in kernelspace iirc http://en.wikipedia.org/wiki/Inotify ) > or script (which will do fine mostly) that informs you when the directory > and/or files to which your nice system writes to changes ? > > am i correct ?
From: despen on 11 Dec 2009 19:57 no.top.post(a)gmail.com writes: > I've got a nice system that run 'on top of' linux and which can > read/write linux files too. In order to still be able to see the other > system's display, instead of switching to linux when I 'run' some > simple linux commands I could perhaps eg. > 1. write to a 'known special' file: "ls /usr/*" > 2. which would, via some daeamon mechanism: > read the 'known special' file and execute > eg. "ls /usr/* > SpecialRetrnFile" > 3. read/display "SpecialRetrnFile" > > How could I implement the linux daemon mechanism ? > Or are their other more sophisticated but not too complex > methods of doing such client-server transactions? > > == TIA. > > PS. right now, I'm writing this with 'the other system' > which will "News.Send <theFile>"; but will use the linux ppp > to post the News. > > PSS. I just did: 'top > /root/top' > But '/root/top' is accumulating instead of renewing ?! I confess, I don't understand about 50% of what you have above. But if you're trying to share file system information between linux and something else, Start with Samba or NFS.
From: jebblue on 12 Dec 2009 00:20 On Fri, 11 Dec 2009 17:08:31 +0000, no.top.post wrote: > How could I implement the linux daemon mechanism ? Or are their other > more sophisticated but not too complex methods of doing such > client-server transactions? JSVC perhaps? http://commons.apache.org/daemon/jsvc.html -- // This is my opinion.
From: Jeremy Nicoll - news posts on 12 Dec 2009 02:01 Lew Pitcher <lpitcher(a)teksavvy.com> wrote: > On December 11, 2009 12:08, in alt.os.linux.slackware, no.top.post(a)gmail.com > wrote: > > > I've got a nice system that run 'on top of' linux and which can > > read/write linux files too. In order to still be able to see the other > > system's display, instead of switching to linux when I 'run' some > > simple linux commands I could perhaps eg. > > 1. write to a 'known special' file: "ls /usr/*" > > 2. which would, via some daeamon mechanism: > > read the 'known special' file and execute > > eg. "ls /usr/* > SpecialRetrnFile" > > 3. read/display "SpecialRetrnFile" > > > > How could I implement the linux daemon mechanism ? > > Or are their other more sophisticated but not too complex > > methods of doing such client-server transactions? > > Your requirements sound simple enough that you don't really need to go as > complex as a "daemon" process.... It's hard to know what the OP really means by his "nice system", and perhaps more to the point, what the "other system" whose display he doesn't want to obscure actually is. Is it the linux under the "nice system" or another machine / OS? If the latter might this be a situation to run VNC in? -- Jeremy C B Nicoll - my opinions are my own. Email sent to my from-address will be deleted. Instead, please reply to newsreplynnn(a)wingsandbeaks.org.uk replacing "nnn" by "284".
From: Henrik Carlqvist on 12 Dec 2009 02:55 no.top.post(a)gmail.com wrote: > PSS. I just did: 'top > /root/top' > But '/root/top' is accumulating instead of renewing ?! Yes, it is supposed to do that. command > file means that the file is opened for writing and all output from command is written to the file until the command ends. The fact that a command might send some output that can move the cursor on a terminal does not mean that there are any seeks done while writing the file. To mee it seems as if you would rather top -n 1 > /tmp/top.txt .... and possibly also repeat that, maybe from a cron job, maybe from a for loop in a shell script. Please also note that writing to /root/top is not a good idea. You are not allowed to write to that file unless you are root and running things as root should not be done unless you really know what you are doing. Root has far too much power to really mess things up if you make a mistake or if someone evil take advantage of something that you didn't think about. That is why most complex server daemons are run as other users than root. regards Henrik -- The address in the header is only to prevent spam. My real address is: hc3(at)poolhem.se Examples of addresses which go to spammers: root(a)localhost postmaster(a)localhost
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: wget - which port number(s)? Next: Re (2): HOW2 implement a daemon? |