Solved

Autostart

Posted on 2000-04-12
7
1,159 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
centos commands 6 89
linux SFTP 8 76
EXCHANGE. LINUX, SYMANTEC MESSAGING GATEWAY 2 49
CentOS 7 Linux for HP DL380 G4 32Bits 7 73
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

740 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