Shell startup script for mysql issues solved

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,666
Messages: 36,409

Your shell runs as root, root can always access everything. When you start mysql by hand you're also running it as root (bad idea by the way). The rc(8) script starts mysql via mysqld_safe(1) (which is a shell script), that drops privileges down to the mysql user to start the actual mysqld(8) process.

I still don't know how this happened but I got things to be working but I think there still some permission issues lingering somewhere and I am not sure if this is what's causing this issue that I am having.
What are the permission on /lib and /usr/lib?
Code:
root@molly:~ # ls -ld /lib /usr/lib
drwxr-xr-x   5 root  wheel   67 Jan 30 15:13 /lib
drwxr-xr-x  10 root  wheel  741 Jan 30 15:17 /usr/lib
The files inside those directory should also be owned by root:wheel and most will have 444 (-r--r--r--) permissions (the symlinks may have lrwxr-xr-x). They should, at the very least, be world readable.
 

richardtoohey2

Well-Known Member

Reaction score: 253
Messages: 481

What you are seeing seems unusual.

Something you have done has made your system very unhappy.

Might be quicker to backup your data & files & configuration and try and rebuild. Perhaps build a different machine and copy your backup onto that as a test first.

Otherwise you might spend ages and never find the issue.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,666
Messages: 36,409

You can also use mtree(8) and the files in /etc/mtree to check and/or fix any permission issues in the base OS.
 
OP
tony33

tony33

Active Member

Reaction score: 4
Messages: 132

Your shell runs as root, root can always access everything. When you start mysql by hand you're also running it as root (bad idea by the way). The rc(8) script starts mysql via mysqld_safe(1) (which is a shell script), that drops privileges down to the mysql user to start the actual mysqld(8) process.


What are the permission on /lib and /usr/lib?
Code:
root@molly:~ # ls -ld /lib /usr/lib
drwxr-xr-x   5 root  wheel   67 Jan 30 15:13 /lib
drwxr-xr-x  10 root  wheel  741 Jan 30 15:17 /usr/lib
The files inside those directory should also be owned by root:wheel and most will have 444 (-r--r--r--) permissions (the symlinks may have lrwxr-xr-x). They should, at the very least, be world readable.
I ran those commands

On my system I had everything you had except the -x at the end in the permissions which I assume is permission for it to be executable. instead of -x I get on my system is --.

Should I chmod the directory to all executable permissions?

update: I made those directories executable by changing permissions with chmod now the scripts work with no issues at all and there's no errors. it runs perfectly.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,666
Messages: 36,409

The execute bit on directories means you can enter that directory. The read bit is for reading the directory. That might sound like the same thing but the difference is quite important.

Directories are also treated as files. They have read, write, and execute permissions. The executable bit for a directory has a slightly different meaning than that of files. When a directory is marked executable, it means it is possible to change into that directory using cd(1). This also means that it is possible to access the files within that directory, subject to the permissions on the files themselves.

In order to perform a directory listing, the read permission must be set on the directory. In order to delete a file that one knows the name of, it is necessary to have write and execute permissions to the directory containing the file.
 
Top