System shutdown problem

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

System shutdown problem

Postby mackowiakp » May 28th, '13, 11:02

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?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: System shutdown problem

Postby digigold » May 28th, '13, 17:24

What happens if you run 'init 0' as root or sudo?
"A mind that is stretched by a new experience can never go back to its old dimensions."
~Oliver Wendell Holmes, Jr.
User avatar
digigold
 
Posts: 150
Joined: May 9th, '12, 14:50
Location: Northern U.S.

Re: System shutdown problem

Postby mackowiakp » May 28th, '13, 17:29

It downs PC normally. Every time.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: System shutdown problem

Postby doktor5000 » May 28th, '13, 20:44

You could add a custom launcher, which runs init 0 ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: System shutdown problem

Postby mackowiakp » May 29th, '13, 00:21

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=
Last edited by isadora on May 29th, '13, 07:01, edited 1 time in total.
Reason: Placed command-output between [CODE]-tags, for readability. ;)
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: System shutdown problem

Postby doktor5000 » Jun 1st, '13, 20:21

Please show the output of
Code: Select all
ls -al /home/maciek/Pobrane/stop
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: System shutdown problem

Postby mackowiakp » Jun 1st, '13, 20:32

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
Last edited by isadora on Jun 1st, '13, 20:47, edited 1 time in total.
Reason: Command-output placed between [CODE]-tags, to keep the forum readable. ;)
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: System shutdown problem

Postby doktor5000 » Jun 1st, '13, 21:21

Well, does it work now or not?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: System shutdown problem

Postby mackowiakp » Jun 1st, '13, 21:27

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?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest