Linux script

Posted on 2006-05-21
Last Modified: 2010-04-20
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
Question by:bryanchellen
    LVL 43

    Expert Comment

    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.

    Author Comment

    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!

    LVL 43

    Expert Comment

    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).

    Author Comment

    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!
    LVL 43

    Accepted Solution

    > 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).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now