You are not logged in.

#1 2012-11-15 08:08:46

Registered: 2012-11-15
Posts: 2

Systemd troubles (kexec, autologin)

So I'm finally making the switch to systemd and am trying to wrap my head around all the unnecessary and frustrating complexity of the thing.

Alright. I'm successfully booting with systemd and followed the instructions on automatically logging in to a virtual console and Kexec.

My problem with kexec:

I can reboot/shutdown just fine by issuing "systemctl reboot" or "systemctl shutdown" but when I try to do a kexec reboot with "systemctl kexec", all I get is "Failed to issue method call: Access denied" and it doesn't work without sudo. Any way to get systemd+kexec working for regular users?

My problems with automatic login:

I used to have this setup in my inittab:

c2:2345:respawn:/sbin/mingetty tty2 linux
c3:2345:respawn:/sbin/mingetty tty3 linux
c4:2345:respawn:/sbin/mingetty tty4 linux
c5:2345:respawn:/sbin/mingetty tty5 linux
c6:2345:respawn:/sbin/mingetty tty6 linux
a1:2345:wait:/sbin/mingetty --autologin USERNAME tty1 linux
c1:2345:respawn:/sbin/mingetty tty1 linux

Is there any way to do the same with systemd? Following the instructions on the wiki, when I kill X and log out of tty1, it automatically logs me in again every time. Is there any way to get it to autologin only once after boot?
Also, does systemd use agetty or mingetty? I'd like to use mingetty for every tty, how do I achieve that?


Another autologin issue:

With sysV, I used to start X via my .bash_profile like so:

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
  echo XXXXXXXXXXXXXX $(runlevel)
  if [[ "$(runlevel | awk '{print $2}')" -eq 5 ]]; then
    setsid startx &> /dev/null

With systemd, it appears that sometimes the runlevel isn't yet set to 5 (runlevel is unknown) when bash_profile is executed, so X doesn't start. Are runlevels deprecated under systemd? How should I handle this instead?

Last edited by fufufu (2012-11-15 09:32:47)


#2 2012-11-15 21:56:39

Registered: 2012-11-15
Posts: 2

Re: Systemd troubles (kexec, autologin)

Alright, so runlevels are a sysV thing. Being able to just add a 3 or 1 to the kernel command line during boot was much more convenient than having to add "". (Oops, appending a 3 or 1 still seems to work with systemd.)
So, apparently, the only way to reliably check what target systemd is booting into would be to do something like this?

if [[ "$(systemctl list-units --type=target | grep graphical)" ]]; then

Does anyone have any tips on the other issues I mentioned?

Last edited by fufufu (2012-11-15 22:17:53)


#3 2012-11-15 22:50:45

From: Germany
Registered: 2011-01-26
Posts: 663

Re: Systemd troubles (kexec, autologin)

systemctl doesn't allow kexec as a normal user. And since there is no polkit action for kexec which you could overwrite with a polkit rule I guess you will have to use sudo with NOPASSWD.

$ pkaction | grep kexec


Board footer

Powered by FluxBB