Auto login and `startx` without a display manager -- jessie

Share your own howto's etc. Not for support questions!

Re: Auto login and `startx` without a display manager -- jes

Postby Head_on_a_Stick » 2015-07-18 18:51

Good stuff, glad you got it working :)

I'll edit the OP to reflect your very useful feedback -- thanks!
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Auto login and `startx` without a display manager -- jes

Postby Nili » 2015-07-21 13:12

Heya there Head_on_a_Stick!!!

Good to be back, i was without system for 48h, during this time i fixed my mess :evil: mixing lenny with jessie :oops: let me outside.
...so glad to be back without formating :D

Ok lets go back right to question.

Perhaps you have posted somewhere, if so please guide me... Thank you.

ls -l /etc/systemd/system/getty.target.wants
Code: Select all
total 0
lrwxrwxrwx 1 root root 34 Jul 19 15:01 getty@tty1.service -> /lib/systemd/system/getty@.service


I think you know what i am looking for, an automatic login for one tty (tty1 precise) and an auto startx from /home/nili/.profile

Using this code
Code: Select all
    ExecStart=-/sbin/agetty -a <user name> %I $TERM

it's ok but log me in on both ttys 1&2. Let fix this first then checkup auto startx
nili ~ $ _
If it ain't broke, tweak it at least
emilie ~ $ _
The world is full of singers, We don't need anymore
---
This made my day, Thanks for the smile HL :)
HuangLao wrote:Now its solved... P.S. this could also be the image of systemd development
User avatar
Nili
 
Posts: 254
Joined: 2014-04-30 14:04
Location: /home/nili/music

Re: Auto login and `startx` without a display manager -- jes

Postby Head_on_a_Stick » 2015-07-21 19:06

@Nili -- I think this may be a systemd bug.

AFAIU, the getty@tty1.service should *only* run for TTY1 but clearly this isn't happening.

On both my Arch & Debian systems, autologin is set for *all* TTYs

Does your system do this or is it only for TTYs 1&2?

Please post the output of:
Code: Select all
ls -lR /etc/systemd/system | grep -i tty
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Auto login and `startx` without a display manager -- jes

Postby Nili » 2015-07-21 19:32

Then it may be such as you explain, perhaps a systemd issue. I have read and tried many ways during these days but none succeeded.
At the moment have turned off autologin, i'm only proceeding with auto startx this time. I really don't want to have many logged my username on other terminals.

I have two tty because... if you remember a thread and a chat that we have done therefore I have two because i choosed to use two tty.

Concretely, i have actived NAutoVTs=2 from "/etc/systemd/logind.conf" that reduces tty usages, so i chosed number 2.

Code: Select all
[Login]
NAutoVTs=2
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes


I can test with more tty numbers, I believe that will be the same will autolog on every tty actived...
I will do a test tomorrow because today I have no more time sorry.

the output
nili@debian:~$ ls -lR /etc/systemd/system | grep -i tty
Code: Select all
drwxr-xr-x 2 root root 4096 Jul 19 15:01 getty.target.wants
/etc/systemd/system/getty.target.wants:
lrwxrwxrwx 1 root root 34 Jul 19 15:01 getty@tty1.service -> /lib/systemd/system/getty@.service
nili ~ $ _
If it ain't broke, tweak it at least
emilie ~ $ _
The world is full of singers, We don't need anymore
---
This made my day, Thanks for the smile HL :)
HuangLao wrote:Now its solved... P.S. this could also be the image of systemd development
User avatar
Nili
 
Posts: 254
Joined: 2014-04-30 14:04
Location: /home/nili/music

Re: Auto login and `startx` without a display manager -- jes

Postby Head_on_a_Stick » 2015-07-21 19:38

Nili wrote:if you remember a thread and a chat that we have done therefore I have two because i choosed to use two tty.

From that thread:
I wrote:Disabling TTYs via /etc/logind.conf saves *no resources whatsoever*

The only TTY that is spawned at boot is TTY1, the other TTYs are spawned on demand -- ie, they do not exist until you switch to them.

Unless you want a TTY for root login there really is no harm having autologin on all TTYs; it certainly doesn't use up any extra resources.
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Auto login and `startx` without a display manager -- jes

Postby Nili » 2015-07-21 19:52

Head_on_a_Stick wrote:From that thread:
I wrote:Disabling TTYs via /etc/logind.conf saves *no resources whatsoever*

Indeed there isn't any big memory benefits, simply an unnecessary fixation by my side :lol: I can bring back again as it was.

TTY1 = startx@WM || TTY2 = a backup console. This has been my goal. oK i'll leave so... manually auto login, automatically startx.
nili ~ $ _
If it ain't broke, tweak it at least
emilie ~ $ _
The world is full of singers, We don't need anymore
---
This made my day, Thanks for the smile HL :)
HuangLao wrote:Now its solved... P.S. this could also be the image of systemd development
User avatar
Nili
 
Posts: 254
Joined: 2014-04-30 14:04
Location: /home/nili/music

Re: Auto login and `startx` without a display manager -- jes

Postby mzsade » 2015-07-22 03:05

Had mentioned somewhere i'd done a full install of Jessie on a 32 GB pen drive. Well, i tried this out on that.. cut the boot time by more than half, now i get what you meant by lightdm bloat, thank YOU!
Linux User #481272 Reg: 15th Sept., 2008
User avatar
mzsade
 
Posts: 91
Joined: 2011-12-08 01:25

Re: Auto login and `startx` without a display manager -- jes

Postby milomak » 2016-03-23 21:36

instead of startx, how can i get kodi to run?
iMac - MacOS and Windows 10 (Bootcamp)/ Debian Sid (External SSD)
Laptop (64-bit) - Debian Sid, Win10,
Kodi Box - Debian Sid
milomak
 
Posts: 1646
Joined: 2009-06-09 22:20

Re: Auto login and `startx` without a display manager -- jes

Postby Head_on_a_Stick » 2016-03-23 21:37

Code: Select all
startx `which kodi`

Or quote the full path to the binary explicitly ;)
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Auto login and `startx` without a display manager -- jes

Postby milomak » 2016-03-23 22:19

like this?

Code: Select all
mythtv ~ # cat /etc/systemd/system/getty.target.wants/getty@tty1.service | grep ExecStart
ExecStart=-/sbin/agetty -a mythtv %I $TERM


Code: Select all
mythtv@mythtv:~$ cat ~/.profile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx 'which /usr/bin/kodi'
iMac - MacOS and Windows 10 (Bootcamp)/ Debian Sid (External SSD)
Laptop (64-bit) - Debian Sid, Win10,
Kodi Box - Debian Sid
milomak
 
Posts: 1646
Joined: 2009-06-09 22:20

Re: Auto login and `startx` without a display manager -- jes

Postby Head_on_a_Stick » 2016-03-24 05:31

milomak wrote:like this?
[...]
Code: Select all
mythtv@mythtv:~$ cat ~/.profile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx 'which /usr/bin/kodi'

Not quite, try:
Code: Select all
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx /usr/bin/kodi
“Controlling complexity is the essence of computer programming."Brian Kernighan

Please read before posting How to report a problem
User avatar
Head_on_a_Stick
 
Posts: 6491
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Auto login and `startx` without a display manager -- jes

Postby ralph.ronnquist » 2016-03-24 09:13

.. or maybe
Code: Select all
[[ -z $DISPLAY -a $XDG_VTNR -eq 1 ]] && exec startx /usr/bin/kodi
User avatar
ralph.ronnquist
 
Posts: 298
Joined: 2015-12-19 01:07
Location: Melbourne, Australia

Re: Auto login and `startx` without a display manager -- jes

Postby milomak » 2016-03-30 18:54

Head_on_a_Stick wrote:
milomak wrote:like this?
[...]
Code: Select all
mythtv@mythtv:~$ cat ~/.profile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx 'which /usr/bin/kodi'

Not quite, try:
Code: Select all
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx /usr/bin/kodi


this worked. thanks
iMac - MacOS and Windows 10 (Bootcamp)/ Debian Sid (External SSD)
Laptop (64-bit) - Debian Sid, Win10,
Kodi Box - Debian Sid
milomak
 
Posts: 1646
Joined: 2009-06-09 22:20

Re: Auto login and `startx` without a display manager -- jes

Postby lachlanp » 2016-05-09 12:21

The topic is old and I have a slightly different need.

I have a touch display but no keyboard. I want to autologin and auto-run a gui based program built with QT

As suggested I have edited: /etc/systemd/system/getty.target.wants/ ... y1.service to this:
ExecStart=-/sbin/agetty -a myname %I $TERM

As I still want to use the default gui console, I have not made any other changes.

However, I still get the login prompt on my default defaultgui display.

Can you suggest what I still need to change to get the auto-login

Regards
Lachlan
lachlanp
 
Posts: 2
Joined: 2016-05-09 12:07

Re: Auto login and `startx` without a display manager -- jes

Postby GarryRicketson » 2016-05-09 12:41

I noticed this :
Docs, Howtos, Tips & Tricks
Share your own howto's etc. Not for support questions!

Is what it says , on the board/ topic title , and then :
Post by lachlanp » 2016-05-09 06:21
The topic is old and I have a slightly different need.

It seems that the logical conclusion would be to start a new topic, in the "support" discussions.
User avatar
GarryRicketson
 
Posts: 3982
Joined: 2015-01-20 22:16
Location: Durango, Mexico

PreviousNext

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable