Strange problem mysqld_safe stopped working
Hi! I don't know if this is a CRUX problem or just me messing up my system (probably the later :P) but here goes. I have always started mysqld manually from a shell with mysqld_safe since i installed CRUX without problems, but since a couple of weeks that doesn't work any more. If i start manually/directly with /usr/sbin/mysqld i get these errors: 081124 23:03:42 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld.pid' (Errcode: 13) 081124 23:03:42 [ERROR] Can't start server: can't create PID file: Permission denied BUT, if i start with the startscript in /etc/rc.d/mysqld, it work's. I figured out that it works because the startscript in /etc/rc.d creates the PID file as root and then change owner to daemon for user and group before it executes mysqld as the user daemon. This because (probably?) nobody but root has write privileges to /var/run. But how on earth could mysqld_safe have worked before? The only thing i've done before it stopped working, that i can think of, is installing a couple of ports. Unfortunatly i forgot exactly which ports i installed since i hadn't used mysql for a couple of weeks when i discovered this problem. Have some port changed the write privileges for group in /var/run? Should group have write privileges to /var/run? I've seen other services PID files in /var/run that has owner and group "daemon" so i still don't understand why just mysqld_safe doesn't work anymore. I know i can enable /etc/rc.d/mysqld in startup, but i just use mysql sometimes for testing and don't want to waste resources when i don't need it, and also this mysterious problem annoys me. :) Mats
On Mon, 24 Nov 2008 23:33:59 +0100 "Mats Pettersson" <mog.pettersson@telia.com> wrote:
Hi!
Hello Mats,
[...]
I know i can enable /etc/rc.d/mysqld in startup, but i just use mysql sometimes for testing and don't want to waste resources when i don't need it, and also this mysterious problem annoys me. :)
I am not sure if you tried or you know about this, but why don't you use the rc.d script to start mysqld? (/etc/rc.d/mysqld start) You can make an alias if you feel more confortable and there is no need to add it to the rc.conf file. Sorry if this is an obvious answer and you tried it.
Mats
Regards, Victor. -- Learning bit by bit. -pitillo-
From: "Victor Martinez" <pitillo@ono.com> Sent: Tuesday, November 25, 2008 3:23 PM
On Mon, 24 Nov 2008 23:33:59 +0100 "Mats Pettersson" <mog.pettersson@telia.com> wrote:
Hi!
Hello Mats,
[...]
I know i can enable /etc/rc.d/mysqld in startup, but i just use mysql sometimes for testing and don't want to waste resources when i don't need it, and also this mysterious problem annoys me. :)
I am not sure if you tried or you know about this, but why don't you use the rc.d script to start mysqld? (/etc/rc.d/mysqld start) You can make an alias if you feel more confortable and there is no need to add it to the rc.conf file. Sorry if this is an obvious answer and you tried it.
Yup! i tried it and it works fine. However mysqld_safe has other error checking than /etc/rc.d/mysqld. But the strange thing is that somewhere somehow some privilieges must have been changed since mysqld_safe don't have access to /var/run as it must have had before (when it worked). Thats what makes me suspicious to whats really have happened. I have searched the net and found others that have reported the same problem, but i have not seen any explanation, just suggestions that they should alter privileges to /var/run or create a mysqld directory in /var/run with the right privileges. I don't have any problem with other applications that puts stuff in /var/run, so why suddenly just mysqld_safe? Mats
participants (2)
-
Mats Pettersson
-
Victor Martinez