Automatic login as described in wiki isn't working, systemd

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Automatic login as described in wiki isn't working, systemd

Postby effemmeffe » Wed Jan 16, 2013 12:54 pm

I'm trying to setup Arch on my new Raspberry PI.
I want to use it to run XBMC, so I read the wiki article https://wiki.archlinux.org/index.php/Xbmc
I'm having a problem with the autostart at boot: I read https://wiki.archlinux.org/index.php/Au … al_console and did the modification proposed, but I'm having a problem: in my message.log I see this:
Jan 16 13:21:31 alarmpi systemd[1]: Starting Getty on tty1...
Jan 16 13:21:31 alarmpi systemd[1]: Started Getty on tty1.
Jan 16 13:21:52 alarmpi systemd[1]: autologin@tty1.service holdoff time over, scheduling restart.
Jan 16 13:21:52 alarmpi systemd[1]: Stopping Getty on tty1...

This is my autologin@.service file: http://pastebin.com/bQMVksxT

[root@alarmpi ~]# uname -a
Linux alarmpi 3.6.11-3-ARCH+ #1 PREEMPT Thu Jan 10 03:05:04 UTC 2013 armv6l GNU/Linux


What I'm doing wrong?
effemmeffe
 
Posts: 6
Joined: Tue Jan 15, 2013 12:43 pm

Re: Automatic login as described in wiki isn't working, syst

Postby Mikelevel » Wed Jan 16, 2013 2:11 pm

I tried autologin way...but finally i do this

Edit exectstart line...
# nano /usr/lib/systemd/system/getty@.service
ExecStart=-/sbin/agetty -a USER --noclear %I 38400

Edit .bash_profile
# nano /home/USER/.bash_profile
vt=$(fgconsole 2>/dev/null)
(( vt == 1 )) && exec xbmc-standalone -- vt$vt &> ~/.xlog
unset vt
Mikelevel
 
Posts: 5
Joined: Wed Jan 02, 2013 11:07 pm

Re: Automatic login as described in wiki isn't working, syst

Postby effemmeffe » Wed Jan 16, 2013 2:14 pm

sorry, what does the .bash_profile modification do?
I'm not expert enough to understand by myself.

And by doing that can you exit from XBMC and have the console?
effemmeffe
 
Posts: 6
Joined: Tue Jan 15, 2013 12:43 pm

Re: Automatic login as described in wiki isn't working, syst

Postby pepedog » Wed Jan 16, 2013 2:42 pm

So not auto login but start xbmc, yes?

I think this file is needed
/usr/lib/systemd/system/xbmc@.service
$this->bbcode_second_pass_code('', '[Unit]
Description = Starts instance of XBMC using xinit
After = remote-fs.target

[Service]
User = %I
Group = users
Type=oneshot
ExecStart=/usr/lib/systemd/scripts/xbmc-start
RemainAfterExit=yes

[Install]
WantedBy = multi-user.target')
and
/usr/lib/systemd/scripts/xbmc-start
$this->bbcode_second_pass_code('', '#!/bin/bash

LD_LIBRARY_PATH=/opt/vc/lib/ /usr/bin/xbmc')
Create a new user, eg adduser effem
now to start on boot
$this->bbcode_second_pass_code('', 'systemctl enable xbmc@effem')
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatic login as described in wiki isn't working, syst

Postby effemmeffe » Wed Jan 16, 2013 3:36 pm

pepedog, I read that your solution is deprecated: https://wiki.archlinux.org/index.php/Xb ... gh_systemd
effemmeffe
 
Posts: 6
Joined: Tue Jan 15, 2013 12:43 pm

Re: Automatic login as described in wiki isn't working, syst

Postby pepedog » Wed Jan 16, 2013 4:16 pm

I hadn't read all that, just created all that stuff from scratch for nothing, and tested it
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatic login as described in wiki isn't working, syst

Postby effemmeffe » Wed Jan 16, 2013 4:37 pm

pepedog, I tried your method even if deprecated and I can't get it work.
Or, to be more precise, I'm not sure it's working: I don't have my raspberry connected to a hdmi monitor and I'm connected to it via ssh.

I create the service:
$this->bbcode_second_pass_code('', '
[root@alarmpi ~]# cat /etc/systemd/system/xbmc@.service
[Unit]
Description = Starts instance of XBMC using xinit
After = remote-fs.target

[Service]
User = %I
Group = users
Type=oneshot
ExecStart=/usr/lib/systemd/scripts/xbmc-start
RemainAfterExit=yes

[Install]
WantedBy = multi-user.target
')

and launched:
$this->bbcode_second_pass_code('', '
[root@alarmpi ~]# ll /etc/systemd/system/multi-user.target.wants/|grep xbmc
lrwxrwxrwx 1 root root 33 Jan 16 2013 xbmc@xbmc.service -> /etc/systemd/system/xbmc@.service
')


After a reboot I get this error:
$this->bbcode_second_pass_code('', '
[root@alarmpi ~]# systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
xbmc@xbmc.service loaded failed failed Starts instance of XBMC using xinit
')


It seems that the service is not running.

The bash_profile of the user xbmc:
$this->bbcode_second_pass_code('', '
[root@alarmpi ~]# cat /home/xbmc/.bash_profile
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
')

Help?


--- Edit ---
PLEASE use code tag when using multiple fragments!
Last edited by WarheadsSE on Wed Jan 16, 2013 4:39 pm, edited 1 time in total.
Reason: adding code tags.
effemmeffe
 
Posts: 6
Joined: Tue Jan 15, 2013 12:43 pm

Re: Automatic login as described in wiki isn't working, syst

Postby pepedog » Wed Jan 16, 2013 4:59 pm

Why didn't you enable with?
systemctl enable xbmc@xbmc
and start with?
systemctl start xbmc@xbmc
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Automatic login as described in wiki isn't working, syst

Postby effemmeffe » Wed Jan 16, 2013 6:59 pm

Ok, sorry.
effemmeffe
 
Posts: 6
Joined: Tue Jan 15, 2013 12:43 pm

Re: Automatic login as described in wiki isn't working, syst

Postby pepedog » Wed Jan 16, 2013 7:13 pm

No problem, not having a go at you
Maybe someone can look at that other suggested way?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: Google [Bot] and 2 guests