Aylwin;437343 Wrote: 
> Thanks for the tip!  Now I've gotten a little further. sudo is installed
> and working.  But I'm still stuck.
> 
> There is no 'squeezecenter' user on my NAS.  I tried creating one (and
> modifying sudoers accordingly) but that didn't work.  There is a 'ssods'
> user which might be the one (SC is installed on top of SSOTS and the
> SSOTS user is 'ssods') but that didn't work either.
> 
> How exactly does this plugin run terminal commands?  Which part of the
> code? I have a feeling I'll need to mess around with SSOTS to get this
> working.
> 
> SSOTS: http://forums.slimdevices.com/showthread.php?t=44325
The plugin runs terminal commands by giving the account under which
SqueezeCenter is running some very specific permissions in /etc/sodoers.
Beyond that, the commands are executed in the
Plugins/SrvrPowerCtrl/Util.pm module using a standard perl 'system'
call.

I suggest you post the contents of your /etc/sudoers file and we'll see
if we can make sense of it.

With Fedora and other RedHat-like distros, the first thing that has to
happen is that /etc/sudoers must be modified so that the:

Defaults   requiretty

..directive is commented out.  This allows users like the
'squeezecenter' user...which otherwise doesn't have login
privileges...permission to run shell commands.  I'm not sure if the QNAP
is configured like that or not.  Debian/Ubuntu doesn't seem to come with
the 'requiretty' directive enabled by default.

Anyway, with that out of the way, you could try this:

Create a script by performing these commands in a terminal window:


Code:
--------------------
    
  script=/usr/local/sbin/spc-test.sh
  touch $script
  echo '#!/bin/sh' >$script
  echo 'whoami >/tmp/scuser.txt' >>$script
  chmod 755 $script
  touch /tmp/scuser.txt
  chmod a+rw /tmp/scuser.txt
  
--------------------


Now go into the SrvrPowerCtrl settings page and change the Restart
command to:

/usr/local/sbin/spc-test.sh

..and apply the changes.

Next, using the SrvrPowerCtrl webUI, try a 'Restart'.

Watch your terminal for messages or prompts...if there are none, then
that should indicate that whatever user account SC is running under does
have permission to execute shell scripts.

Finally, from your terminal window, do a:

cat /tmp/scuser.txt

..and, if things went well, you should see the user name of the account
under which SqueezeCenter is running.

Again, not being a QNAP user, I'm guessing here.  But the
'squeezecenter' user that the SC install package creates won't be a
regular user.  On linux systems if you try the command:

# sudo cat /etc/passwd | grep squeeze

..you should see something like:

Code:
--------------------
    
  squeezecenter:x:432:476:SqueezeCenter Music 
Server:/usr/share/squeezecenter:/sbin/nologin
  
--------------------

That indicates that the squeezecenter user isn't a 'real' user..i.e.
can't log into the system with a password.  It's just an account which
holds the credentials under which SqueezeCenter is run.

Before we can proceed further, you need to really find out what user
account SqueezeCenter runs under on the QNAP.  If the method I proposed
above doesn't work, then I suggest you ask on the 3rd party hardware
forum.


-- 
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to