PDA

View Full Version : SlimServer 6.0 on FreeBSD



Dan Rich
2005-03-30, 15:32
Does anyone have a working startup script for SlimServer 6.0 on
FreeBSD? The old one that I've been using with 5.x doesn't want to
start 6.0.

I end up with errors like the following:
Starting slimserver.
Use of uninitialized value in -e at
/usr/local/slimserver/Slim/Utils/Prefs.pm line 123.
Use of uninitialized value in -d at
/usr/local/lib/perl5/5.8.6/File/Path.pm line 153.
fileparse(): need a valid pathname at
/usr/local/lib/perl5/5.8.6/File/Path.pm line 154
Compilation failed in require at
/usr/local/slimserver/Slim/Buttons/Plugins.pm line 20.
BEGIN failed--compilation aborted at
/usr/local/slimserver/Slim/Buttons/Plugins.pm line 20.
Compilation failed in require at
/usr/local/slimserver/Slim/Buttons/Common.pm line 15.
BEGIN failed--compilation aborted at
/usr/local/slimserver/Slim/Buttons/Common.pm line 15.
Compilation failed in require at
/usr/local/slimserver/Slim/Buttons/Settings.pm line 11.
BEGIN failed--compilation aborted at
/usr/local/slimserver/Slim/Buttons/Settings.pm line 11.
Compilation failed in require at
/usr/local/slimserver/Slim/Display/Display.pm line 14.
BEGIN failed--compilation aborted at
/usr/local/slimserver/Slim/Display/Display.pm line 14.
Compilation failed in require at /usr/local/slimserver/slimserver.pl
line 205.
BEGIN failed--compilation aborted at /usr/local/slimserver/slimserver.pl
line 205.

But it runs find when running the same command from the command line as
the slimserver user (which the startup script should be doing).

--
Dan Rich <drich (AT) employees (DOT) org> | http://www.employees.org/~drich/
| "Step up to red alert!" "Are you sure, sir?
| It means changing the bulb in the sign..."
| - Red Dwarf (BBC)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCSykOIYJ5xMxu09kRAoSVAKCafAFfKwOJSbT/KHw6d1AXMDJ1ugCgrBOx
/jDVTSg3qc5zpcIPFtUrrVg=
=/IcK
-----END PGP SIGNATURE-----

Rob Moore
2005-03-31, 09:01
Dan Rich wrote:
> Does anyone have a working startup script for SlimServer 6.0 on
> FreeBSD? The old one that I've been using with 5.x doesn't want to
> start 6.0.
>

Hi, Dan,

I saw this same problem on Ubuntu (Debian variant). I was using
start-stop-daemon and apparently it does not set the HOME variable.
Not sure why this wasn't an issue with 5.4.1, but I wrote a wrapper
script that sets the HOME variable and then starts slimserver.pl and,
voila, it works.

HTH,

Rob

Marc Sherman
2005-03-31, 11:00
Rob Moore wrote:
>
> I saw this same problem on Ubuntu (Debian variant). I was using
> start-stop-daemon and apparently it does not set the HOME variable.
> Not sure why this wasn't an issue with 5.4.1, but I wrote a wrapper
> script that sets the HOME variable and then starts slimserver.pl and,
> voila, it works.

Is this a 6.0 bug?

- Marc

Rob Moore
2005-03-31, 11:23
Marc Sherman wrote:
> Is this a 6.0 bug?

Not sure if it could be qualified as a bug, but, indeed, it would be
nice if there were a slimserver home parameter that could be passed in
to slimserver.pl or else if it would figure out the directory
slimserver.pl lives in. Worst case, pwd could be a fallback.

Dan Rich
2005-03-31, 12:55
Rob Moore wrote:

> Marc Sherman wrote:
>
>> Is this a 6.0 bug?
>
>
> Not sure if it could be qualified as a bug, but, indeed, it would be
> nice if there were a slimserver home parameter that could be passed in
> to slimserver.pl or else if it would figure out the directory
> slimserver.pl lives in. Worst case, pwd could be a fallback.

Setting it fixes things on my machine. Personally, I'd call it a bug.

However, it's easy to fix, here's a patch:
--- /usr/local/slimserver/slimserver.pl.orig Thu Mar 31 11:50:32 2005
+++ /usr/local/slimserver/slimserver.pl Thu Mar 31 11:54:15 2005
@@ -84,6 +84,10 @@
BEGIN {
use Symbol;

+ # Get our home directory
+ my $homedir=(getpwuid($<))[7];
+ $ENV{'HOME'} = $homedir;
+
# This begin statement contains some trickery to deal with modules
# that need to load XS code. Previously, we would check in a module
# under CPAN/arch/$VERSION/auto/... including it's binary parts and


This forces $ENV{'HOME'} to whatever the home directory is for the user
running the code. There may be a more elegant way to do this -- heck, I
could even argue that the FreeBSD startup scripts should be switching
users with "su -", and then this wouldn't be an issue.

--
Dan Rich <drich (AT) employees (DOT) org> | http://www.employees.org/~drich/
| "Step up to red alert!" "Are you sure, sir?
| It means changing the bulb in the sign..."
| - Red Dwarf (BBC)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCTFXEIYJ5xMxu09kRAqcxAJ9iOqT7buhrLkRAKioevB taJsqrkwCfTFnD
VMpa4KhihQKQAfhHkKd1BOQ=
=TMl6
-----END PGP SIGNATURE-----

Rob Moore
2005-03-31, 13:05
Dan Rich wrote:
> This forces $ENV{'HOME'} to whatever the home directory is for the user
> running the code. There may be a more elegant way to do this -- heck, I
> could even argue that the FreeBSD startup scripts should be switching
> users with "su -", and then this wouldn't be an issue.

Hi, Dan,

I can't say for FreeBSD, but in the case of Debian it is a shortcoming
of start-stop-daemon (see, for example
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295169). IMHO, the
current behaviour when using chuid violates the Rule of Least Surprise.

Rob

Marc Sherman
2005-03-31, 13:07
Dan Rich wrote:
>
> Setting it fixes things on my machine. Personally, I'd call it a bug.

Yeah, I think so too. You should file it in bugzilla.

- Marc