Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
trying to automate the startup
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
pabloblo
n00b
n00b


Joined: 24 Jan 2024
Posts: 60

PostPosted: Sun Jun 02, 2024 10:41 pm    Post subject: trying to automate the startup Reply with quote

hello all,
currently the computer works, however each time I start, I am on the command line, I indicate startxfce4 and everything works, I am looking for a way to automate it because lightdm does not work
Back to top
View user's profile Send private message
wless123
n00b
n00b


Joined: 27 Aug 2021
Posts: 40

PostPosted: Sun Jun 02, 2024 10:58 pm    Post subject: Reply with quote

Not sure why lightdm does not work, but i'm using this oneliner in my ~/.bashrc

Code:

[[ "$(tty)" == "/dev/tty1" ]] && startxfce4 && exit


In short: login from tty1 => startxfce => logout when X is closed
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22420

PostPosted: Sun Jun 02, 2024 11:16 pm    Post subject: Reply with quote

Doesn't that cause the user login to remain behind if startxfce4 fails, or is interrupted by a SIGINT?
Back to top
View user's profile Send private message
pabloblo
n00b
n00b


Joined: 24 Jan 2024
Posts: 60

PostPosted: Sun Jun 02, 2024 11:24 pm    Post subject: Reply with quote

hello wless
I tried the solution you gave, it works indeed, you have to type the login and password in the shell and after it opens, I was wondering if it was possible to have a login screen
Back to top
View user's profile Send private message
wless123
n00b
n00b


Joined: 27 Aug 2021
Posts: 40

PostPosted: Mon Jun 03, 2024 12:18 am    Post subject: Reply with quote

Quote:

[...]
I was wondering if it was possible to have a login screen


That's what lightdm and other are for.

Have you read the wiki?
https://wiki.gentoo.org/wiki/LightDM
Back to top
View user's profile Send private message
wless123
n00b
n00b


Joined: 27 Aug 2021
Posts: 40

PostPosted: Mon Jun 03, 2024 12:19 am    Post subject: Reply with quote

Hu wrote:
Doesn't that cause the user login to remain behind if startxfce4 fails, [...]


Yes ofc, but that's on purpose ;) You'll have a shell.

[EDIT]

And now as you remind me, there was another issue with re-login.
I had to alter my /etc/inittab and add at the end (comment everything else for tty1):

Code:

a1:2345:bootwait:/sbin/agetty -a <user> -n 38400 tty1 linux                                                                                                             
c1:2345:respawn:/sbin/agetty 38400 tty1 linux


This is for autologin on first boot and automates the login for X with my ~/.bashrc too. I'm using encrypted fs so there is no harm in auto-login.

[EDIT 2]:
Better use
Code:

a1:2345:wait:/sbin/agetty -a <user> -n 38400 tty1 linux                                                                                                             
c1:2345:respawn:/sbin/agetty 38400 tty1 linux

Also i've noticed on that way that i had only one tty with the "bootwait" parameter. for tty1. Changing it to just "wait" solved that issue too.


Last edited by wless123 on Mon Jun 03, 2024 7:01 pm; edited 2 times in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22420

PostPosted: Mon Jun 03, 2024 12:54 am    Post subject: Reply with quote

Is your system physically secure? With the mechanism you showed, I think anyone who can reach the keyboard can vt-switch to tty1, ^C out of the X session, and be left with a shell logged in as you. No password is required to do this.
Back to top
View user's profile Send private message
pabloblo
n00b
n00b


Joined: 24 Jan 2024
Posts: 60

PostPosted: Mon Jun 03, 2024 1:23 am    Post subject: Reply with quote

wless123 wrote:
Quote:

[...]
I was wondering if it was possible to have a login screen


That's what lightdm and other are for.

Have you read the wiki?
https://wiki.gentoo.org/wiki/LightDM


yes i follow the tutorial but no results
Back to top
View user's profile Send private message
wless123
n00b
n00b


Joined: 27 Aug 2021
Posts: 40

PostPosted: Mon Jun 03, 2024 6:59 pm    Post subject: Reply with quote

Hu wrote:
Is your system physically secure? With the mechanism you showed, I think anyone who can reach the keyboard can vt-switch to tty1, ^C out of the X session, and be left with a shell logged in as you. No password is required to do this.


Found the time to check it and sent a SIGINT (and a SIGKILL) to the X-Server and the session was closed properly. I had to relog to gain access again.
Also i've noticed on that way that i had only one tty with the "bootwait" parameter. for tty1. Changing it to just "wait" solved that issue too.
I modified the post too.

[EDIT]
Tried also Magic SysRq key + K with the same result, a new login tty.
Back to top
View user's profile Send private message
pabloblo
n00b
n00b


Joined: 24 Jan 2024
Posts: 60

PostPosted: Tue Jun 04, 2024 2:30 pm    Post subject: Reply with quote

I'm trying to repair lightdm but it's not working
error: unexpectedly disconnected from boot status daemon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum