You are not logged in.

#1 2012-10-12 22:42:18

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

autologin "only at boot" with systemd

I've moved to systemd, and it all went well. Thanks for the good documentation.

I autologin, using the systemd unit described on the wiki page, and then use .bash_profile to launch startx.

With inittab, I could use a "respawn" entry on the same tty to ensure that it only happened on boot. How can I do the same thing with systemd?

https://wiki.archlinux.org/index.php/Au … ing_agetty

Obviously "exec startx" results in a .bash_profile loop, while "startx" on its own drops me back to my shell prompt, but I can't log out -- logging out just runs the service, loads .bash_profile and away it goes again. I've played with trying to put systemctl commands in the system-wide bash.bash_logout, but that doesn't seem to work.

I've tried setting the unit to "Restart=no" but that just results in an empty (blinking cursor) vt.

Thanks for any hints.

Offline

#2 2012-10-12 22:46:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: autologin "only at boot" with systemd

You DO want the tty to restart don't you?  You just don't want to restart X ... right?

If so, this would have nothing to do with systemd, this would all be from your bashrc/bash_profile.

For the inittab reference, do you mean you replaced "respawn" with "once"?

Last edited by Trilby (2012-10-12 22:47:06)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2012-10-12 23:00:20

progandy
Member
Registered: 2012-05-17
Posts: 5,307

Re: autologin "only at boot" with systemd

I suppose that conditions are not possible with pure systemd. You'll have to run a batch-script that checks for respawn (maybe store the state in /run) and then execs getty.
Edit: I have another idea: Keep the default settings and additionally run a service with respawn=once for that specific tty. When the tty is already occupied the socket activation will not trigger the default agetty, but after you have closed the autologin shell the tty should be free again and socket activation will occur.

Last edited by progandy (2012-10-12 23:10:17)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB