Quote:
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
I'll give you the answer, only after you read this:
You want your control panel to be usable, right? Just imagine that your control panel is a Russian hacker. You want to only allow certain files to be started with the script, in certain directories. Permissions are key. If a Russian hacker managed to get control of your control panel (and done nasty things with it), the integrity and security of all of the users files is at risk - the Russian hacker might download gamemodes, or just simply delete every single server.
[ rename ]
|
fuckin racist'
anyways, ive already semi-answered this on xfire but i feel like going into depth.
you need to find the processid of the samp server when its started, and to record it (ie in a database), so that through a command later it could retrive the processid of the server and kill it using the linux command
kill [processid]
eh, also mlk you should note that you said your going to run these servers under your root account, thats going to screw with your system,
you want to create seperate ftp + user accounts for every customer on your box, and make sure they are set up to only have access to execute the samp02Xsvr file,
the ftp would be automatically chrooted if your using proftpd, the user accounts im not too sure of, but thats how industry control panels do it (ie swiftpanel), i'll try to see if i can find you something about the perm's that swiftpanel sets on the user accounts, i'll go digging in my box later today
update:
it seems that swiftpanel creates a seperate user and group for each customer/user on the box
theres a indepth listing on how users are created etc, on the swiftpanel forum site, but the main idea is that
when a panel like swiftpanel creates a new user account on the server, it runs this under root
Код:
useradd -d {homedir} -m {user}
wait...
passwd {user}
wait...
{password}
wait...
{password}
, it runs the game under the user account using this
Код:
screen -A -m -S {serverid}-{user}
wait...
{startline}
and it stops it using this, once again under the user account
Код:
kill -9 `screen -list | grep "{serverid}-{user}" | awk {'print $1'} | cut -d . -f1`
wait...
screen -wipe
i think the way swiftpanel kills it makes more sense, just incase you start 2 of the same process or something.
the seperate user accounts seems to make it easier,
and if i was coding a panel (hmm maybe thats a idea
![Tongue](images/smilies/razz.gif)
) this is the way i would go
btw, those references were taken from the swiftpanel forums, its iframed so i cant send you a direct link