LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 04-28-2011, 01:39 AM   #1
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
Suddenly it wont work anymore...


Hi all

Yesterday i made a script with funtions, everything worked until 15 minutes ago, and i can't figure out what did go wrong.
I think it has to do something with the 3 first rules of code... but for my opinion that should be fine (i used '777' just to be sure)
Code:
test_mount() {
	$touch /current_mount
	$chmod 777 /current_mount
	$mount | $grep -v none > /current_mount

	VAR=`$diff -s /default_mount /current_mount`
	echo $VAR var

	if  [ "$VAR" = "Files /default_mount and /current_mount are identical" ]; then
		# OK
        value6=0
	else
		# CRITICAL
        value6=2
	fi
	
	$rm -f /current_mount
}
so if i run it, i get the critical message... but i shouldn't !!
why do i use all those variables? because they are defined at the beginning of the script, so i have only one place to change them if needed.
i think the rest is clear? probably there is a better way to check mounts, but this is just a quick solution (which isn't working anymore xD )
so if anyone has a suggestion or something else, i'll be happy to hear it from you

Kind regards

Last edited by brownie_cookie; 04-28-2011 at 01:40 AM.
 
Old 04-28-2011, 01:57 AM   #2
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
appearently he doesn't make the file...
he has to do that on a remote server

this is the pre-defined touch command
Code:
touch="/bin/touch"
monitor server:
Code:
# which touch
/bin/touch
remote server:
Code:
# which touch
/bin/touch
so that's not the problem...
i just don't understand why he doesn't make that file

can someone help me pls?!


Kind regards
 
Old 04-28-2011, 02:02 AM   #3
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
okay guys, update...

he WON'T make a file in the root (/) but he will make it in (let's say) /tmp ...
so in other words

/current_mount -> NO
/tmp/current_mount -> YES

then i thought let's do a
Code:
chmod 777 /
but still it's a no-go...

can someone PLS explain why?
 
Old 04-28-2011, 02:49 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You are polluting the root (/) directory with files. Also / is only writable by root, so you can't write files there as a normal user.

You could extract the mount points from /etc/fstab. The currently mounted directories are also available from /etc/mtab and /proc/mounts/.
 
Old 04-28-2011, 02:55 AM   #5
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
Quote:
Originally Posted by jschiwal View Post
You are polluting the root (/) directory with files. Also / is only writable by root, so you can't write files there as a normal user.

You could extract the mount points from /etc/fstab. The currently mounted directories are also available from /etc/mtab and /proc/mounts/.
it is a testing server, so it doesn't matter...
it's just the shortest way, anyways...

I'm executing everything as root, so...

but i'll see what /etc/fstab, /etc/mtab and /proc/mounts give me
-> which file do you prefer, i mean which is the most accurate?

Last edited by brownie_cookie; 04-28-2011 at 02:58 AM.
 
  


Reply



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
wifi suddenly stopped working....cant find any networks anymore... psyadj Linux - Laptop and Netbook 4 06-01-2009 12:31 PM
codecs suddenly don't work anymore theonebeyond Linux - Software 14 07-30-2005 05:43 PM
External serial modem suddenly not connecting anymore kaens Linux - Hardware 2 07-26-2005 11:07 PM
usb wont work anymore slackinblack Linux - Hardware 2 06-02-2005 09:38 PM
KDE suddenly won't run as user anymore simon.bach Slackware 2 02-29-2004 10:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 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
Open Source Consulting | Domain Registration