On 02/06/14 23:57, Ted Byers wrote:
Thus, I need, somehow, to set up a directory to which MySQL can write and wwwrun can read.
Really mysql? The database server writes the file? Well, in that case I would advise to add the user mysql to group www and make that directory group writable: groupadd --add-user mysql www chgrp --recursive www /srv/www/htdocs/misc chmod g+ws www /srv/www/htdocs/misc The last command asserts that newly created files in that directory belong to group www as well, so that wwwrun can read them. Btw, are you sure that the group's named www? By default, on openSUSE wwwrun's group is named wwwrun, too. Concerning your question:
(and where would I find out what user mysql runs as)
Interesting question; that's not as easy. ps -ef lists all running process. The first column lists the account name that owns the process. One can filter ps' result with grep. I.e.: puma:data-dictionary $ ps -ef | grep mysql root 16332 1 0 01:24 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --user=mysql --pid-file=/var/run/mysql/mysqld.pid --socket=/var/run/mysql/mysql.sock --datadir=/data/mysql mysql 16682 16332 0 01:24 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/data/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysql/mysqld.log --pid-file=/var/run/mysql/mysqld.pid --socket=/var/run/mysql/mysql.sock --port=3306 schrod 16774 2621 0 01:25 pts/2 00:00:00 grep mysql (Probably the lines will have been wrapped around; there are three lines as the command result.) -- The last line lists our grep command, we can ignore it. -- The 1st line is about a command /bin/sh with parameters /usr/bin/mysqld_safe and more args, process owned by root. -- The 2nd line is about a command /usr/sbin/mysqld, process owned by account "mysql". You'll have to deduce from the command names that the 2nd line is the actual server process, and the 1st line is the sysadmin command that starts the server. (There are more clues about that, but I don't have the energy to write them up at 1h30 am... ;-))
BTW: I realize this is a newby question, but all the documentation I have read for chown refers only to files. Does it work on directories also, or is the another command I need to look up?
Yes, both chown and chgrp also work on directories. If the directory has files in it and you want to change owner/group of these files as well in one go, you can use the option --recursive, as quoted above. Actually, it's quite an interesting question if file manager GUIs like KDE's Dolphin etc. support some of these actions (change ownership and group, access modes, also recursively) good enough for a newbie like you who comes from a Windows background to be a better environment than shell commands. I cannot really tell that, as I don't use these file managers. HTH, Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jschrod@acm.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org