Solved

Autostart

Posted on 2000-04-12
7
1,141 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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 150 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

708 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

15 Experts available now in Live!

Get 1:1 Help Now