Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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)
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.
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!
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!
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!
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.
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.
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.
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
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.
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!
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.