Results 1 to 5 of 5
write the command to a script
give the run permission to the script and copy it to the /etc/init.d directory
make a symlink from /etc/rcX.d to the script in the ...
- 01-28-2007 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 42
Auto exec help!
1.write the command to a script
give the run permission to the script and copy it to the /etc/init.d directory
make a symlink from /etc/rcX.d to the script in the init directory
X means the runlevel
each symlinks have this format "S"or"K""ordinal number""name"
for example:
the script
Code:
#!/bin/sh routing command 1 routing command 2 exit 0
save it as routing
chmod 744 routing
cp routing /etc/init.d
the default runlevel is 2
ln -s /etc/init.d/routin /etc/rc2.d/S90routing
and its done
what is that? "give the run permission to the script"
2.
whats a symlink, and what is a runlevel?
3.
is "#!/bin/sh" something i have to use, or is it an example
- 01-28-2007 #2
1.
By default, new files have read/write permissions for the owner, and read permissions for the group and others. use chmod +x filename to give execute permissions to everyone. See sections 1, 2, 6, and 7 of this link for details about permissions. Also see the manpage for chmod.
2.
A symlink (symbolic link) is like a Windows shortcut--it points to another file. This is in contrast to a hard link, which is the name of a file. You'll see symlinks used a lot. The manpage for ln has syntas details.
A runlevel is a definition of system services that are to run. There are seven possible runlevels (numbered 0-6), two of which are reserved for reboot and shutdown (6 and 0, respectively). Of the other five, level 1 is typically used for single-user, non-networked mode; Debian treats levels 2 through 5 the same, putting the system into a full multi-user GUI desktop with networking. Other distros might have more customized runlevels. You can also customize levels 2-5 as you see fit. The Wikipedia entry has some good details on runlevels.
3.
'#!/bin/sh' is normally the first line of any shell script. It's not strictly needed (i.e., the script will execute without it), but it lets the system identify what kind of file it is. The line is usually written exactly like that, but you might also see some that specify a particular shell interpreter that has to be used with that script, such as /bin/csh or /bin/zsh.Stand up and be counted as a Linux user!
- 01-28-2007 #3Just Joined!
- Join Date
- Jan 2007
- Posts
- 42
i managed to get the routing stuff working
thanks for the help
Now i went on to step to and did the exact same thing but with an other command!
a command to run Half Life Dedicated Server, so i did all the same(only changed name on the files and command".
The command i used:
/home/myuser/sapps/hlds1/./hlds_boost -game cstrike +exec server.cfg .........
but it appears an error:
/home/myuser/sapps/hlds1/./hlds_boost: line 3: ./hlds_run: No such file or directory
Someone please help me
- 01-28-2007 #4
It looks like the hlds_boost script expects to find hlds_run in the same directory. Is hlds_run in the same directory as hlds_boost?
Stand up and be counted as a Linux user!
- 01-29-2007 #5Just Joined!
- Join Date
- Jan 2007
- Posts
- 42
yes, but if i try to run hlds_run there is another file it cant find...
Originally Posted by Zelmo


Reply With Quote
