Auto boot / auto login

Started by jim_butz, June 06, 2013, 07:38:03 PM

Previous topic - Next topic

jim_butz

Anyone have any success performing an auto boot / auto login using Arch Linux on the Olinuxino MAXI?

I would like to automatically launch my app on power up but there are 2 road blocks:

1 - login - how to login automatically either as root (security issue) or as a user
2 - automatically launch app - how to automatically launch my app - either as root or as a user

Every example I've seen with Arch Linux doesn't seem to apply to the ARM version of Arch Linux

Likewise with automatically launching an app - I can find some examples that run on Arch Linux but not the ARM branch.

I'm sure someone has figured this out - I've tried rc.local (although it's depricated) and the new examples I've found apply only to Arch Linux and not the ARM branch.

Any help is appreciated.

Thanks,

Jim

scout_3pm

I'm not sure what is the structure of the init process of Arch Linux, but you should be able to make a script in /etc/init.d/... and then with update-rc.d command to set it in which runlevels to start and stop :-)

As I'm mostly Debian user this is the most logical way I see

Here i found a topic that says this method should work https://bbs.archlinux.org/viewtopic.php?pid=271730 :-)

Good Luck !

jim_butz

I was able to accomplish my goal by creating a startup script that runs upon boot.  There was no need to login as the script starts up automatically.  Here are the details and the files you will need to create a successful startup script with Systemd.

Create your script file - /usr/bin/pystart.sh

#!/bin/sh -
cd /SerialNumber/Pystir_115200/
python2.7 PystirApp.py

Give it execute permission:

chmod +x pystart.sh

Create a service - /etc/systemd/system/pystart.service

[Unit]
Description=Pysterito Startup Script
Requires=netcfg.service
After=netcfg.service
After=network.service

[Service]
ExecStart=/usr/bin/pystart.sh

[Install]
WantedBy=multi-user.target


Reload, enable (for startup), start, and status the service:

systemctl --system daemon-reload
systemctl start pystart.service
systemctl enable pystart.service
systemctl status pystart.service


At the end of the day it turns out to not be that complicated - just a lot of trial and error on my part.

Hope that helps someone out.

Jim