LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2009, 07:59 PM   #16
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50

Is it Red Hat, Debian, Suse, Ubuntu,

uname -a
 
Old 10-19-2009, 08:39 PM   #17
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pljvaldez View Post
That's not the distro. That's the linux kernel version. The distro will be something like Red Hat Enterprise Linux, or Ubuntu, or Debian, or Slackware, etc.

As someone else mentioned, try poking around for an /etc/*Release* file or something of the like that might tell us which distro and what vintage. Or uname -a output might give us some clues.
OK, this is weird. I "cat release" and got TOAK. Is TOAK another version of Linux? I've never heard of TOAK before. This machine is not within my reach so I only SSH to it.

I did uname -a and got Linux "the server name" 2.6.27.7 #1 SMP Thu Feb 19 12:04:52 GMT 2009 i686 GNU/Linux

Last edited by v890115; 10-19-2009 at 08:42 PM.
 
Old 10-19-2009, 09:45 PM   #18
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Try 'yum' and 'apt-get', that can narrow it down a bit.
To be honest, it really sounds like someone has either been playing around or done some really strange stuff. How did you end up with this; was someone fired?

Try reading (more) the /var/log/dmesg or /var/log/boot files; or anything like that. Usually get some info there.

Last edited by chrism01; 10-19-2009 at 09:46 PM.
 
Old 10-19-2009, 10:02 PM   #19
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
Try 'yum' and 'apt-get', that can narrow it down a bit.
To be honest, it really sounds like someone has either been playing around or done some really strange stuff. How did you end up with this; was someone fired?

Try reading (more) the /var/log/dmesg or /var/log/boot files; or anything like that. Usually get some info there.
I will give that a shot and see if I can narrow it down a bit.

LOL - the last time I worked on Sun Solaris and Linux was back in 2006. The reason why it got tossed onto my lap is because I'm the only person that know a little Linux/ UNIX. And yes, someone did work on this machine and have been playing with it on a daily basis from day 1. This person did not get fired but never worked with Linux or Unix before. The project was put onto his plate because he's been with the company longer than I am and is trusted to get it done. But today I after digging through the entire server nothing made sense to me. In fact, all that I saw today made me look like a true rookie. The structures, the configurations, the setup, etc were far different from what I am used to see in the past. I was tasked to do a minor work on it and ended up redoing and fixing half of the work done on it.
 
Old 10-20-2009, 11:55 AM   #20
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Is there a package management tool? If so, maybe you can dig through the repository list and find out what they are pointed at. For example, Debian based distros keep a list of repositories in /etc/apt/sources.list. Not sure where other distros keep their repo list.
 
Old 10-20-2009, 12:05 PM   #21
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Might help ...
Code:
function get_distro_name {
    if [[ -r '/etc/lsb-release' ]]; then
        . /etc/lsb-release
        [[ "$DISTRIB_ID" ]] && n="$DISTRIB_ID"
    elif [[ -r '/etc/release' ]]; then
        n=`head -1 /etc/release | sed 's/ *\([[^0-9]]*\) [0-9].*/\1/'`
    elif [[ -r '/etc/arch-release' ]]; then
        n="Arch Linux"
    elif [[ -r '/etc/debian_version' ]]; then
        n='Debian'
    elif [[ -r '/etc/gentoo-release' ]]; then
        n='Gentoo'
    elif [[ -r '/etc/knoppix-version' ]]; then
        n='Knoppix'
    elif [[ -r '/etc/mandrake-release' ]]; then
        n='Mandrake'
    elif [[ -r '/etc/pardus-release' ]]; then
        n='Pardus'
    elif [[ -r '/etc/puppyversion' ]]; then
        n='Puppy Linux'
    elif [[ -r '/etc/redhat-release' ]]; then
        n='Red Hat'
    elif [[ -r '/etc/sabayon-release' ]]; then
        n='Sabayon'
    elif [[ -r '/etc/slackware-version' ]]; then
        n='Slackware'
    elif [[ -r '/etc/SuSE-release' ]]; then
        n='SuSE'
    elif [[ -r '/etc/xandros-desktop-version' ]]; then
        n='Xandros'
    elif [[ -r '/etc/zenwalk-version' ]]; then
        n="Zenwalk"
    fi
    [[ "${n:-}" = '' ]] &&  \echo "ERROR: Could not determine the distro name" >&2 && \exit 1
} # get_distro_name
EDITs:
26oct9 added Sabayon

Last edited by catkin; 10-26-2009 at 04:21 AM.
 
1 members found this post helpful.
Old 10-21-2009, 01:20 AM   #22
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
@v890115: Try catkin's code above.
If this is a relatively new box and not running prod code yet, might well be quicker & more secure & reliable to re-install.
Not saying you should, just pointing out that if he's been playing for a while, the odds of getting back to a clean/sane state by tweaking/fixing are pretty long against.
 
Old 10-14-2010, 07:36 AM   #23
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
catkin,

Nice listing, would the code be simpler if the elif's were turned into a case statement?
 
Old 10-14-2010, 07:50 AM   #24
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by archtoad6 View Post
catkin,

Nice listing, would the code be simpler if the elif's were turned into a case statement?
It would but I don't know how to do a case statement that tests for existence and readability of a series of files-by-pathname.
 
Old 10-14-2010, 08:44 AM   #25
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
idea for a function to identify which Linux release/version

A case/esac set would be nice but I too don't quite see how to implement that. But, in the interest of having more than one way to do something, here's another take on it:

First, you have this array of possible filenames (you could just as well put this right inside the function..):
Code:
distros=(slackware-version redhat-release zenwalk-version)
Next, a function to check which one is the right one:
Code:
check () {
    unset n
    for each in $*; do
        [ "$n" ] && break || [ -r /etc/$each ] && n=$(awk '{print $1}' /etc/$each)
    done
echo $n
}
So, to use:
Code:
root@reactor: dis=$(check ${distros[*]})
root@reactor: echo $dis
Slackware
root@reactor:

# Or just:

root@reactor: check ${distros[*]}
Slackware
So, just a different version of the same thing. A file containing all known release/version filenames would be an advantage with this; either way, we need to either perpetually add filenames to the array here, or always grab the newest version of this magical list of filenames and feed that into the function..

I also noticed (on my system anyhow) that there is only one file in all of /etc whose filename is "*version" or "*release" so you might be able to use that to your advantage if you're still stuck:
Code:
ls -l /etc | grep 'version\|release'

lrwxrwxrwx  1 root root        22 Jul 15  2009 slackware-release -> /etc/slackware-version
-rw-r--r--  1 root root        17 May 16 14:45 slackware-version
root@reactor:
Anyhow, ongoing good luck here!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't add local system user - useradd keeps saying user already exists ADeluiz Linux - Security 5 07-26-2013 04:17 PM
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 02:14 PM
samba - add user script - User account does not exist itzamecwp Linux - Server 2 01-18-2007 11:52 PM
How to automatically add smb user when unix user added Winanjaya Linux - Newbie 3 01-07-2007 12:17 PM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 10:59 AM


All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration