View previous topic :: View next topic |
Author |
Message |
gent00-fun n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 05 Nov 2011 Posts: 20
|
Posted: Sun Feb 24, 2013 7:03 pm Post subject: /var/run - permission to write for other users ? |
|
|
I have upgraded mysql (to 5.5.29-r1 version), but couldn't start Quote: | Can't start server : Bind on unix socket: Permission denied |
Problem was with permission on /var/run (only root can write here), mysql user can't create /var/run/mysql/mysqld.sock file.
mysql is started as mysql user but mysql can't write to /var/run.
i solved this by changed /etc/mysql/my.cnf as below, but i wonder about /var/run directory...
Code: | socket = /var/lib/mysql/mysqld.sock
pid-file = /var/lib/mysql/mysqld.pid |
maybe can i change permissions to /var/run directory to allow other users than root write here. is this good idea ?? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23100
|
Posted: Sun Feb 24, 2013 7:30 pm Post subject: |
|
|
No, leave the permissions as-is. Directories in /var/run need to be created by the initscript if the program is not run as root, since modern /var/run tends to get cleared at reboot. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gent00-fun n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 05 Nov 2011 Posts: 20
|
Posted: Sun Feb 24, 2013 7:54 pm Post subject: |
|
|
The same problem with screen command now.
Quote: | Cannot make directory '/var/run/screen': Permission denied |
I made big update (emerge --update --ask world) and after that have problems with permissions.
I see that /var/run is link to /run now (i think that was not previously)
Code: |
$ ls /var/run
lrwxrwxrwx 1 root root 4 Feb 23 07:59 /var/run -> /run |
What can i do to solve problems with permissions ?? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
khayyam Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/9397496074fd0189143bb7.png)
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sun Feb 24, 2013 8:43 pm Post subject: |
|
|
gent00-fun ...
tempfiles.d ... openrc-0.11.x introduced a reimplementation of systemd's tmpfiles.d (/etc/init.d/tmpfiles.setup and /lib/rc/sh/tmpfiles.sh) and should be 100% compatable with the above linked manpage.
best ... khay |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gent00-fun n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 05 Nov 2011 Posts: 20
|
Posted: Thu Feb 28, 2013 12:33 pm Post subject: |
|
|
Hmm...
Where are default config files?
I have no files at:
Quote: | /etc/tmpfiles.d/*.conf
/run/tmpfiles.d/*.conf
/usr/lib/tmpfiles.d/*.conf |
For mysql i've created /etc/tmpfiles.d/mysqld.conf like below. I hope that is ok.
Code: | d /var/run/mysql 0755 mysql mysql - -
f /var/run/mysql/mysqld.sock 0755 mysql mysql - - |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
khayyam Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/9397496074fd0189143bb7.png)
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Feb 28, 2013 4:39 pm Post subject: |
|
|
gent00-fun wrote: | Where are default config files? |
gent00-fun ... there are no default config files. I assume the reason for this is that these should be part of the package in question, and not part of openrc, which just provides the mechanism to handle them. However, if one looks at /lib/rc/sh/tmpfiles.sh the following is defined:
Code: | tmpfiles_dirs='/usr/lib/tmpfiles.d/ /etc/tmpfiles.d/ /run/tmpfiles.d/' |
... so the method should be the same as described in the systemd implimentation manpage.
gent00-fun wrote: | For mysql i've created /etc/tmpfiles.d/mysqld.conf like below. I hope that is ok.
Code: | d /var/run/mysql 0755 mysql mysql - -
f /var/run/mysql/mysqld.sock 0755 mysql mysql - - |
|
That looks ok, but you should use /run, rather than /var/run (the latter is just a sym-link to /run and will no doubt be migrated in future). I haven't needed anything myself as I'm not using anything the breaks due to /var/run now being tmpfs ... so I haven't spent anytime reading the various docs. I'm just presenting what I understand to be the current method of dealing with the issue.
best ... khay |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|