Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Autostart

Posted on 2000-04-12
7
Medium Priority
?
1,180 Views
Last Modified: 2010-08-05
Like in autoexec.bat from dos,
i'd like to know, how i put the following lines in a similar file from linux.
please explain exactly what to do,
I'm using redhat 6.0
dual boot (NT and Linux with lilo)

the lines that should be automatically loaded are:

ipx_configure --autointerface=on
ipx_configure --autoprimary=on
ncpmount -S servername -U username -P password /mnt/novell -b -c owneroftheconnection

ps, i'd like to edit the particular file with mc, and not the linux.conf editor from X.

Thanks,
Justus
0
Comment
Question by:jbrugman
7 Comments
 
LVL 1

Expert Comment

by:sbuehrle
ID: 2707740
Add the lines to /etc/rc.d/rc.local.

You can use any text you wish to edit this file.
0
 
LVL 2

Expert Comment

by:fremsley
ID: 2707741
The files to put in such start-up commands depend on whether they should be executed on system start-up (like autoexec.bat), or each time a user logs in.

  - user login: ~/.profile
  - system startup: distribution dependent

For a SuSE (I think RH is quite simular) you could use /etc/rc.d/boot or preferred /etc/rc.d/boot.local. A better place might be the runlevel configuration (usually at /etc/rc.d or /sbin/init.d). Those contain scripts that are called with parameters like 'start', 'stop', 'restart', ... to start/stop services when going from one runlevel to another. To actually activate one of them you need to make a link in the corresponding sub-directory (e.g. rc3.d for runlevel 3). Take a look at the directory listing: the first characters of the link describe in which order those files are executed (e.g. S10... will start a service prior to S11..., K10... will stop (kill) a service prior to K11...).

0
 
LVL 2

Expert Comment

by:Reinier
ID: 2707804
If you insist on using mc, then take a look in

/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifup-ipx
/etc/rc.d/init.d/network

Everything you want to do, except the ncpmount, is there already. You only have to add the right parameters to the first two files above.

Linuxconf does this for you. Linuxconf will run in text mode if no DISPLAY variable is set.

I would add the ncpmount line to "/etc/rc.d/rc.local".
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 4

Author Comment

by:jbrugman
ID: 2708017
sorry did not get it to work.

I'm not understanding the script-file

i added the lines in the file, that now looks like:

#!/bin/sh

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

if [ -f /etc/redhat-release ]; then
    R=$(cat /etc/redhat-release)

    arch=$(uname -m)
    a="a"
    case "_$arch" in
            _a*) a="an";;
            _i*) a="an";;

 esac

    # This will overwrite /etc/issue at every boot.  So, make any changes you
    # want to make to /etc/issue here or you will lose them when you reboot.
    echo "" > /etc/issue
    echo "$R" >> /etc/issue
    echo "Kernel $(uname -r) on $a $(uname -m)" >> /etc/issue

    cp -f /etc/issue /etc/issue.net
    echo >> /etc/issue

ipx_configure auto_interface=on
ipx_configure auto_primary=on
ncpmount -S HAB_FILE_SERVER - U Justus -P ******** /mnt/novell -b -c Justus
   
fi


But no luck yet,
Please help.
0
 
LVL 4

Author Comment

by:jbrugman
ID: 2708143
Adjusted points from 100 to 150
0
 
LVL 4

Accepted Solution

by:
kiffney earned 600 total points
ID: 2708211
1.  Move the lines you added to rc.local just AFTER the 'fi'.  Right now they are only run if the conditions in the case command are met and while that may be always true, if you want the commands run unconditionally, they should not be inside a 'if - fi' conditional.

2.  You don't need two ipx_configure lines, and you're missing a few punctuation marks.  The line should read like this:

/sbin/ipx_configure --auto_primary=on --auto_interface=on

3.  It takes a minute for the ipx module to discover the networks and routes, etc.   You might want to put a 'sleep 30' statement on the line after the ipx_configure command.

4. rework your ncpmount line to put the mount point at the end of the line - it should end with /mnt/novell.  In general test your script commands from the command line and make sure they work there before using them in the script.

5.  If this still doesn't work, it may be that other scripts are setting up ipx interfaces in a way that isn't working with what you want to do.  In that case try changing the ipx_configure line to

/sbin/ipx_interface delall && /sbin/ipx_configure --auto_primary=on --auto_interface=on

The && means, run the first command and if it's successful run the second command.  This would delete any wrongly configured interfaces first.

I also like to put the full path to the commands in the script command line - i.e., use /sbin/ipx_configure instead of just ipx_configure.  Probably doesn't make any real difference except to the paranoid.
0
 
LVL 4

Author Comment

by:jbrugman
ID: 2708414
:-)))))))))) Exactly what i wanted !

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

927 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