Detecting Unix flavors

  • Thread starter Andrew Thompson
  • Start date
A

Andrew Thompson

I am working on an installer for Java based
'SaverBeans' ScreenSavers.

The windows set-up is pretty straightforward,
but the versions for Unix flavors (Java Desktop,
Solaris, Red Hat and 'Other Unix' - no Mac,
sorry) are more complicated in that the target
directories are different between them.

In order to help me sort them, I was wonderring
if some of our Unix enabled posters could report
what their systems are reporting for..
<http://www.physci.org/pc/property.jsp?prop=os.name+os.version>
 
S

Sudsy

Andrew Thompson wrote:
In order to help me sort them, I was wonderring
if some of our Unix enabled posters could report
what their systems are reporting for..

Absolutely nothing on screen, although "null 0" shows up in the
Java console. I'm running Linux kernel 2.2.16.
 
A

Andrew Thompson

Andrew Thompson wrote:


Absolutely nothing on screen, although "null 0" shows up in the
Java console.

That's odd, same here. Yet I cannot see any
System.out calls that would result in that..
It is not even the form of output I'd use.

...and I checked the page before and ypur
post and it seems to work as I expect.. (shrugs)
..I'm running Linux kernel 2.2.16.

So the OS reports "Linux kernel" for
"os.name"? That could be a problem..

As I understand, Red Hat, SuSe and Debian
are all implementations of Linux, but
I need to distinguish between 'Red Hat 9'
and other Linux variants.

The Unix install instructions mention..
Red Hat 9:
SCREENSAVER_BIN=/usr/X11R6/bin
SCREENSAVER_CONF=/usr/share/control-center/screensavers
Other platforms:
SCREENSAVER_BIN=(search for an xscreensaver, like apollonian)
SCREENSAVER_CONF=(search for a config file, like apollonian.xml)

While it does not explicitly state that other
Linux's are different, it implies it might be
the case.
 
P

Paul Lutus

Andrew Thompson wrote:

/ ...
As I understand, Red Hat, SuSe and Debian
are all implementations of Linux, but
I need to distinguish between 'Red Hat 9'
and other Linux variants.

So ask the user "What Linux version of what distribution are you running?"
You are certainly not going to get this from Java's set of properties.

And ... why not tell us why you think this matters to your application.
 
A

Andrew Thompson

Andrew Thompson wrote:

/ ... ....
... why not tell us why you think this matters to your application.

I am working on a basic 'minimum requirements'
applet/application* for Saverbeans Screensavers**.

* <http://www.physci.org/test/ss/saverchecker.html>
** <https://screensavers.dev.java.net/>

I would prefer to use JWS for the installation, but
AFAIU (have been able to determine) JWS is not
capable of delivering the saver .jar and .exe/.so
to the correct directory (let alone 'edit the
xscreensaver file' as required for Unix***
install), so I am writing an installer.

The first step of which is to figure if the
system is Win/Linux, and if Linux, the location
(& ultimately, availability) of 'lesstif' and the
..xscreensaver file itself. The locations vary
according to the Unix flavor.

*** See the Unix readme linked from the 1st URL
for further details on the Unix install.

(Note, I moved this cause it made more sense to my reply)
So ask the user "What Linux version of what distribution are you running?"
You are certainly not going to get this from Java's set of properties.

Normally I would, but the idea is that this
installer/checker is intended to save the end
user as many questions as possible.

Ultimately, I will probably have to resort to
searching the filesystem for both the .xscreensaver
file and 'lesstif' (which provides /usr/X11R6/lib/libXm.so)
but I am hoping to come up with a basic check
in an applet that does not require the user to
accept a 'security certificate'.

BTW - I have a page at my site where you can
see demos of some of the savers already made.
(I made two of the those listed)
<http://www.physci.org/test/ss/>
 
M

Matt Parker

Andrew said:
I am working on an installer for Java based
'SaverBeans' ScreenSavers.

The windows set-up is pretty straightforward,
but the versions for Unix flavors (Java Desktop,
Solaris, Red Hat and 'Other Unix' - no Mac,
sorry) are more complicated in that the target
directories are different between them.

In order to help me sort them, I was wonderring
if some of our Unix enabled posters could report
what their systems are reporting for..
<http://www.physci.org/pc/property.jsp?prop=os.name+os.version>

I'm running vanilla Mandrake 10:-

os.name = Linux
os.version = 2.6.3-7mdk

The 'mdk' on the version string will tell you that I'm running Mandrake.
However, there is no way to tell which version of Mandrake I'm using since
I could have upgraded the kernel myself on an older version.

Matt
 
D

Dave Monroe

Andrew Thompson said:
I am working on an installer for Java based
'SaverBeans' ScreenSavers.

The windows set-up is pretty straightforward,
but the versions for Unix flavors (Java Desktop,
Solaris, Red Hat and 'Other Unix' - no Mac,
sorry) are more complicated in that the target
directories are different between them.

In order to help me sort them, I was wonderring
if some of our Unix enabled posters could report
what their systems are reporting for..
<http://www.physci.org/pc/property.jsp?prop=os.name+os.version>

You could try 'uname -a' at the command line.

I'm not sure differentiating between Linux flavors is all that important.
 
A

Andrew Thompson

On 6 Sep 2004 06:28:30 -0700, Dave Monroe wrote:

(Detecting Unix variants)
...
You could try 'uname -a' at the command line.

Thanks for that idea Dave. I might have
to resort to something like that in the end.

...but for the moment I am trying to do as much
as I can in an unsigned applet. I think my last
reply to Paul fills in some of the details I
neglectfully forgot to mention in my first post.
I'm not sure differentiating between Linux flavors is all that important.

Unfortunately, for this very system specific
use (the screensavers) it is. The Windows
install is pretty straightforward, but the
instructions for installing them in the
supported Unix variants are more complicated,
and use different target directories for the
..jar and .so. :-(

[ I am beginning to think it is both easiest
and safest not to worry about which Unix a
box claims to be, but instead to go hunting
for the appropriate files that are associated
with 'lesstif' and xscreensaver. ]
 
P

Paul Lutus

Andrew said:
On 6 Sep 2004 06:28:30 -0700, Dave Monroe wrote:

(Detecting Unix variants)
..

Thanks for that idea Dave. I might have
to resort to something like that in the end.

..but for the moment I am trying to do as much
as I can in an unsigned applet.

What? You expect to be able to detect the client's system identifications,
beyond what is in System.getProperties(), in an unsigned applet? Surely you
know this is quite impossible.
 
A

Andrew Thompson

What? You expect to be able to detect the client's system identifications,
beyond what is in System.getProperties(), in an unsigned applet? ..

...did you miss 'but for the moment'?

Or to put that another way. No.
 
P

Paul Lutus

Andrew said:
..did you miss 'but for the moment'?

My point is that an unsigned applet cannot do this, regardless of the
conditions: moment, week, whatever.
 
M

Mike Schilling

[ I am beginning to think it is both easiest
and safest not to worry about which Unix a
box claims to be, but instead to go hunting
for the appropriate files that are associated
with 'lesstif' and xscreensaver. ]

Since what you're interested in might well vary by OS version as well as
type, I agree.
 
A

Andrew Thompson

Andrew Thompson said:
[ I am beginning to think it is both easiest
and safest not to worry about which Unix a
box claims to be, but instead to go hunting
for the appropriate files that are associated
with 'lesstif' and xscreensaver. ]

Since what you're interested in might well vary by OS version as well as
type, I agree.

Yes, it's looking that way. Still, I wanted
to check before I abandoned the concept of
using the defined properties.

Thanks for the input Mike.

( ..that 'speech impediment' of the other day
seems to have cleared up, as well. ;-)
 
N

Nigel Wade

I am working on an installer for Java based
'SaverBeans' ScreenSavers.

The windows set-up is pretty straightforward,
but the versions for Unix flavors (Java Desktop,
Solaris, Red Hat and 'Other Unix' - no Mac,
sorry) are more complicated in that the target
directories are different between them.

In order to help me sort them, I was wonderring
if some of our Unix enabled posters could report
what their systems are reporting for..
<http://www.physci.org/pc/property.jsp?prop=os.name+os.version>

The applet outputs to the console:
null 0
null 0

However, if you want to know the values of os.name and os.version then:

os.name = Irix
os.version = 6.5
 
A

Andrew Thompson

The applet outputs to the console:
null 0
null 0

Damnit! Why does it keep doing that?
I'll have to dive back into the code and
check what wierd-ass thing I did to cause
it..
However, if you want to know the values of os.name and os.version then:

os.name = Irix
os.version = 6.5

Thanks Nigel. There is an Unix(?) flavor
of which I'd never heard! Does this machine
have any form of screensaver available?
(I almost picture it as something running on
a mainframe where the SysOp's do not stoop
to such trivial matters as screen savers..)
 
N

Nigel Wade

Damnit! Why does it keep doing that?
I'll have to dive back into the code and
check what wierd-ass thing I did to cause
it..


Thanks Nigel. There is an Unix(?) flavor
of which I'd never heard! Does this machine
have any form of screensaver available?
(I almost picture it as something running on
a mainframe where the SysOp's do not stoop
to such trivial matters as screen savers..)

IRIX runs on sgi hardware. It covers desktops, graphics workstations
on upwards to 1024+ CPU mainframes. It's quite scalable.

Yes, they can have screensavers and they are X/Motif based. I've never had
much time for screensavers myself (preferring not to waste power and CPU
cycles drawing pretty pictures) so I've no idea how you might install
alternatives. Our O2s (desktops) run a clustered batch system when not
being used interactively, so a CPU intensive screensaver would impact
throughput. Screensavers on the main Origin server (users login via remote
X session) are a no-no - much of the system throughput could be taken up
by a small number of users logged in but not doing any work.
 
A

Andrew Thompson

On Tue, 07 Sep 2004 13:52:50 +0100, Nigel Wade wrote:

(a few of my frivolous things)
..I've never had
much time for screensavers myself (preferring not to waste power and CPU
cycles drawing pretty pictures)

You can do ..other things with computers? ;-)

( Thanks for the detailed report. )
 
L

Liz

Dave Monroe said:
Andrew Thompson <[email protected]> wrote in message

You could try 'uname -a' at the command line.

I'm not sure differentiating between Linux flavors is all that important.

Funny, your little applet says I have "Windows XP"
but "uname" says I have "Windows_NT"
and I have an environment variable "OS=Windows_NT"
in reality I have Windows XP Professional
 
L

Liz

Andrew Thompson said:
Damnit! Why does it keep doing that?
I'll have to dive back into the code and
check what wierd-ass thing I did to cause
it..

Well the 'extreme' boys would tell you that
you would have known right away from one or
more of your 1,000 unit tests.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top