LinuxQuestions.org
Help answer threads with 0 replies.
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 05-19-2007, 04:22 PM   #1
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Rep: Reputation: 0
did something stupid


Hello everyone, I am a total newbie in linux.
At home Ive setup Asterisk PBX and LAMP box and Iam so happy with it!
But one boring evening Ive played with commands, just to learn things (you know how it goes).
And After: extract from my bash history file

chown /* root
chown root /* this one appeared to be the "killer" (from discussion below)
find / -path './etc/asterisk/' -prune -o -print
find / -path './etc/asterisk/' -prune -o -print | xargs chown root
find /etc -path './etc/asterisk/' -prune -o -print | xargs chown root
cd etc
find . -path './etc/asterisk/' -prune -o -print | xargs chown root
ls
find . -path './etc/asterisk/' | xargs chown root
find . -path './etc/asterisk/' | xargs chown root *
cd asterisk/
find . | xargs chown asterisk *

and also executed that small script pid2port.

The Following problems start to occur:
1. fstab doesnt mount my samba shares (it does but when cd to them, it just hangs.)
2. Asterisk doesn't start.
3. MySQL doesn't start (says, can't connect to local host and can't find the socket?)
(other services like apache, atftpd, sshd are working)

I also executed this commands, but I don't think they have done anything harmful.

watch -n 0.1 ls
watch -n 0.1 uptime
watch -n 0.1 ps
screen
cfdisk
kernelversion
fsck
eject
eject -d
showkey
showmount
setleds
setleds -F


Any help would be much appreciated!

Quote:
ok it works now: (all processes that couldn't start, simply were unable to write it's logs)
changing var/log/asterisk/* to owner asterisk (Find out after running asterisk -vv, it sad can't write to it's log files.)
changing var/log/mysql/* to owner mysql (Find out after looking at sys messages, where mysql complained about writing to it's logs)

Last edited by norim666; 05-19-2007 at 06:02 PM.
 
Old 05-19-2007, 04:36 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
I am going to take one guess as to what might be the problem:
My guess is, the very first command you posted from your bash history, looks like it would chown everything on the entire machine, to root.
If so, then how to repair this is beyond me.. I am curious to see what gets suggested, and/or if I'm mistaken.
 
Old 05-19-2007, 04:39 PM   #3
vtel57
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Slackware64 - 14.2 w/ Xfce
Posts: 1,631

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
That's what it looked like to me, too. If that's the case, he/she can try to chown the /home directory back to the proper user ownership.

Heh! I think I did something like this one day back when, before I understood the devastating power of ROOT! It was UGLY!

Remember... ROOT --> The power to destroy over and over and over again.
 
Old 05-19-2007, 04:43 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
My guess is that you have set ownership in such a way that Asterisk cannot start. Check ownership of /etc/asterisk, /var and /tmp (ll is enough).
 
Old 05-19-2007, 04:43 PM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
LOL vtel57, we must stop running into each other like this .

On topic: if this IS the situation vtel57, what about all the other stuff, daemons, shares, devices, I think there are all sorts of things around that are owned by lots of things besides root. *IF* the entire machine got chowned to root, it seems it would be quite a chore trying to figure out what all has to be changed back.. Yikes!
 
Old 05-19-2007, 04:48 PM   #6
vtel57
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Slackware64 - 14.2 w/ Xfce
Posts: 1,631

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Quote:
Originally Posted by GrapefruiTgirl
LOL vtel57, we must stop running into each other like this .
Heh! Really!

Quote:
On topic: if this IS the situation vtel57, what about all the other stuff, daemons, shares, devices, I think there are all sorts of things around that are owned by lots of things besides root. *IF* the entire machine got chowned to root, it seems it would be quite a chore trying to figure out what all has to be changed back.. Yikes!
Root owns 99.9% of everything on the system except items in /home/<user> and /tmp, I think. I dunno for sure, though. This could be the time for one of my favorite computer tools... the BFH!

BFH = BIG Format Hammer
 
Old 05-19-2007, 04:50 PM   #7
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
/* belongs to root anyway

Quote:
Originally Posted by GrapefruiTgirl
I am going to take one guess as to what might be the problem:
My guess is, the very first command you posted from your bash history, looks like it would chown everything on the entire machine, to root.
If so, then how to repair this is beyond me.. I am curious to see what gets suggested, and/or if I'm mistaken.
Thanks for such a fast reply.
I was thinking, isn't the /* belongs to root anyway, plus chown root /* would only change user for the all directories in the / and not any deeper. (correct me if I am wrong).
Thanks!
 
Old 05-19-2007, 04:59 PM   #8
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Well according to the manual page for chown, the default action is to NOT treat / as a special thing. In other words, if I am interpreting this correctly, it will do a recursive chown on /*

IF you were root when you did this (or doing anything involving a * ) you are definitely playing with fire
I would await further confirmation from others more experienced too, as to whether this did actually run recursively.
 
Old 05-19-2007, 05:09 PM   #9
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mara
My guess is that you have set ownership in such a way that Asterisk cannot start. Check ownership of /etc/asterisk, /var and /tmp (ll is enough).
Thanks for sujestion!
I've checked, and here is what I get
I think you are right the var folder needs to be all rechowned. (because in MySQL sturtup log, it says cant write to var/...mysql.log )
etc/asterisk is asterisk owned.

Last edited by norim666; 05-19-2007 at 05:11 PM.
 
Old 05-19-2007, 05:13 PM   #10
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl
Well according to the manual page for chown, the default action is to NOT treat / as a special thing. In other words, if I am interpreting this correctly, it will do a recursive chown on /*

IF you were root when you did this (or doing anything involving a * ) you are definitely playing with fire
I would await further confirmation from others more experienced too, as to whether this did actually run recursively.
Ahh well, sh*t happens at least I would know!
 
Old 05-19-2007, 05:17 PM   #11
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
I'll mess around with /var folder as it seems to be the most unique to every process and I will let you know!!!
At least I know that its a chown that did this
 
Old 05-19-2007, 05:23 PM   #12
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Please do let us know how it goes and kudos to you for your optimism! We all make mistakes while learning Linux, some of them dreadful but learning from them is so important and at the end of the day, no harm is done; just some extra work made but no-one gets hurt.
 
Old 05-19-2007, 05:27 PM   #13
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl
Please do let us know how it goes and kudos to you for your optimism! We all make mistakes while learning Linux, some of them dreadful but learning from them is so important and at the end of the day, no harm is done; just some extra work made but no-one gets hurt.
kudos to you and everyone too! didn't expect to get help so fast!
 
Old 05-19-2007, 05:28 PM   #14
vtel57
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Slackware64 - 14.2 w/ Xfce
Posts: 1,631

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Quote:
...but no-one gets hurt.
Well, maybe a few ill-treated electrons.
 
Old 05-19-2007, 05:54 PM   #15
norim666
LQ Newbie
 
Registered: May 2007
Posts: 10

Original Poster
Rep: Reputation: 0
ok it works now: (all processes that couldn't start, simply were unable to write it's logs)
changing var/log/asterisk/* to owner asterisk (Find out after running asterisk -vv, it sad can't write to it's log files.)
changing var/log/mysql/* to owner mysql (Find out after looking at sys messages, where mysql complained about writing to it's logs)

Thank you everyone, the problem is SOLVED!

Last edited by norim666; 05-19-2007 at 06:04 PM.
 
  


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
Stupid, stupid spoofing teejaytimms Linux - Server 6 10-30-2006 10:25 AM
Stupid, stupid question; I lost Klaptop. :( Surfrider Slackware 2 08-31-2005 09:12 PM
Stupid Dumb Stupid Question... drigz Linux - Software 3 09-23-2004 03:09 PM
stupid stupid newb ? what to use instead of xconfigurator h00ligan Fedora 3 01-25-2004 09:51 PM
Am I stupid or what?!? Som3on3 Linux - Software 1 11-02-2001 01:07 PM

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

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