[H-GEN] Samba on SuSE 8.1
Jason Parker-Burlingham
jasonp at uq.net.au
Wed May 7 18:51:44 EDT 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
Alex Delaforce <alextdel at bigpond.net.au> writes:
> What is the quickest way to find out if the server is running. It is set
> up as a daemon. I've tried using 'ps -a'. It gives a fairly long list
> but doesn't seem to show some services that I know are running. I
> therefore don't feel overly in control of what it is reporting.
Oh shoot. I missed this one. I like to use something like the
following:
$ ps awwux | grep [s]amba
Let's pick that apart. "ps" lists processes. But by default it
doesn't list them all and it truncates its output to fit your
terminal, so the w option(s)[1] turn that off. The "u" and "x"
options make ps report on every process.
Now that we have a report about every process we want to limit that to
just what we're interested in. This means using grep. The only
tricky bit about that is the pattern we use to do it because sometimes
we'll get extra information that we don't want:
[0]henry at freezer:henry $ ps ax | grep inet
26460 ? S 0:00 /usr/sbin/inetd
[0]henry at freezer:henry $ ps ax | grep inet
26460 ? S 0:00 /usr/sbin/inetd
1049 pts/3 S 0:00 grep inet
(I used "ps ax" here to keep the output narrow as it appropriate for
email.) The pattern "inet" (remember the argument to grep is a
regular expression, not a string) is also matching the "inet" in "grep
inet". So what we want is a pattern that matches the row of ps output
we're interested in, but does not match the pattern itself.
The [s] in "[s]amba" means "match any of the characters `s'". If we
put extra characters in there ([abc]) it would match any of them at
all ("a", "b" or "c"). But for "[s]amba" can't match itself in the ps
output because there is nothing to match the brackets! Huzzah!
jason
[1] : I discovered once that I had to put in extra "w" arguments to
get all the output I wanted. I don't know if that's still
required.
--
``Oooh! A gingerbread house! Hansel and Gretel are set for life!''
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list