Page 1 of 1

System shutdown problem

PostPosted: May 28th, '13, 11:02
by mackowiakp
From time to time, my PC does not want to shutdown completely by using <power-off> button from M3 mail menu. I think it is probably hardware related problem (I use Assus mainboard - quad-core Intel CPU). But <init 0> from root console always downs PC. So is any way to change default action of <power-off> button from M3 menu to <init 0> and run it as ordinary user?

Re: System shutdown problem

PostPosted: May 28th, '13, 17:24
by digigold
What happens if you run 'init 0' as root or sudo?

Re: System shutdown problem

PostPosted: May 28th, '13, 17:29
by mackowiakp
It downs PC normally. Every time.

Re: System shutdown problem

PostPosted: May 28th, '13, 20:44
by doktor5000
You could add a custom launcher, which runs init 0 ...

Re: System shutdown problem

PostPosted: May 29th, '13, 00:21
by mackowiakp
Hmmm. I created script called "stop" located in home dir of this user:

Code: Select all
#!/bin/bash
/bin/sudo /sbin/init 0


It works from console as ordinary users and down the system. So sudoers are configured correctly.
But when I created icon on desktop with link to run such script - it does not work. Any idea why?

The desktop file is as follows:

Code: Select all
[maciek@piotr Desktop]$ cat STOP.desktop
[Desktop Entry]
Comment[pl]=Zatrzymuje system
Comment=Zatrzymuje system
Exec=/home/maciek/Pobrane/stop
GenericName[pl]=STOP
GenericName=STOP
Icon=system-shutdown
MimeType=
Name[pl]=STOP
Name=STOP
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Re: System shutdown problem

PostPosted: Jun 1st, '13, 20:21
by doktor5000
Please show the output of
Code: Select all
ls -al /home/maciek/Pobrane/stop

Re: System shutdown problem

PostPosted: Jun 1st, '13, 20:32
by mackowiakp
So You have:
Code: Select all
[maciek@piotr ~]$ ls -al /home/maciek/Pobrane/stop
-rwxr--r-- 1 maciek maciek 221 maj 29 09:28 /home/maciek/Pobrane/stop*


And now, the script "stop" consist of:

Code: Select all
[maciek@piotr ~]$ cat Pobrane/stop
#!/bin/bash
S=`Xdialog --timeout 30 --fixed-font --title "Zatrzymanie systemu" --yesno "Czy NATYCHMIAST wyłączyć system?" 8 85 2>/dev/null`
if [ $? -eq "1" ]
then
        exit
else
        /bin/sudo /sbin/init 0


And it can be run by clicking icon on desktop but it is necessary to run it in "terminal mode" setup in desktop icon definition.
So I have empty console as background for Xdialog graphical content...
fi

Re: System shutdown problem

PostPosted: Jun 1st, '13, 21:21
by doktor5000
Well, does it work now or not?

Re: System shutdown problem

PostPosted: Jun 1st, '13, 21:27
by mackowiakp
Work, but I have to run this script ONLY in "terminal mode", so additionally blank console is displayed on the desktop. Can it bi run without displaying such console?