Bug 17823 - Log file created as root:root, server cannot write to it and exits
: Log file created as root:root, server cannot write to it and exits
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.7.1
: PC Linux (other)
: -- normal (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-17 10:32 UTC by John Stimson
Modified: 2011-12-17 10:32 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Stimson 2011-12-17 10:32:40 UTC
I am starting the server from the root account, with options "--user slim --group slim --daemon --logfile /home/slimserver/slimserver.log".

/home/slimserver is owned by slim:slim

/usr/local/src/Audio/logitechmediaserver has been recursively chowned to slim:slim before the operations described below.

If /home/slimserver/slimserver.log does not exist on startup, it gets created with owner root and group root.

Then the server exits because it cannot write to the log file because it is running as user slim.

A missing log file should really be created by the server with owner and group settings that the server will be running under.

The error produced on the console is: 
Can't call method "log" on an undefined value at /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/Log/Log4perl/Appender.pm line 189.


ALSO, it seems that when the server copies or installs some of the perl modules within the logitechmediaserver directory, those are created with inaccessible permissions as well.  The server exits with this message in the log file:

Slim::Music::TitleFormatter::init (42) Warning: Can't locate Slim/Schema/Track.pm in @INC (@INC contains: /usr/local/src/Audio/squeezeboxserver-7.5.1-30836/Cache/InstalledPlugins /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/5.10/i386-linux-thread-multi /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/5.10/i386-linux-thread-multi/auto /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/5.10.1/i486-linux-thread-multi /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/5.10.1/i486-linux-thread-multi/auto /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/5.10/i486-linux-thread-multi /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/5.10/i486-linux-thread-multi/auto /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN/arch/i486-linux-thread-multi /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/lib /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/CPAN /usr/local/src/Audio/logitechmediaserver-7.7.1-33735 /usr/local/src/Audio/logitechmediaserver-7.7.1-33735 /usr/lib/perl5/5.10.1/i486-linux-thread-multi /usr/lib/perl5/5.10.1 /usr/lib/perl5/site_perl/5.10.1/i486-linux-thread-multi /usr/lib/perl5/site_perl/5.10.1 /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.10.1/i486-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.1 /usr/lib/perl5/vendor_perl .) at /usr/local/src/Audio/logitechmediaserver-7.7.1-33735/Slim/Music/TitleFormatter.pm line 42.

Once I do a recursive chown on the logitechmediaserver directory, the server runs successfully.