• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Linux script

Hi i am installing linux on a laptop i want it to autologon as root when i start it then issue a command for partimage to restore a partition is this possible if so, how?

Thanks in advance
  • 3
  • 2
1 Solution
not sure if I understand....

You want the linux always autologin - that's clear (text or graphical interface?)
You want the linux always run partimage - on each login? Why?

Or maybe You need just do some job when linux starts(on root behalf). If so, You don't need any autologin feaure.
bryanchellenAuthor Commented:
Hi Yes autologin as root cool text logon, dont need graphical! IM using damn small linux!

Let me explain, i wont be using linux to actually use its doing a job! I wasnt it to start then logon then partimage to re-image the other partition (which will be windows that i have already imaged)

I am doing this as disaster recovery i have created a boot manager so everytime the laptop starts it starts windows but you can select DR! which boots this linux partition logos on re images the windows parititon and reboots! I know this is possbible with linux!

But im a newbie!

It has to be linux for security reasons!

UNfortunatelly unfamiliar with damn small.
But anyway - You should not autologin anyway.
create the script which would do the job(then reboots machine back), then start it from /etc/rc.d/rc.local file.
If this file does not exist, You can spawn the script straight from init
add (posibly at the end) following line

it means that in runlevels 2(multiuser witout net) and 3(multiuser, propably default) this script will be run as root straight from init.
to determine the default runlevel look for line like
id:3:initdefault: # which means 3 is the default

If You want to run the linux and not call the script - run in in single user(1).
bryanchellenAuthor Commented:
I take it it wont logon then it will just run the script and reboot? Thats good enough for me!!

ok ill try it but im very new to linux!

Thanks, ill let you know how i get on!
> ok ill try it but im very new to linux!
so first try very simple script, which just writes some file in /tmp directory.
Also, inside the script use full applications paths - eg. /usr/bin/grep
init does not sets PATH variable(or just /bin:/sbin).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now