Bug 16921 - Server restart fails from web UI if slimserver.pl was launched with --user
: Server restart fails from web UI if slimserver.pl was launched with --user
Status: RESOLVED DUPLICATE of bug 16343
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.6.0
: Other Linux (other)
: P2 major (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-09 14:10 UTC by Dave Hooper
Modified: 2011-05-27 09:01 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 Dave Hooper 2011-02-09 14:10:56 UTC
If I start slimserver.pl with the --user command line option, the server will change uid and gid as part of its init.  When I execute a server restart from the web UI (e.g. 'plugins have been updated, do you want to restart the server'), I get the following messages in the logfile:


[11-02-09 21:53:57.6962] main::init (346) Starting Squeezebox Server (v7.6.0, r31840, Wed Jan 26 05:56:36 MST 2011) perl 5.012002
[11-02-09 21:53:57.7239] main::changeEffectiveUserAndGroup (931) Warning: Current user is squeezeboxserver
[11-02-09 21:53:57.7258] Carp::croak (62) Warning: write_file '/var/run/slimserver.pid' - sysopen: Permission denied at /usr/src/squeezeboxserver/slimserver.pl line 1113
[11-02-09 21:53:57.7301] main::changeEffectiveUserAndGroup (932) Warning: Must run as root to change effective user or group.
[11-02-09 21:53:57.7314] main::changeEffectiveUserAndGroup (934) Warning: Aborting at /usr/src/squeezeboxserver/slimserver.pl line 934.


at which point slimserver.pl exits.

The 'die "Aborting"' logic in sub changeEffectiveUserAndGroup does not take into account the fact that the uid and gid have already been and don't need to be set again.

However the fact that the server restart also attempts to also create the .pid file (as shown in above log) suggests that a 'server restart' actually causes slimserver to attempt to carry out too many of the init steps unneccesarily.
Comment 1 Michael Herger 2011-05-27 09:01:07 UTC

*** This bug has been marked as a duplicate of bug 16343 ***