You are not logged in.
Pages: 1
I'm trying to start a program from my webserver, I already got it working, but one of the commands is not executed. This is my suders file:
##
## User privilege specification
##
root ALL=(ALL) ALL
***** ALL=(ALL) NOPASSWD: ALL
http ALL=(css) NOPASSWD: /usr/bin/screen
This piece of code works:
<?php
system("sudo -u css /usr/bin/screen -dmS css /home/css/css/css/srcds_run -autoupdate -game cstrike +exec server.cfg +map de_nuke +maxplayers 12 +ip 192.168.0.150 +port 27015 &");
?>
And this one doesn't work:
<?php
system("sudo -u css /usr/bin/screen -dmS csgo /home/css/csgo/srcds_run -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_allclassic &");
?>
Output of auth.log
Jul 29 01:12:37 localhost sudo: http : TTY=unknown ; PWD=/home/css/public_html/extended ; USER=css ; COMMAND=/usr/bin/screen -dmS csgo /home/css/csgo/srcds_run -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_allclassic
But it's not running, while the first one does run, what's wrong? I already tried adding /home/css/csgo/srcds_run to the sudoers file but it didn't work.
Last edited by Ztjuh (2012-08-04 13:38:50)
Offline
Found the problem, I just had to change the working directory with the php function chdir() to the directory of where the executable is.
Offline
Pages: 1