Patchwork [1/1] shutdown-desktop: use poweroff for the Exec field in the shutdown.desktop

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Jan. 15, 2014, 7:10 a.m.
Message ID <4975a4727b07aa321bb8d19429efc0796a115ecc.1389769773.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/64791/
State Accepted
Commit 21b45486611388d32ea75e90d04a71c0884edb7d
Headers show

Comments

Qi.Chen@windriver.com - Jan. 15, 2014, 7:10 a.m.
Use 'poweroff' instead of 'halt' for the Exec field in the shutdown.desktop.

The purpose of this patch is to make the 'shutdown' icon on on our sato
images work as expected for both sysvinit and systemd images. Previously,
the Exec field was 'halt'. The `halt' command could poweroff the system
in sysvinit images but it only could halt the system in systemd images.
The difference is due to the different implementations of the `halt' command.

In sysvinit, the `halt' command will effective execute `/sbin/init 0'. This
is for the compatibility with sysvinit 2.4, as stated in the comments of the
source code. In systemd, the `halt' command will effectively execute the
reboot(RB_HATL_SYSTEM).

As the 'shutdown' icon is expected to actually shutdown the system, we should
use poweroff instead of halt for its Exec field.

[YOCTO #4347]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../shutdown-desktop/shutdown.desktop              |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Otavio Salvador - Jan. 15, 2014, 11:38 a.m.
On Wed, Jan 15, 2014 at 5:10 AM, Chen Qi <Qi.Chen@windriver.com> wrote:

> Use 'poweroff' instead of 'halt' for the Exec field in the
> shutdown.desktop.
>
> The purpose of this patch is to make the 'shutdown' icon on on our sato
> images work as expected for both sysvinit and systemd images. Previously,
> the Exec field was 'halt'. The `halt' command could poweroff the system
> in sysvinit images but it only could halt the system in systemd images.
> The difference is due to the different implementations of the `halt'
> command.
>
> In sysvinit, the `halt' command will effective execute `/sbin/init 0'. This
> is for the compatibility with sysvinit 2.4, as stated in the comments of
> the
> source code. In systemd, the `halt' command will effectively execute the
> reboot(RB_HATL_SYSTEM).
>
> As the 'shutdown' icon is expected to actually shutdown the system, we
> should
> use poweroff instead of halt for its Exec field.
>
> [YOCTO #4347]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>

Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador - Jan. 15, 2014, 11:51 a.m.
On Wed, Jan 15, 2014 at 9:38 AM, Otavio Salvador <otavio@ossystems.com.br>wrote:

> RB_HATL_SYSTEM


typo in the commit log :) (Spot by Mario)
Richard Purdie - Jan. 15, 2014, 12:27 p.m.
On Wed, 2014-01-15 at 09:51 -0200, Otavio Salvador wrote:
> 
> On Wed, Jan 15, 2014 at 9:38 AM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>         RB_HATL_SYSTEM
> 
> typo in the commit log :) (Spot by Mario)
> 
I fixed this up as I merged it.

Cheers,

Richard

Patch

diff --git a/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop b/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
index 2726889..99bee4c 100644
--- a/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
+++ b/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
@@ -3,7 +3,7 @@  Encoding=UTF-8
 Type=Application
 Name=Shutdown
 Comment=Close down the machine safely
-Exec=halt
+Exec=poweroff
 Icon=system-shutdown
 Terminal=false
 Categories=Utility;