You are not logged in.

#1 2012-09-17 14:35:57

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

[Solved] Poweroff reboots, and reboot reboots

I really wasn't quite sure where to put this, so feel free to move it where you please. 

I have recently noticed that when I try to poweroff my computer, it results in a reboot.  It does not make a difference what command I use, shutdown, systemctl poweroff, init, telinit, etc.  It appears as though it si going to shut down nicely.  Which I guess it actually does. 

My machine is a thinkpad, so the thinklight goes off, it pauses briefly and then lights back up and gets going again.  I noticed that this is different to a regular reboot.  Reboot also flashes the thinklight off, but it does not seem to pause for quite as long. 

I thought it might have something to do with systemd, so I took and unused space of my hard disk, and installed the base system.  It shut down fine, so I though I mist have fudged something.  So I continued with the install proceeding forward making a sytem as I normally would with X, a couple WM's, various programs.  It does not have everything that my normal install does, but it started not powering off again... so I really no longer think it is related to systemd.  It just so happened that it began shortly after I started using systemd.

I have tried to figure out ways to debug, but I think that anything that is occuring, is occuring after I am able to remount / rw and redirect dmesg into a file.  Doing that I compared a shutdown (poweroff) with a normal reboot, and I found no significnant differences.

I realize that this post really does not include much to go on, so I think that I am probably posting more to ask if others are experiencing this, and if so, do they know a way to start figuring out what is going on.

It is not really that big of an issue since I don't shutdown that often.  But I now know that it is something _within_ my installation that is doing it.  Any insight would be appreciated.

Thanks!

Last edited by WonderWoofy (2012-09-27 03:00:11)

Offline

#2 2012-09-17 16:07:28

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Poweroff reboots, and reboot reboots

Are you in the "power" and "wheel" group?

$ groups

Do you use some kind of login manager?

Post your ~/.xinitrc.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-09-17 17:05:46

Jacob
Member
Registered: 2005-03-19
Posts: 52

Re: [Solved] Poweroff reboots, and reboot reboots

Let's try something basic, if you issue the command as root:

shutdown -h now

What is the result?

Jacob

Offline

#4 2012-09-18 00:08:23

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Poweroff reboots, and reboot reboots

Sorry for the delay, workin and such.  I am part of the power and wheel group, I start X via xinit/startx.  Actually, like this:

 $ xinit i3 -- /usr/bin/X -nolisten tcp vt7 

My .xinitrc looks like so:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

DEFAULT=/usr/bin/i3

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

case $1 in

o*)
	exec ck-launch-session openbox-session
	;;
r*)
	exec ck-launch-session ratpoison
	;;
d*)
	exec ck-launch-session /usr/local/bin/startdwm
	;;
w*)
	exec ck-launch-session wmii 
	;;
i*)
	exec ck-launch-session i3
	;;
*)
	exec ck-launch-session $DEFAULT
	;;
esac

It does the same thing no matter how I shut down.  (ie. poweroff, shutdown -h now, systemctl poweroff).  I also am thinking this is not anything to do with consolekit because I tested from tty1-6 and the same thing happens.  So I dropped to the emergency.target, and the same thing happens. 

So it is not that it won't poweroff, but it just does not result in what i expect it to.  When I have a fresh install, and by that I mean just base & base-devel, maybe a couple other things I can't live without like vim, zsh, grml-zsh-config, completion, it does not do it.  I even tested with a very basic install of X (xorg-xinit, xorg-server, xorg-server-utils, i3, dmenu) and it worked just fine. 

It was somewhere between that point and continuing to make my install the way I like it that it stated happening again.  I decided that since I had gotten so far in my test install, I would move it to my normal partition so that I would have a cleaned up installation.  Even after the move (still pretty bare) it worked a-ok.


Edit: Capitalize the first letter for Dspider.

Last edited by WonderWoofy (2012-09-18 00:09:36)

Offline

#5 2012-09-18 05:58:48

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [Solved] Poweroff reboots, and reboot reboots

I think you need "dbus-launch" in there. Refer to each DE/WM wiki page for how to set up your ~/.xinitrc.

Example:

exec ck-launch-session dbus-launch openbox-session

And make sure "dbus" is on the DAEMONS line in /etc/rc.conf.

DAEMONS=(syslog-ng dbus ufw noip sshd crond alsa networkmanager)

Or probably not...

https://wiki.archlinux.org/index.php/D-Bus

The template for ~/.xinitrc (/etc/skel/.xinitrc) will do the same since it sources scripts in /etc/X11/xinit/xinitrc.d/, including 30-dbus.

Edit: Capitalize the first letter for Dspider.

big_smile

Don't do it for me; always try to make it as easy to read as you can. Readers shouldn't waste their time trying to decipher posts (because we're all doing this for free).

90% of the time if it starts in lowecase, chances are that it's written like shit. I don't even bother clicking those.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#6 2012-09-18 06:31:48

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Poweroff reboots, and reboot reboots

I know what you mean, I can't stand it when I open a thread and it is vague and written like a thirdgrader on mescaline...

In any case, I discovered that by taking falconindy's advice and creating a .xserverrc with the following in it:

#!/bin/bash

TTY=${TTY:-$(tty)}
TTY=${TTY#/dev/}

if [[ $TTY != tty* ]]; then
  printf '==> ERROR: invalid TTY\n' >&2
  exit 1
fi

printf -v vt 'vt%02d' "${TTY#tty}"

exec /usr/bin/X -nolisten tcp "$vt" "$@"

I can do away with the "ck-launch-session" and it will drop me into an authenticated shell automagically.  You can read about it here http://blog.falconindy.com/articles/bac … stemd.html . If you use xinit or startx, it is pretty awesome.

In any case, I don't think it has to do with consolekit or X in general because it does it whether or not I am in the graphical run level or not, URxvt or tty1 through tty6, even from the emergency.target (which is like telinit 1 from what I gather) it still does not shut down.

I have been using "systemctl halt" to shutdown.  Though I am only shutting down because this problem is kind of bugging me.  So like I said before, if you have any more ideas, I will gladly accept, but with the nature of *nix systems, if I never solve it, it won't be devistating to my computing existence. 

Makes me wonder what might happen if I boot into "init=/bin/bash" or "init=/bin/zsh"

Offline

#7 2012-09-18 06:39:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Poweroff reboots, and reboot reboots

That didn't work either... I really didn't think about the fact that shutting down depends on init to change to the necessary runlevel/target.  Silly me smile

Offline

#8 2012-09-23 08:07:30

Jacob
Member
Registered: 2005-03-19
Posts: 52

Re: [Solved] Poweroff reboots, and reboot reboots

Hmm... well if:  "shutdown -h now" still causes the laptop to reboot instead of shutdown you'll have to examine the following possibilites.

1.  Your thinkpad (not sure which model), maybe needs to be updated to the latest BIOS (to correct a faulty ACPI implementation).
2.  If your thinkpad does infact have the lastest BIOS, worm around the BIOS to see if there is a setting which would keep the unit "on", despite being given the shutdown message from Linux.  It could be a vague option in the BIOS, so really search around.  As well make note of which of the processors sleep states are enabled:  C2, C3, C4, DC4 etc.
3.  Check the power button on your laptop, that it isn't stuck down or partially down.  It should have a firm click to it when pressed and return itself to normal position when released.

I haven't seen a system that doesn't turn "off" when: "shutdown -h now" is issued as root, since pre-APM based systems, but even then the system would remain "on" with a message like:  It is now safe to turn off or restart.... But would not restart as you've mentioned.  This is why I suspect BIOS or power button as the issue.

I also assume you are using stock kernel...

Jacob

Offline

#9 2012-09-27 02:59:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Poweroff reboots, and reboot reboots

Thanks jacob, believe you me, I had already checked those things.  But after checking those things, I also checked to see if it would shutdown while running other OS's and sure enough, even the Arch live media let me shut down properly.  So I had determined it was definitely a problem with my install not a problem with my machine.

In any case, I am not sure what did it, but after the most recent update (I think, I stopped shutting down regularly to check) it works as expected.  Maybe it was systemd, but I am not certain of that since I cannot find anyone else who had this problem.  Though with the nature of Linux, maybe they just didn't notice.  So thanks to all who tried to help me out here.

Offline

#10 2012-09-27 22:20:21

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved] Poweroff reboots, and reboot reboots

Did you see the same problem on battery and on AC? There were a whole bunch of us at one point who could not poweroff while on battery. Instead, the machine would reboot. Worked fine on AC.

The issue you have sounds different in at least two ways. Yours isn't (presumably) specific to battery and it applies on a systemd set up. However, in case it is even vaguely useful or interesting, the work around I was using before switching to systemd was:

$ cat /etc/rc.d/functions.d/runtime-power-management-workaround 
# ref.: https://bbs.archlinux.org/viewtopic.php?id=133108

# A script to act as a workaround for the bug in the runtime power
# management module, which causes thinkpad laptops to restart after
# shutting down.

disable_power_management() {
  # Bus list for the runtime power management module. Probably shouldn't
  # touch this.
  buslist="pci i2c"

  for bus in $buslist; do
    for i in /sys/bus/$bus/devices/*/power/control; do
      echo on > $i
    done
  done
}

add_hook shutdown_poweroff disable_power_management

I assume this isn't getting triggered anymore but I do wonder if it was related in some way.

(The reason AC/battery was a feature of the issue I and others hand was that we were using laptop mode tools to switch power management on and off with switches of power source. So it wasn't the battery per se - it was that, on battery, our config was different. The above work around for which I was extremely grateful, allowed people to save power on battery and retain the ability to shut down. Details should be in the thread referenced in my copy of the script.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2012-09-27 23:05:22

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved] Poweroff reboots, and reboot reboots


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2012-09-28 01:08:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Poweroff reboots, and reboot reboots

You know, I do in fact have my power setting set to auto.  And I do not use laptop mode tools, so it was indeed doing it both with and without the a/c adapter.  I think that you have actually hit the nail on the head.  But with the most recent update it is solved anyway.  So in order to check I would have to downgrade.

I will keep this in mind if things regress.  Thanks cfr!

Offline

Board footer

Powered by FluxBB