Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

/var/run - permission to write for other users ?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
gent00-fun
n00b
n00b
Posts: 20
Joined: Sat Nov 05, 2011 7:56 am

/var/run - permission to write for other users ?

  • Quote

Post by gent00-fun » Sun Feb 24, 2013 7:03 pm

I have upgraded mysql (to 5.5.29-r1 version), but couldn't start
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: Select all

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 ??
Top
Hu
Administrator
Administrator
Posts: 24556
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Feb 24, 2013 7:30 pm

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.
Top
gent00-fun
n00b
n00b
Posts: 20
Joined: Sat Nov 05, 2011 7:56 am

  • Quote

Post by gent00-fun » Sun Feb 24, 2013 7:54 pm

The same problem with screen command now.
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: Select all

$ ls /var/run 
lrwxrwxrwx 1 root root 4 Feb 23 07:59 /var/run -> /run
What can i do to solve problems with permissions ??
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Sun Feb 24, 2013 8:43 pm

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
Top
gent00-fun
n00b
n00b
Posts: 20
Joined: Sat Nov 05, 2011 7:56 am

  • Quote

Post by gent00-fun » Thu Feb 28, 2013 12:33 pm

Hmm...

Where are default config files?

I have no files at:
/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: Select all

d       /var/run/mysql              0755 mysql mysql - -
f       /var/run/mysql/mysqld.sock  0755 mysql mysql - -
Top
khayyam
Watchman
Watchman
User avatar
Posts: 6227
Joined: Thu Jun 07, 2012 2:45 am
Location: Room 101

  • Quote

Post by khayyam » Thu Feb 28, 2013 4:39 pm

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: Select all

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: Select all

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
Top
Post Reply

6 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy