PDA

View Full Version : Fedora - Not creating user?



horb
2008-03-07, 20:10
I'm trying to move ti squeezecenter from slimserver and I'm on Fedora 7 (I think).

I've got the RPM installed, but the server stop very quickly after exec. I've run the server from the command line, but it looks like it is yelling because it can't find the slimserver user. I can see any user that it created.

To top it off I can't find the new log find <grin>. Ya I'm losing it...

Any help would be appreciated.

Mark Miksis
2008-03-07, 22:04
The SC7 RPM creates the user "squeezecenter" and runs as that user. How are you starting it from the command line? Try "service squeezecenter start". The logs are in /var/log/squeezecenter.

horb
2008-03-08, 10:32
Thanks Fletch, I can't find the squeezecenter user so it looks like the RPM is not creating it. Any help would be appreciated. Here is the log:
[08-03-07 22:03:54.2163] Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn't connect to database: [Can't connect to local MySQL server through socket '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]
[08-03-07 22:03:57.5835] main::changeEffectiveUserAndGroup (775) Warning: SqueezeCenter must not be run as root! Trying user slimserver instead.
[08-03-07 22:03:57.5860] main::changeEffectiveUserAndGroup (783) Warning: User slimserver not found.
[08-03-07 22:03:57.5883] Slim::Schema::forceCommit (1363) Warning: Trying to commit transactions before DB is initialized!
[08-03-07 22:04:55.7134] Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn't connect to database: [Can't connect to local MySQL server through socket '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]
[08-03-08 12:29:42.0614] Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn't connect to database: [Can't connect to local MySQL server through socket '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]

Mark Miksis
2008-03-08, 11:26
Thanks Fletch, I can't find the squeezecenter user so it looks like the RPM is not creating it. Any help would be appreciated.

I've tested the RPM on F7 and I don't know of any common problem that would prevent the squeezecenter user from being created. Please take a look near the end of /etc/passwd and /etc/group and confirm it's not there.


[08-03-07 22:03:57.5835] main::changeEffectiveUserAndGroup (775) Warning: SqueezeCenter must not be run as root! Trying user slimserver instead.
[08-03-07 22:03:57.5860] main::changeEffectiveUserAndGroup (783) Warning: User slimserver not found.

This error message is misleading as it should refer to squeezecenter not slimserver. Nonetheless, please respond to my previous questions:

How are you starting SC?
What happens if you try to start it with "service squeezecenter start"?

horb
2008-03-08, 16:09
Sorry I did not answer the first question. I have started it via "service squeezecenter start". The service appears to start normally, but end quickly with no error to the screen. If you check the log you see the error before.

Yes the user:

squeezecenter:x:499:499:SqueezeCenter Music Server:/usr/share/squeezecenter:/sbin/nologin

and group is there:
squeezecenter:x:499:

horb
2008-03-08, 16:32
So working off that, I removed the RPM and the user was still there. Then removed the user and then re installed the RPM. The log now only says one line:

[08-03-08 18:25:44.0260] Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn't connect to database: [Can't connect to local MySQL server through socket '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]

The mysqld service is up and running it seems.

Looks like I'm getting closer..

pfarrell
2008-03-08, 17:03
horb wrote:
> MySQL server through socket
> '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]

Check the permissions and ownership on that directory, specifically
/var/lib/squeezecenter/cache/
needs to be setup so the user that is squeezecenter is, can create files
in that directory.

horb
2008-03-08, 17:45
That did it. Thanks for pointing me in the correct direction!

Mark Miksis
2008-03-09, 09:57
Check the permissions and ownership on that directory, specifically
/var/lib/squeezecenter/cache/
needs to be setup so the user that is squeezecenter is, can create files
in that directory.

FYI, the RPM creates this directory with the proper permissions and ownership. Trying to run SC as root will generate the previously reported errors as well as mess up the ownership of the cachedir (and possibly the prefs file and log file).

pfarrell
2008-03-10, 13:44
Trying to run SC as root will generate the previously reported errors as well as mess up the ownership of the cachedir (and possibly the prefs file and log file).

For folks not as experiences as Fletch, good Unix/Linux practices are to never run services as root. Its bad in many ways.

Normal practice is to invent a limited power user and run the application that way.

krita
2008-03-20, 14:33
horb wrote:
> MySQL server through socket
> '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]

Check the permissions and ownership on that directory, specifically
/var/lib/squeezecenter/cache/
needs to be setup so the user that is squeezecenter is, can create files
in that directory.
I'm getting the same error. Running squeezecenter on Kubuntu Hardy (alpha I know).


$ ls -l /var/lib/squeezecenter/cache/
totalt 140
-rw-r--r-- 1 squeezecenter nogroup 17 2008-03-20 22:15 cookies.dat
-rw-r--r-- 1 squeezecenter nogroup 1119 2008-03-20 22:15 my.cnf
drwxr-xr-x 2 squeezecenter nogroup 4096 2008-03-20 22:00 MySQL
-rw-r--r-- 1 squeezecenter nogroup 125740 2008-03-20 22:00 stringcache
Everything is fine here, right? (I've never tried to run it as root.)

Sidenote: I dualboot with Arch Linux, and I have a working slimserver install there. But I won't mess with that one until I know that I can get squeezecenter up and running.

EDIT:

This is what I find in /var/log/squeezecenter/server.log:

2008-03-21 16:43:07 squeezecenter_safe started.
[08-03-21 16:43:39.5325] Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn't connect to database: [Can't connect to local MySQL server through socket '/var/lib/squeezecenter/cache/squeezecenter-mysql.sock' (2)]
[08-03-21 16:43:39.5343] Slim::Schema::forceCommit (1363) Warning: Trying to commit transactions before DB is initialized!
2008-03-21 16:43:39 SqueezeCenter died. Restarting.

jones6r
2008-03-26, 14:12
I had the same problem trying to get Squeezecenter 7.01 to work with Ubuntu Hardy.

I had to edit /var/lib/squeezecenter/prefs/server.prefs as follows:

dbpassword: ????
dbsource: dbi:mysql:hostname=127.0.0.1;port=3306;database=sq ueezecenter
dbusername: squeezecenter

Hope that helps..

krita
2008-03-27, 09:53
Got it! Thanks for pointing me in the right direction.

* Note that my solution here is not standard, but it worked for me *

I red this page:
http://wiki.slimdevices.com/index.cgi?ExistingMySQLInstance

And did this:

# mysql -u root -p
Enter password: admin_password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 103 to server version: 5.0.24a-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database slimserver;
Query OK, 1 row affected (0.22 sec)

mysql> grant all on slimserver.* to slimserver identified by '**********';
Query OK, 0 rows affected (0.13 sec)

mysql> flush privileges;
Query OK,

mysql> quit

Found this in /var/log/syslog
Mar 27 16:07:10 localhost mysqld[32326]: Version: '5.0.51a-3ubuntu3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)

Thus I had to edit /var/lib/squeezecenter/prefs/server.prefs :

dbpassword: **********
dbsource: dbi:mysql:hostname=127.0.0.1;port=3306;database=%s ;mysql_socket=/var/run/mysqld/mysqld.sock
dbusername: slimserver

Mark Miksis
2008-03-27, 10:12
I'm not sure what the original problem here is, but...

FYI, there should be no reason to make the above mysql changes unless you really want to run SC using your own mysql instance. If not, the deb package should "just work" without making any changes to the mysql setup.

krita
2008-03-30, 15:37
Ok, I'll edit my post

Klaas
2008-05-04, 03:58
I had the same problem trying to get Squeezecenter 7.01 to work with Ubuntu Hardy.

I had to edit /var/lib/squeezecenter/prefs/server.prefs as follows:

dbpassword: ????
dbsource: dbi:mysql:hostname=127.0.0.1;port=3306;database=sq ueezecenter
dbusername: squeezecenter

Hope that helps..

did you do something else? I can't get it working. Tried your solution and the one with the creation of the DB via the MySQL interface.

I still get the error:
[08-05-04 12:54:32.3344] Slim::Schema::Storage::throw_exception (67) Error: DBI Connection failed: DBI connect('hostname=127.0.0.1;port=3306;database=squ eezecenter:mysql_socket=/var/run/mysqld/mysqld.sock','squeezecenter',...) failed: Access denied for user ''@'localhost' to database 'squeezecenter' at /usr/share/squeezecenter/CPAN/DBIx/Class/Storage/DBI.pm line 652

I don't understand the user issue "for user ''@'localhost'", do I have a problem here?

Klaas
2008-05-04, 04:43
I found a solution in this thread:
http://forums.slimdevices.com/showthread.php?t=46614&highlight=connect+local+MySQL

Basically:
- install unstable release 7.0.1 to fix something with apparmor (whatever this is)
- reboot Ubuntu then SqueezeCenter worked again