Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Autostart

Posted on 2000-04-12
7
Medium Priority
?
1,175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

670 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