LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-17-2004, 05:08 PM   #1
kingchaos
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Rep: Reputation: 0
Auto start with rc.local


Hi. I'm sure the answer to is could be found somwhere, but belive me.. I've tried.. SO plz help me out.

I've just installed Mandrake 10.0
And I got MOHAA running on it. (works fine)

But now I want the game to auto startup when I restart my box.

I far as I know the command should be placed in /etc/rc.d/rc.local

right?

The command for my MOHAA is: /home/user/MOHAA/mohaa_lnxded +exec smurfs.cfg

I droped that lin into rc.local but nothing happend. So I guess I did something wrong some place here. I dropped the line at the bottom of the rc.local.

This is my rc.local file:



############FILE START##############



#!/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.

[ -f /etc/sysconfig/system ] && source /etc/sysconfig/system
[ -f /etc/sysconfig/msec ] && source /etc/sysconfig/msec
[ -z "$SECURE_LEVEL" ] && SECURE_LEVEL=3
[ -f /etc/sysconfig/init ] && source /etc/sysconfig/init
if [ $SECURE_LEVEL -lt 4 ]; then
[ -z "$REWRITEISSUE" ] && REWRITEISSUE=rewrite
if [ $SECURE_LEVEL -lt 3 ]; then
[ -z "$REWRITEISSUENET" ] && REWRITEISSUENET=rewrite
fi
fi

SYSTEM=${SYSTEM=Mandrakelinux}

# Source functions
. /etc/init.d/functions

if [ "$REWRITEISSUE" = "rewrite" -a -f /etc/mandrake-release ]; then
R=$(cat /etc/mandrake-release)

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

NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
if [ "$NUMPROC" -gt "1" ]; then
SMP="$NUMPROC-processor "
[ "$NUMPROC" = "2" ] && \
SMP="Dual-processor "
if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
a="an"
else
a="a"
fi
fi

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

if [ -x /usr/bin/linux_logo ]; then
/usr/bin/linux_logo -c -n -f | sed -e 's|\\|\\\\|g' > /etc/issue
echo "" >> /etc/issue
else
> /etc/issue
fi
echo "$R" >> /etc/issue
echo "Kernel $(uname -r) on $a $SMP$(uname -m) / \l" >> /etc/issue

if [ "$REWRITEISSUENET" = "rewrite" ]; then
echo "Welcome to ${HOST}" > /etc/issue.net
echo "$R" >> /etc/issue.net
echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue.net
else
NAME="$SYSTEM"
gprintf "Welcome to %s\n" "$NAME" > /etc/issue.net
echo "-------------------------" >> /etc/issue.net
fi
else
if [ -f /etc/security/msec/issue.$SECURE_LEVEL ]; then
cat /etc/security/msec/issue.$SECURE_LEVEL > /etc/issue
elif [ -f /etc/security/msec/issue ]; then
cat /etc/security/msec/issue > /etc/issue
else
rm -f /etc/issue
fi
if [ -f /etc/security/msec/issue.net.$SECURE_LEVEL ]; then
cat /etc/security/msec/issue.net.$SECURE_LEVEL > /etc/issue.net
elif [ -f /etc/security/msec/issue.net ]; then
cat /etc/security/msec/issue.net > /etc/issue.net
else
rm -f /etc/issue.net
fi
fi

touch /var/lock/subsys/local

/home/king/MOHAA/mohaa_lnxded +exec server.cfg



##########END OF FILE##########


PLZ HELP

King
 
Old 09-17-2004, 10:30 PM   #2
rahmed
Member
 
Registered: Feb 2004
Location: somewhere over the rainbow...
Distribution: Slackware 10.1
Posts: 166

Rep: Reputation: 30
well, in your description of the probelm above, you said the command was /home/...../ .... smurfs.cfg but in the rc.local, instead of smurfs.cfg, you have server.cfg
maybe that's the problem. the command is wrong in the rc.local. or maybe it was just a typo. and in my rc.local, i put all commands at the very top, not the bottom.
 
Old 09-18-2004, 06:20 AM   #3
kingchaos
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Typo is here at the forum. lol

Thx for quick reply.

Butl.. The typo is here and not in my command line..


I've tried put it in the top of the rc.local instead. But nothing happens.. KDE starts up but not the MOHAA. And no error msg... Is there away to find out if theres any errors..?? And am I in the right file??

And another strange thing that happens: I start the /home/../../..mohaa-lnxded, and the server is running just fine. But if I restart the box or shuts down the prog, I can't start it again. I just get a Permssion denide. And if I check the permissions of the file it is read only and I can't change it. So I have to paste a copy of the file into the folder and override the old one. Then I can start it again..


Last edited by kingchaos; 09-18-2004 at 09:01 AM.
 
Old 09-18-2004, 09:56 AM   #4
kingchaos
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Found out about the second prob. Wrong chmod of the file.. But still can't make it autostart.

PS: The prog runs in console

King
 
Old 09-18-2004, 10:17 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,597

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Quote:
/home/user/MOHAA/mohaa_lnxded +exec smurfs.cfg
Try to use the full path to smurfs.cfg and see if this solves your problem.

Last edited by bathory; 09-18-2004 at 10:18 AM.
 
Old 09-18-2004, 10:30 AM   #6
kingchaos
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by bathory
Try to use the full path to smurfs.cfg and see if this solves your problem.
It is the mohaa-lnxded that is the prog that should start. And that file needs the config file. That config file is just a config for the game. So I can use just the /home/user/MOHAA/mohaa_lnxded to start the prog.
 
Old 09-18-2004, 03:01 PM   #7
rahmed
Member
 
Registered: Feb 2004
Location: somewhere over the rainbow...
Distribution: Slackware 10.1
Posts: 166

Rep: Reputation: 30
when you start up mandrake, try booting in verbose mode and see if there's an error near the end of bootup related to starting mohaa.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I auto start modules that aren't auto loaded on boot? darkbluedrew Debian 2 09-18-2005 10:10 AM
eth0 Auto Connect, How to auto start on logon cornish Linux - Networking 2 05-09-2005 01:02 PM
GAIM does not auto start phillips321 Linux - Software 3 01-24-2005 08:03 PM
auto start up Daz_Man2803 Linux - Newbie 1 06-14-2004 03:32 PM
Auto Start eggoz Linux - General 1 03-21-2003 10:10 PM


All times are GMT -5. The time now is 02:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration