LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-25-2006, 09:50 AM   #1
sl4ckw4re
Member
 
Registered: Jul 2006
Distribution: Slackware 10.2
Posts: 31

Rep: Reputation: 15
run cstrike server from rc.local as 'root'


Hello. I'm running a fresh installed Slackware 11.0 with a custom compiled 2.6.18 kernel as a Counter-Strike server. This here is the command for starting the server
Code:
cd /usr/hlds && screen -A -m -d -S hlds ./hlds_run -game cstrike +ip 89.136.239.245 +sv_lan 1 -nomaster +maxplayers 22 +map de_dust2
and then use screen -r hlds to connect to it using screen whenever I have the need. If I execute the above command after my system boots up and log in as 'root' everything works ok and I can attach to the screen. But if I add these lines to /etc/rc.d/rc.local the server starts indeed but when I try to run screen -r hlds it doesn't find the hlds screen to attach to. I think this is because from rc.local the command is not run correctly (meaning it is not run as root, or something like that). So my question is, how can I run that command from rc.local under root credentials like I would had started it from the command line while logged in as root account ? I hope I've made myself clear, if not I'll try again . Thank you.
 
Old 10-25-2006, 10:01 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105
I think you should use:
Code:
su - root -c "cd /usr/hlds && screen -A -m -d -S hlds ./hlds_run -game cstrike +ip 89.136.239.245 +sv_lan 1 -nomaster +maxplayers 22 +map de_dust2"
if you want to run this from rc.local.

Eric
 
  


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
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
suse 10 64bit hlds cstrike mll Linux - Games 0 01-12-2006 04:18 AM
run vnc-server as other user in rc.local jvdbossc Linux - Newbie 2 05-26-2004 02:10 AM
no access for root on X-server (local) Li... Debian 11 02-16-2004 06:01 PM
Unable to run webpage on local server using ip in the url MakingOfAGeek Linux - Newbie 16 11-15-2003 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:19 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
Open Source Consulting | Domain Registration