Thursday, 23 July 2015

what to do when PCDUINO will not shut down after lubuntu upgrade - by Ross Devitt

Ok, I came across an annoying problem with the PCDUINO after I ran sudo apt-get upgrade.  The shutdown icon on the right end of the panel no longer works.  It simply flashes the shutdown dialog on the screen for one second and if you can read it quickly enough it says you cannot shutdown while another user is logged in.

Now, on Linux, there is always another user logged in.  If you run the command   who   in a terminal you will see user  root logged in at ttys0 and tty1.  This is normal and necessary.  You will also see user ubuntu logged in at tty7.  This is you unless you created a new user account.

What is happening is due to the way some linux distros work with user policy and it is annoying but ridiculously simple to fix on our little PCDUINO because in lubuntu any files in the desktop folder are displayed 'on the desktop.

1 - open your desktop folder
2 - create a new text document called  SHUTDOWN
3 - open the text document
4 - In the text document type ecactly what is in the two lines below (nothing else) the 0 is a number ZERO

!#/bin/bash
sudo shutdown -h 0

5 - save the file then make it executable.  You could do this from the command line, but the easiest way is to open the desktop folder with File manager, then right click your file called SHUTDOWN   and open the Permissions tab.  At the bottom you will see a check box that says 'Make this file executable'.  Click the box to put a tick in it, and you now have a little program that will shut down your computer.

The file SHUTDOWN  will show on your desktop.  Simply click it and the PCDUINO will close down neatly and normally.  To start it again, just unplug the USB power cable from the power adapter or from your power bank and plug it in again.

Reboot from the icon is also dead, so you can follow the directions above and make another file called REBOOT in the Desktop folder.
Don't forget to save your new file and make it executable.

Just make the contents  below:

!#/bin/bash
sudo reboot


Again, this REBOOT file will show on your desktop.  Simply click on it and you can reboot your system.

I name the files in CAPITALS so I can find them easily and not click them accidentally.

There are more complicated ways to solve this problem by editing system files, but this is simple, quick and effective.

Cheers,

RossD


No comments:

Post a Comment