Start up scripting and auto login for stand alone linux box
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Start up scripting and auto login for stand alone linux box
I am doing a project where I will be running a very stripped down linux in order to get a quick boot and run a task. Basically the box will power on, boot to command line, record video from a webcam and shutdown when the video is recorded. My question is can I do this using start up script and will I need to configure some sort of automatic login? I'm looking to use a real quick distro like archlinux or some other streamlined distro as a base.
You can make programs run at each boot, at each logon (of 1 or more or even all users), at pre-defined times (via "cron"), at 1 specific time in the future ("at" command) etc.
Programs that are started at each boot mostly are called "services" or "daemons". Examples are ftp server program (ie vsftpd), web server program (ie httpd), ...
These programs don't support any user interaction typically.
There are also different "runlevels" defined. This allows you for instance to run programs only when booting into a "graphical" mode, or when booting to a text-only mode, etc. For more info on this, check out:
man service
man chkconfig
the scripts in /etc/init.d, /etc/rc.d, etc
So it depends really on what you want and on how the program works.
Also I forgot to ask another related question. Does the system even need a user logged on to run a program like the webcam capture in a script?
Not physically but all processes are run as some type of account. This is why Linux has accounts like nobody that don't have physical login access but processes like apache run as the user nobody, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.