Bugzilla – Bug 16921
Server restart fails from web UI if slimserver.pl was launched with --user
Last modified: 2011-05-27 09:01:07 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.
*** This bug has been marked as a duplicate of bug 16343 ***