Slackware This Forum is for the discussion of Slackware Linux.
|
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
01-03-2009, 10:38 AM
|
#1
|
|
Member
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 281
Rep:
|
Shot myself in the foot
OK, I made a mistake that is killing me. Long story, but I reset the permissions on /var/run to to be owned by root, group users with group having read/write as well. I then copied that down to the subfolders and stuff stopped working (most notably apache couldn't access mysql through the socket in /var/run/mysql).
Is there anyway to recover these permissions. Or in knowing how they should be set?
(FWIW, I have backups but not of the entire /var tree)
(FWIW2 - this is my home system and of not huge importance)
Thanks
|
|
|
|
01-03-2009, 10:47 AM
|
#2
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
/var/run
drwxr-xr-x 35 0 0 4096 2009-01-03 16:49 run
The sub directorys have
drwxr-xr-x 2 0 0 4096 2008-07-29 16:33 sshd
|
|
|
|
01-03-2009, 10:48 AM
|
#3
|
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 4,677
Rep: 
|
You may get help from the script Alan Hicks posted on a.o.l.s. some years ago. The script uses Slackware's "slackware/MANIFEST.bz2" file to generate a load of commands that reset the permissions back to the original state of every file/directory installed by Slackware.
You can capture these commandlines (they are written to the standard output of the script) and remove everything you don't need (only the commands that change permissions and owndership below /var are relevant to you).
You can find the posting of that script here: http://groups.google.nl/group/alt.os...1872abfdf2c110
Eric
|
|
|
|
01-03-2009, 10:53 AM
|
#4
|
|
Senior Member
Registered: May 2008
Posts: 2,841
|
These are mine if they help
directories:
Code:
root@jupiter:~# find /var/run -type d -exec ls -ld {} \;
drwxr-xr-x 14 root root 4096 2009-01-03 13:27 /var/run
drwxr-xr-x 3 root lp 48 2008-12-05 13:52 /var/run/cups
dr-x--x--x 2 lp sys 1 2008-12-05 13:52 /var/run/cups/certs
drwxr-xr-x 2 root root 16 2009-01-03 13:27 /var/run/dbus
drwxr-xr-x 4 haldaemon haldaemon 16 2008-12-08 01:14 /var/run/hald
drwxr-xr-x 2 root root 1 2008-12-08 01:14 /var/run/hald/hald-local
drwxr-xr-x 2 root root 1 2008-12-08 01:14 /var/run/hald/hald-runner
drwxr-xr-x 2 root root 1 2008-10-22 23:55 /var/run/httpd
drwxr-xr-x 2 root root 1 2008-02-27 03:40 /var/run/iptraf
drwxr-xr-x 2 mpdserv mpdserv 8 2009-01-03 13:27 /var/run/mpd
drwxr-xr-x 2 mysql mysql 1 2008-10-05 06:29 /var/run/mysql
drwxr-xr-x 2 root root 1 2008-09-17 07:35 /var/run/named
drwxr-xr-x 2 root root 1 2008-11-21 07:09 /var/run/nscd
drwxr-xr-x 2 root root 1 2008-11-14 23:45 /var/run/proftpd
drwxr-xr-x 2 root root 1 2006-09-12 08:33 /var/run/stunnel
drwx------ 2 root root 1 2008-12-12 16:04 /var/run/sudo
files:
Code:
root@jupiter:~# find /var/run -type f -exec ls -ld {} \;
-rw-r--r-- 1 root root 5 2009-01-03 13:27 /var/run/acpid.pid
-rw-r--r-- 1 root root 5 2009-01-03 13:27 /var/run/atd.pid
-rw-r--r-- 1 root root 5 2009-01-03 13:27 /var/run/dbus/dbus.pid
-rw-r--r-- 1 root root 5 2009-01-03 13:27 /var/run/gpm.pid
-rw-r--r-- 1 root root 5 2009-01-03 13:27 /var/run/klogd.pid
-rw-r--r-- 1 mpdserv mpdserv 5 2009-01-03 13:27 /var/run/mpd/mpd.pid
-rw-r--r-- 1 root root 4 2009-01-03 13:27 /var/run/ntpd.pid
-rw-r--r-- 1 root root 5 2009-01-03 13:27 /var/run/syslogd.pid
-rw-rw-r-- 1 root utmp 4608 2009-01-03 13:33 /var/run/utmp
|
|
|
|
01-03-2009, 11:20 AM
|
#5
|
|
Senior Member
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,357
Rep: 
|
Quote:
Originally Posted by gmartin
(most notably apache couldn't access mysql through the socket in /var/run/mysql).
|
/var/run/mysql should be owned by mysql:mysql. Apache doesn't access this directly, but communicates with the mysqld (daemon) process which does.
Brian
|
|
|
|
01-03-2009, 12:06 PM
|
#6
|
|
Member
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 281
Original Poster
Rep:
|
Eric, I'm trying a hybrid approach. I'm reviewing the contents of MANIFEST And setting the perms by hand. I can always go back and cleanup MANIFEST and run the script. Thanks
Brian, when I set /var/run/mysql to mysql:mysql I get this error from a web app
Code:
Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (13)
Granting apache access to the directory resolves the problem. Any ideas?
|
|
|
|
01-03-2009, 12:25 PM
|
#7
|
|
Senior Member
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,357
Rep: 
|
what does "ls -l /var/run/mysql" show?
Brian
|
|
|
|
01-03-2009, 02:23 PM
|
#8
|
|
Member
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 281
Original Poster
Rep:
|
Quote:
Originally Posted by BCarey
what does "ls -l /var/run/mysql" show?
Brian
|
Code:
root@USlack2:/etc/cron.weekly# ls -l /var/run/mysql
total 4
-rw-rw-r-- 1 mysql mysql 5 2009-01-01 01:24 mysql.pid
srwxrwxr-x 1 mysql mysql 0 2009-01-01 01:24 mysql.sock=
If I add the apache user to the mysql group, everything works.
Note: this is a php app if it matters.
|
|
|
|
01-03-2009, 02:53 PM
|
#9
|
|
Senior Member
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,357
Rep: 
|
Is that = sign at the end of mysql.sock a typo?
"chmod o+w /var/run/mysql.sock" should take care of it.
Brian
|
|
|
|
01-03-2009, 03:12 PM
|
#10
|
|
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,544
Rep: 
|
Following GazL's lead, here are mine (Slackware 12.1, basic install):
Code:
root@FamilyRoom:/# find /var/run -type d -exec ls -ld {} \;
drwxr-xr-x 13 root root 1024 2009-01-01 09:02 /var/run
drwxr-xr-x 2 mysql mysql 1024 2008-04-28 15:54 /var/run/mysql
drwxr-xr-x 3 root lp 1024 2009-01-01 09:02 /var/run/cups
dr-x--x--x 2 lp sys 1024 2009-01-01 09:02 /var/run/cups/certs
drwxr-xr-x 2 root root 1024 2006-09-12 01:33 /var/run/stunnel
drwxr-xr-x 2 root root 1024 2008-04-19 23:41 /var/run/nscd
drwxr-xr-x 2 root root 1024 2009-01-01 09:02 /var/run/httpd
drwx------ 2 root root 1024 2008-10-02 15:48 /var/run/sudo
drwxr-xr-x 2 root root 1024 2008-02-26 20:40 /var/run/iptraf
drwxr-xr-x 2 root root 1024 2007-12-10 12:04 /var/run/proftpd
drwxr-xr-x 2 root root 1024 2009-01-01 09:02 /var/run/dbus
drwxr-xr-x 4 haldaemon haldaemon 1024 2008-04-01 16:06 /var/run/hald
drwxr-xr-x 2 root root 1024 2008-04-01 16:06 /var/run/hald/hald-runner
drwxr-xr-x 2 root root 1024 2008-04-01 16:06 /var/run/hald/hald-local
drwxr-xr-x 2 root root 1024 2008-04-13 16:07 /var/run/named
root@FamilyRoom:/# find /var/run -type f -exec ls -ld {} \;
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/gpm.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/sshd.pid
-r--r----- 1 root sys 32 2009-01-01 09:02 /var/run/cups/certs/0
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/hald.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/atd.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/syslogd.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/httpd/httpd.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/inetd.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/klogd.pid
-rw-r--r-- 1 root root 5 2009-01-01 09:02 /var/run/dbus/dbus.pid
-rw-rw-r-- 1 root utmp 4992 2009-01-03 12:06 /var/run/utmp
root@FamilyRoom:/#
|
|
|
|
01-03-2009, 04:33 PM
|
#11
|
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 4,677
Rep: 
|
Quote:
Originally Posted by BCarey
Is that = sign at the end of mysql.sock a typo?
|
The mysql.sock is a socket file, the '=' is how that fact is shown to the user, like an executable file is distinguished by the '*' at the end.
Eric
|
|
|
|
01-03-2009, 04:42 PM
|
#12
|
|
Senior Member
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,357
Rep: 
|
Quote:
Originally Posted by Alien Bob
The mysql.sock is a socket file, the '=' is how that fact is shown to the user, like an executable file is distinguished by the '*' at the end.
Eric
|
Interesting. Why wouldn't it show up when I do ls -l?
Brian
|
|
|
|
01-03-2009, 05:45 PM
|
#13
|
|
Member
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 281
Original Poster
Rep:
|
Solved
Quote:
Originally Posted by BCarey
Is that = sign at the end of mysql.sock a typo?
"chmod o+w /var/run/mysql.sock" should take care of it.
Brian
|
OK, indeed it did. Question is, what did it do?
Before:
Code:
root@USlack2:/var/run/mysql# ls -l
-rw-rw-r-- 1 mysql mysql 5 2009-01-01 01:24 mysql.pid
srwxrwxr-x 1 mysql mysql 0 2009-01-01 01:24 mysql.sock=
root@USlack2:/var/run/mysql# chmod o+w mysql.sock
After:
Code:
root@USlack2:/var/run/mysql# ls -l
total 4
-rw-rw-r-- 1 mysql mysql 5 2009-01-01 01:24 mysql.pid
srwxrwxrwx 1 mysql mysql 0 2009-01-01 01:24 mysql.sock=
Looking at the results it appears you gave world(others) write rights. I was confused by the 'o' As I was thinking owner. 'man chmod' set me straight.
One other thing. the "=" is not a typo. It shows in the console like that. What does that mean?
|
|
|
|
01-03-2009, 05:47 PM
|
#14
|
|
Member
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 281
Original Poster
Rep:
|
Quote:
Originally Posted by haertig
Following GazL's lead, here are mine (Slackware 12.1, basic install):
|
Thanks. The more info the better.
|
|
|
|
01-03-2009, 05:51 PM
|
#15
|
|
Member
Registered: Mar 2003
Location: PA
Distribution: Slackware 13.37 Linux Reg # 341245
Posts: 281
Original Poster
Rep:
|
I need to find a good tutorial on unix/linux rights. I know the basics, ok. But the sticky bit, uid & gid still trip me up. For instance, the "s" at the beginning of this line:
Code:
srwxrwxrwx 1 mysql mysql 0 2009-01-01 01:24 mysql.sock=
I assume that's sticky but I'm not sure what that means.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:40 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|