Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/var/run - permission to write for other users ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gent00-fun
n00b
n00b


Joined: 05 Nov 2011
Posts: 18

PostPosted: Sun Feb 24, 2013 7:03 pm    Post subject: /var/run - permission to write for other users ? Reply with quote

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
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9051

PostPosted: Sun Feb 24, 2013 7:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
gent00-fun
n00b
n00b


Joined: 05 Nov 2011
Posts: 18

PostPosted: Sun Feb 24, 2013 7:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2244

PostPosted: Sun Feb 24, 2013 8:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
gent00-fun
n00b
n00b


Joined: 05 Nov 2011
Posts: 18

PostPosted: Thu Feb 28, 2013 12:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2244

PostPosted: Thu Feb 28, 2013 4:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum