Page 2 of 5

Re: ManiaLive r2028

Posted: 31 Jan 2011, 10:34
by farfa
Jojo_44 wrote:Ok thank you.

regards, Jojo

Edit:
The problem is that only the root can access to the start-stop-daemon. A normal user can´t use the start-stop-daemon and i will not run the script as root ;) The problem occurs on all linux debian systems ...

regards, Jojo
You can run the script as a root, but you have to put the following option

Code: Select all

--chuid username
It change the run user before starting the script, see the man page: http://man.cx/start-stop-daemon(8)

Re: ManiaLive r2028

Posted: 31 Jan 2011, 10:53
by Knutselmaaster
Thanks! I was searching for a solution everywhere 8-)

Re: ManiaLive r2028

Posted: 01 Feb 2011, 08:36
by nocturne
How about the majority of us not on Debian..? Compiling s-s-d is simple enough, though it ends up buggy and has a few obvious security repercussions. Though anyone of a mind enough to handle that can figure out how to redirect the console output instead of running as a forced daemon.

For the standard distribution, the included start scripts should work on 90% of setups, not the remaining 10%. Otherwise you'll just end up plagued with the same simple setup questions over and over. A traditional style shell script should be used as standard, with setup-specific scripts perhaps available as alternatives.

Re: ManiaLive r2028

Posted: 01 Feb 2011, 10:25
by farfa
If you want to run ManiaLive in direct output use

Code: Select all

php bootstrapper.php
But once your session end, the program will be ended too. So you have to find a solution to run it as a background program.

Re: ManiaLive r2028

Posted: 01 Feb 2011, 12:55
by aseco
You can use the --nodaemon switch for the run script.
It's also written in the wiki: http://code.google.com/p/manialive/wiki ... rst_Launch

Re: ManiaLive r2028

Posted: 01 Feb 2011, 21:03
by oliverde8
Hi,

is it normal that onBeginChallenge we receibe the challenge information in a array ad not in a Challenge structure.
It makes it quite confusing, specially that capitals letters in the challenge structure aren't the same as the ones in the array.

And it seems that when you do $challenge = $this->connection->getChallengeInfo(fileName);
$challenge->nbCheckpoints is empty.

I may also be tired on that last one

Re: ManiaLive r2028

Posted: 01 Feb 2011, 21:17
by farfa
In fact in every DedicatedApi Callback you will receive a structure and not an object. The data are received from the server and directly send to the Callbacks.

Re: ManiaLive r2028

Posted: 01 Feb 2011, 22:49
by nocturne
farfa wrote:If you want to run ManiaLive in direct output use

Code: Select all

php bootstrapper.php
But once your session end, the program will be ended too. So you have to find a solution to run it as a background program.
aseco wrote:You can use the --nodaemon switch for the run script.
<span>It's also written in the wiki: <a class="linkclass" href="http://code.google.com/p/manialive/wiki ... </a></span>
It seems neither of you understood what I meant by my post...

Quite simply, s-s-d is a command only available to debian installs, and even then only available to the root user, which is against the standard 'protocol' of assigning a user to manage user processes to avoid having to run scripts as a root user (for many clearly obvious reasons). There's plenty of ways to run a php script as a pseudo-daemon without requiring a specific setup common to a vast minority of users -- a fact I shouldn't have to enlighten you to.

Re: ManiaLive r2028

Posted: 02 Feb 2011, 09:57
by farfa
Nocturne, you seems to be used to launch script as a pseudo-daemon, can you give us your solution. We can integrate it to the source. And it will be good for the entire community

Re: ManiaLive r2028

Posted: 02 Feb 2011, 13:49
by Slig
To start in background on linux, several possibility exist.
- 'nohup' if you just want to detach it from terminal, with stdout stored in a file.
- 'screen' if you want to also be able to "reattach" it later in another terminal
- detaching "by hand", using something like 'php xxxx.php </dev/null >/dev/null 2>&1 &'

If you want on linux to start it at boot time as a standard user, a user crontab with the '@reboot' special field string (see man 5 crontab) can be used to launch a shell script in which you put all things to start using one of the above methods. I never tried the @reboot myself btw, i just discovered it.