Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: HOW2 implement a daemon?

0 views
Skip to first unread message
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

jebblue

unread,
Dec 12, 2009, 12:20:40 AM12/12/09
to
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.

Message has been deleted
Message has been deleted
Message has been deleted

no.to...@gmail.com

unread,
Dec 12, 2009, 10:05:10 AM12/12/09
to
In article <pan.2009.12.12....@deadspam.com>, Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:

> no.to...@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.

OK.
>
> 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 me 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.
> ...........
OK, I can't wait 1 minute to get a reply, but I can wait
1 minute for the 'mode' to get up steam; which would THEN:

REPEAT
1. IF file:/tmp/ETHoberonFlag exists
THEN execute the script [which was written by ETHoberon]
eg. ls -l *dog > /tmp/ETHoberonCmndOutput;
rm /tmp/ETHoberonFlag
UNTIL file:/tmp/ExiLoop exists

So then to start this mode, I'd
1. write the file which tells cron-1minute to loop
2. write the command to be executed
3. write the flag-file for 'command pending'
and for each additional command I'd do steps 2,3.
and to leave this mode:
4. rm <the flag-file which tells cron-1minute to loop>

OR ??
So if the concept is valid, which file/S get the
commands to execute every minute ?

== TIA.

PS. I see: http://en.wikipedia.org/wiki/Inotify
> intended as a replacement for dnotify
> kernel from release 2.6.13
I'm still using K 2.4* and don't want to mess at K-level.

Message has been deleted
Message has been deleted

Aragorn

unread,
Dec 12, 2009, 6:23:16 AM12/12/09
to
On Saturday 12 December 2009 04:40 in comp.os.linux.misc, somebody
pretending to be Lew Pitcher, but considering the troll-like/shill-like
nature of his post more likely to be Roger Maynard, wrote...

> In alt.os.linux.slackware des...@verizon.net wrote:
>
>> 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.
>
> No. There are drivers available for windoze for ext2, at least,
> that install almost automatically, and don't feature nearly the
> hassles or security issues of Samba or NFS.

ext2 drivers for Windows are intended for accessing an ext2 filesystem
on the same computer as is running Windows. This may not be what the
OP wants. An ext2 driver for Windows is pretty useless if one is
trying to access a GNU/Linux filesystem from a Windows machine across
the network.

> Samba and NFS are 1980ish technology.

UNIX is 1969'ish, 1970'is technology, and it still beats Windows hands
down.

> You will find in almost every instance that for every app, driver,
> etc., that is written for windoze, the corresponding app, etc., for
> linux is far inferior.

I suppose that this is why a UNIX system with Samba is more efficient
and proficient at mimicking an NT server than an actual NT server,
then?

Windows has been limping around about 15 years behind everyone else for
the last two decades. When Windows Millenium Edition was introduced in
either 1999 or 2000, despite its poor support for DOS applications, it
actually still ran as a DOS-extender itself, 18 years after DOS was
first released. Due to this, MS-Office 97 still comprised of 16-bit
code for more than half of its entire codebase, and that also goes for
just about everything Windows-based from that time.

The only real difference with now is that the code has now been
recompiled to 32-bit or 64-bit, but it's still a single-user concept.
They're not even touching upon half of the power of the underlying NT
kernel - not that it's a better kernel than Linux, but it's certainly
more advanced than what it's being used for.

> And that's because of a variety of reasons - windoze software is
> written by teams of expert coders who do this fulltime, for a living.

Yep, and that's why their code sucks. They do this for a living, so
they have to do it whether they're feeling inspired or not, and they
have deadlines to catch. And then the code is released to the public,
ready or not. Doesn't make a difference, because there's no money back
guarantee. The customer has to buy the stuff first - either directly
or as an OEM that is forced upon them when they buy a brandname PC -
and only then can the customer see that it's just a new version of the
same pile of junk. Slow, buggy, unstable, a barebones nothing, and
totally outdated in a networked, multi-user world where cybercrime is
an actual problem.

You seem to be wanting to hint at GNU/Linux (and other Free & Open
Source Software) developers being amateurs. Well, the word "amateur"
actually means "driven by a passion", but for your information, Linus
Torvalds and friends are qualified engineers, and the same goes for the
GNU guys - Stallman was working on artificial intelligence at MIT when
he founded the FSF - and the Apache guys, the X.Org guys, and so on.
OpenOffice is an Open Source version of StarOffice, which was a free
(in the meaning of "gratis") but proprietary software suite from a
German company - the name eludes me right now - that was purchased by
Sun Microsystems. FireFox is the Open Source version (and successor)
of Netscape. All hardly "amateur" stuff (in your meaning of the word).

They know what they're doing, they can count on peer review with regard
to the quality of their code, and they don't have a pointy haired boss
sitting on their shoulder like a vulture. Open Source doesn't work like
that. By nature of the development model, it's a community-driven
development platform, even if the source originates at one particular
entity, as is for instance the case with the various *BSDs. Read "The
Cathedral And The Bazar" by Eric S. Raymond.

> Windoze software sells and linux software doesn't.

I suspect that this /may/ have something to do with the fact that
Windows software is proprietary and solely commercially available,
while most Free & Open Source Software is being given away free of
charge. Can I get a "Duh!" from the audience, please? <grin>

> The unix style of operating system (directing streams of
> information) was out of date by 1980.

Absolute hogwash. Just because a few geeks in Redmond thought it was
time for something far more corrupted and corruptible than UNIX doesn't
mean that it was outdated. The quality of the UNIX design still
stands, and is fully standardized - Single UNIX Specification, POSIX,
and friends.

UNIX is considered the most portable of all operating systems, and
considering the perversions in DOS, Windows and affiliate systems -
e.g. separate control characters for linefeed and carriage return,
in-file end-of-file characters - it is still the most logical design.
And that's because UNIX was *not* developed with commercial interests
in mind, but simply to Just Work (TM).

> C is still the single most important language to linux/unix just as,
> at one time, assembly language was the most important, and most
> commonly used language, in computerdom.

Assembly is still used in the Linux kernel for those parts which are
processor-specific, and there still are other operating systems which
are entirely - or at the very least, at kernel level - written in
assembly.

C may not be the best of programming languages, but it's a very good
one, and C++ and the likes are only extensions to that, just as there
was an object-oriented version of Pascal.

> But C, just as assembly came to be earlier, is too low level to be
> useful in a modern programming environment.

What constitutes "a modern programming environment" is a very subjective
concept. UNIX and C are tuned towards eachother and work very well.
UNIX is also an integrated operating system, in which the applications
become part of the operating system itself - which is as it should be.

> C constantly asks a progammer to reinvent the wheel, compared to C++,
> Java, or visual C and as such it takes too long to write a significant
> project.

C++ is only C on steroids. Visual C is a Microsoft integrated
development environment and thus a Microsoft *application* - not a
language. Java is a platform-independent language by virtue of its
nature as bytecode, requiring a Java runtime engine (or Java virtual
machine, if you like). Java is therefore as slow as it is
platform-independent.

> While C is certainly faster, modern hardware no longer requires the
> speed savings that C offers.

I suppose this is why recent versions of Microsoft Windows - a
single-user operating system - require hardware that ten years ago
would still make up for a decent minicomputer or a small mainframe
then?

And surprisingly enough, most of Windows was written in C, albeit that
it may have been using that Visual C IDE you spoke of earlier. Hmm, if
it's anything like FrontPage, then it's bound to bloat the code
immensely with unnecessary junk that only gets in the way. Maybe that
explains why Windows Vista offers you the performance of a PC-AT on
hardware that would ten years ago still be good enough for a multi-user
minicomputer or mainframe.

> And programming in object-oriented languages offers a conceptual
> framework for program design that completely blows previous languages
> away.

There is a place for everything, but object-oriented languages are an
absolutely terrible choice for writing an operating system in.

> How many of you assholes have ever written a real flowchart?

I have, actually, but then again I'm not an asshole, so I may not
qualify for answering that question. <evil grin>

> Which language do you think Linus T, or even the Bell Lab guys,
> would use if they were starting out now?

C, with some assembly code in it. And by the way, it was "the Bell Lab
guys" who *invented* C.

> And I realize that C and unix were written simultaneously. That is
> part of the problem that linux and unix face now.

C was developed so as to be able to write operating systems in, by one
of the guys who wrote the very first UNIX - I believe it was Ken
Thompson but it may have been Dennis Ritchie - and UNIX was then
rewritten in C when they wanted to port it to the PDP-11 on which it
ran at AT&T when it was processing patent documents. It was originally
written in assembly on a PDP-7.

> Probably the most impressive "app", if you will, available for unix
> is KDE and this is the only significant app written in C++, although
> we stand to be corrected on that point.

KDE is a graphical user interface. You cannot compare that to an
operating system. There is a lot more to an operating system than a
point & click interface. Maybe one day the guys at Redmond will
realise that too, but then again, I'm not holding my hopes up high,
considering that they still don't realize that single-user operating
systems are outdated.

> Meanwhile, all of the significant programming tools for windoze are
> 21st century.

*Everything* in Windows is 21st century... B.C. <grin>

> But we do stand to be corrected and we would enjoy a reasoned debate
> on an abstract issue once in awhile, rather than the usual
> name-calling from the usual bunch. We earned our Computer Science
> degree in 1994 and the OO stuff was barely more than a rumour back
> then. We never used them very much, but they are all over the place
> now. But from what we understand nobody in university uses C or
> assembly any more, at least not at any significant level. [...]

Then your understanding is wrong. One uses the programming language
that best suits the needs. Some things require a high-level
programming language, some require a lower level language. There is
no "one size fits all".

--
*Aragorn*
(registered GNU/Linux user #223157)

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Lew Pitcher

unread,
Dec 12, 2009, 8:23:10 PM12/12/09
to
In alt.os.linux.slackware Aragorn <ara...@chatfactory.invalid> wrote:
> On Saturday 12 December 2009 16:39 in comp.os.linux.misc, somebody
> identifying as des...@verizon.net wrote...
>> Lew Pitcher <LPit...@techsavvy.ca> writes:
>>> In alt.os.linux.slackware des...@verizon.net wrote:

>> Someone pretending to be Lew?
>
> Yes. His name is Roger Manyard.

Oh, gee, here we go again...

WTF is Roger Manyard and why does he get blamed for everything
around here? Can't some of you clowns take responsibility for your
own incompetence but that you have to drag this poor fucker's body
out of the closet to give it a few kicks?

> He's using Lew's name for posting pro-MICROS~1 drivel in GNU/Linux
> newsgroups, and he's using two different domains in his "e-mail
> address" field.

Actually, "he" is not using anybody's name for anything. I am using
the name Lew Pitcher and I believe I am entitled to do so since I
am, after all, the registered owner of lewpitcher.ca and
lewpitcher.com.

The other guy who calls himself L Pitcher is actually the owner of
justlinux.ca and a simple bit of research on your part will tell you
that the owner of justlinux.ca has, since over seven years ago,
been the same Mr. Manyard that you speak of above.

Look it up. You do know how, right?

Again, I am Lew Pitcher at LewPitcher.ca while the other "L Pitcher"
owns justlinux.ca which Mr. Manyard first registered 7 years ago.

Now, if you read that once or twice again you may be able to come up
with an understanding as to who is the _real_ Lew Pitcher.

Or you may not. It doesn't matter to me, but if you want to be the
"man in the know" around here, you should try and stay on top of the
facts, ok?

ok?

Lew Pitcher

I am gay and I am so fucking proud of it!!!!!!!!!!!!!!

lpit...@techsavvy.ca
LewPi...@LewPitcher.ca

--
Official Website -->> http://lewpitcher.ca/
My Trophy -->> http://justlinux.ca/
Something to look at: -->> http://www.emusclemag.com/
Lonely in Brampton? -->> http://gaypros.meetup.com/cities/ca/on/brampton/
Peel HIV/AIDS Network -->> http://www.phan.ca/home.html

Message has been deleted
Message has been deleted

Eef Hartman

unread,
Dec 22, 2009, 5:43:51 AM12/22/09
to
In alt.os.linux.slackware no.to...@gmail.com wrote:
> BTW. can any body comment on my 'top > nextTop' accumulates
> instead of updates' observation ?

Why should it NOT?
top updates its screen every 5 seconds, and all that output is
accumulated in the redirected output file.
Someone already told you to use the -n 1 option to let top exit
after a single iteration:
-n : Number of iterations limit as: -n number
Specifies the maximum number of iterations, or frames, top
should produce before ending.
and the -b option might also be useful:
-b : Batch mode operation
Starts top in 'Batch mode', which could be useful for sending
output from top to other programs or to a file.
(both from the man page)
--
*******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M....@tudelft.nl - phone: +31-15-278 82525 **
*******************************************************************

Message has been deleted
Message has been deleted
0 new messages