When I found that Synology no longer supported LMS I decided to revert
to Plan A: use a desktop computer. My chosen computer is an Acer Revo,
but my model has a poorly specced Intel Atom. It claims to be X64, but
chokes on a 64bit Linux distribution. I installed lubuntu 18.04 (the
most recent 32bit distribution I could find). Lubuntu requires very
little of the computer resources and still manages a useful performance.


I wanted to have the choice of running it as a full desktop system with
a monitor mouse and keyboard or running it 'headless' just to have LMS
running.
Full desktop mode is important for adding new music files, LMS modules
and general system updates. 

Even the Synology NAS, consumes about 8 Watts at idle. The tiny Revo
consumes about 28 Watts at idle. For this reason, I only wanted it
running when it was in use, I wanted to be able to push the Power button
and go straight into running the LMS. When I had finished, I wanted to
push the Power button and have it shut down.

Problem No. 1 is that Lubuntu 18.04 requires a password to boot. Problem
No. 2 is that it still brings up a login requester even when set to
passwordless login.

SETTING LUBUNTU 18.04 TO PASSWORDLESS, AUTO-LOGIN.

Change /etc/lightdm/lightdm.conf so that it looks like this,

> [SeatDefaults]
> autologin-user=<your-user-name>
> autologin-user-timeout=0
> user-session=Lubuntu
> greeter-session=lightdm-gtk-greeter
> <blank line>

If there is no lightdm.conf file, create one (sudo leafpad - because you
need root permissions). If there is no last blank line, your system
might freeze.

STARTING UP LMS WITHOUT A PASSWORD.

This requires a change to the sudo system. You should consider using
visudo to do the text editing as this will check the syntax.

> visudo -f /etc/sudoers.d/logitech

If you are careful, you can still use sudo leafpad. Make sure there is a
blank line at the end of the file.

File Name: /etc/sudoers.d/logitech

> <your-user-name> ALL=(ALL) NOPASSWD: /usr/sbin/service 
> logitechmediaserver *
> <blank line>

This file uses the * character to match all of the LMS commands such as
start, stop and restart.
Leaving the /etc/sudoers file alone and putting the entries in
/etc/sudoers.d should mean that updates will not delete the
configuration.

Try,

> sudo service logitechmediaserver start

It should run without a password being necessary. You shouldn't need to
reboot.

RUN LMS AT STARTUP

If you do your own research, you may find solutions based on rc.d.
During a lubuntu update I saw the line,

> update-rc.d: warning: start and stop actions are no longer supported;
> falling back to defaults

When I tried one of these methods, LMS started passwordless, but with
user=Root. Nothing I could find would make it revert to user =.

I reinstalled lubuntu and LMS. 

The official Ubuntu method is very easy (and safe). You could just
create a file with leafpad
(/home/roy/.config/autostart/logitechmediaserver), but I suggest,

> sudo apt install gnome-startup-applications
> 
> gnome-session-properties

Click Add and enter the command to be executed at login (name and
comment are optional). For example, to make Firefox start automatically,
it's sufficient to type 'firefox' in the Command field and confirm with
Add. In our  case, type 'sh ' (you need the space as the third
character) and browse to the startup file.

I created the file ~/home/<your user
name>/Startup/logitechmediaserver.sh

> sudo service logitechmediaserver start
> sleep 3s
> <blank line>

Change the file permissions to make it executable. The line 'sleep 3s'
allows time for any text that may be sent to stdio. It works without,
but best to be safe.

If you reboot, you should be able to type the URL 127.0.0.1:9000 into
Firefox or another browser and it should load up the LMS user
interface.

I also use this method to get the screen resolution higher to make the
menus in apps like Libreoffice-writer larger: 'xrandr --dpi 130' in
file, xrandr.sh.

XFCE POWER MANAGER

Lubuntu defaults to 'Ask' when the power button is pressed: it brings up
the logout menu.

Change 'When Power Button Is Pressed' from 'ask' to 'Shutdown'
Reboot.

Oh dear, does it still bring up the logout menu? There appears to be a
bug in Xfce Power Manager. 

>  ~/.config/xfce4/xfconf/xfce-perchannel-xml /xfce4-power-manager.xml 

has the correct line,

> <property name="power-button-action" type="uint" value="4"/>

but it is ineffective.

There is a possible work around. If you do not have an /etc/acpi
folder,

> sudo apt-get install acpid

Check /etc/acpi/powerbtn.sh 

delete all but the last line,
> /sbin/shutdown -h now "Power button pressed"
> <blank line>

If the file does not exist, create it.

Reboot

If you still get the logout menu, try pushing the Power button for a
moment and then pressing 'Enter' on the keyboard. If this closes the
system, then this is your only way of doing it in 'headless' mode.

Restore powerbin.sh to its previous contents, or delete it altogether if
you added it. If you installed acpid, then uninstall it.


------------------------------------------------------------------------
Roy Leith's Profile: http://forums.slimdevices.com/member.php?userid=35534
View this thread: http://forums.slimdevices.com/showthread.php?t=117134

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

Reply via email to