LinuxQuestions.org
Visit Jeremy's Blog.
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 06-24-2005, 03:34 AM   #1
jacktheripperis
LQ Newbie
 
Registered: Jul 2004
Location: italy
Distribution: SUSE10
Posts: 13

Rep: Reputation: 0
a newbie trying to go further (VMWARE_GSX & KERNEL)


I present you the problem i'd like to resolve:

I've got Suse9.2 but unfortunately I need to work on Windows every now and then. So I use the Vmware GSX server for this (and for testing net stuff & all).
Upon installing VmwareGSX I realised that it cannot run with the kernel(2.6.8-24-default) that comes with this distribution of SuSe, so i configured and compiled the kernel(2.6.4-52-default) on which it runs perfecly. Now, i've got GRUB with wich I can boot with one or the other. And 'till here all is OK.
What happens? GSX, unlike the Vmware Workstation, is a system service that loads at boot time. If I boot with the original kernel (2.6.8-24-default) it does not start up - which is OK - but on the next reboot with the 'older' kernel (2.6.4-52-default) with witch it should work it asks me to reconfigure vmware running the vmware-config.pl & I want to avoid this. I want to make sure that my GSXserver starts up ONLY with the working kernel and with nothing else.

Lots of words for a simple question: How do I restrict the startup of a system service (in my case it should be /etc/rc.d/vmware) depending on the kernel i am using? what file/variable tells me the version of my running kernel?

Thanks in advance,
Adam

Last edited by jacktheripperis; 06-24-2005 at 06:47 AM.
 
Old 06-24-2005, 03:59 AM   #2
zackarya
Member
 
Registered: Jul 2003
Distribution: OpenSuse 10, Debian
Posts: 152

Rep: Reputation: 30
I can help on the last question. To find out the current kernel version you can use

uname -r

uname has a few different options on what it can display to you. Not sure about the
vmware thing though as I don't use it.

Hope that helps.

Zack
 
Old 06-24-2005, 04:51 AM   #3
jacktheripperis
LQ Newbie
 
Registered: Jul 2004
Location: italy
Distribution: SUSE10
Posts: 13

Original Poster
Rep: Reputation: 0
uname -r

Thanks, this is the first bit i was missing. With my ok kernel
Code:
uname -r
gives me: 2.6.4-52-default
This is exactly what i need.

So now i shoud construct a condition something like

If uname -r == "2.6.4-52-default" Then
...start up the service...
EndIf


As you can tell I don't know very well bash scripting... do you know the exact syntax to make this condition???


LINUX RULES!
adam

Last edited by jacktheripperis; 06-24-2005 at 04:52 AM.
 
Old 06-24-2005, 06:21 AM   #4
jacktheripperis
LQ Newbie
 
Registered: Jul 2004
Location: italy
Distribution: SUSE10
Posts: 13

Original Poster
Rep: Reputation: 0
I've got it!

I resolved it and i post it for anyone who might have a similar problem to resolve.

Code:
#!/bin/sh
myKernelVersion=`uname -r`
if [ $myKernelVersion = "2.6.4-52-default" ]; then
	echo OK - starting sevice...
	#start vmware script
fi
exit 0
I also found where to insert this piece of code in order to make it work. The vmware GSX server has a script file in /etc/init.d/ called vmware. You can use this script to start/stop/restart the vmware service by issuing the commands:
Code:
/etc/init.d/vmware start
/etc/init.d/vmware stop
/etc/init.d/vmware restart
It is here (in my case @ line #813) that I inserted my code in order to start up the service only with the working kernel...here it goes:
Code:
# See how we were called.
case "$1" in
  start)
	#checking KERNEL VERSION -> ALLOW STARTUP ONLY FOR: "2.6.4-52-default"
	myKernelVersion=`uname -r`
	if [ $myKernelVersion != "2.6.4-52-default" ]; then
	    echo JACK PROHIBITED TO RUN VMWARE SERVICE ON KERNEL: $myKernelVersion
	    exit 1
	else
	    echo STARTING TO RUN VMWARE SERVICE ON KERNEL: $myKernelVersion
	fi	
	#checking finished - the rest remains untouched
I don't know if this is the best way of doing it but I tested this and for me it works fine!
ciao a tutti!


Last edited by jacktheripperis; 06-24-2005 at 07:20 AM.
 
  


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
security newbie, but not Linux newbie. advice on secure delete tools mattie_linux Linux - Security 19 08-15-2005 02:50 AM
Linux semi-newbie and Wine vary newbie geovolt_os1 Linux - Software 4 04-19-2005 12:03 PM
newbie;I am a linux newbie who has installed slackware and have run into a few proble MollyJolly Slackware - Installation 6 06-01-2004 12:21 PM
How To Update To Slackware-Current For a Newbie, By a Newbie :) windsok Slackware 1 09-18-2003 09:53 PM
ipchains newbie. Kernel newbie skeletal29 Linux - Security 3 06-02-2002 04:30 AM


All times are GMT -5. The time now is 06:33 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