Autostart

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
LVL 4
jbrugmanAsked:
Who is Participating?
 
kiffneyConnect With a Mentor Commented:
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
 
sbuehrleCommented:
Add the lines to /etc/rc.d/rc.local.

You can use any text you wish to edit this file.
0
 
fremsleyCommented:
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ReinierCommented:
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
 
jbrugmanAuthor Commented:
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
 
jbrugmanAuthor Commented:
Adjusted points from 100 to 150
0
 
jbrugmanAuthor Commented:
:-)))))))))) Exactly what i wanted !

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

All Courses

From novice to tech pro — start learning today.