[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • 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
0
bryanchellen
Asked:
bryanchellen
  • 3
  • 2
1 Solution
 
ravenplCommented:
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.
0
 
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!


Thansk
0
 
ravenplCommented:
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
/etc/initab
add (posibly at the end) following line
pi:23:wait:/path/to/script

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).
0
 
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!
0
 
ravenplCommented:
> 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).
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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