Ezhik
Freshman
Offline
Posts: 18
|
 |
« on: December 02, 2007, 07:19:14 PM » |
|
Hello! i have a 0.4.3 Bebot runnig on mysql 5.1 under Ubuntu 7.10(UTF-8). THere is a problems with guest channel and "news" base. My org using russian language and from guest channel output is "   ". With news the same, when i'm adding nes on russian, in the table news only "  ??". What i'm doing wrong?
|
|
|
|
|
Logged
|
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #1 on: December 02, 2007, 07:23:19 PM » |
|
And also a question here... How can i start 2 bot or more in one system? added a symlink to rc3.d dir to start for 2 bots first link to script like "php StartBot.php Bot1" second link to script like "php StartBot.php Bot2". But starting only a first bot, when first bot going shutdown then starting the second bot.
|
|
|
|
|
Logged
|
|
|
|
|
Blueeagle
|
 |
« Reply #2 on: December 03, 2007, 02:41:28 AM » |
|
For the first translation issue we will need a sample text that causes the error. Preferably the text you entered, the text that is actually stored in the database and finally a screenshot of the output in AO. As for starting more than one bot you might need to add & after the command so to let the script know that this process should run in the background. The code below should probably work even tho I haven't tested it. php StartBot.php Bot1& php StartBot.php Bot2
|
|
|
|
|
Logged
|
The only problem that can't be solved by adding another wrapper is having too many wrappers.
|
|
|
|
Alreadythere
|
 |
« Reply #3 on: December 03, 2007, 08:03:19 AM » |
|
bebot is using the utf8 charset, which doesn't support cyrillic letters - it's basically an ASCII I think. Without rewriting the bot to support multi-byte charsets it won't be possible to support anything else. No clue how much would have to be changed there.
About starting several bots, go look up the tool screen, it's nice for running several bots. And I'd advise to make sure you aren't running any bot as root.
|
|
|
|
|
Logged
|
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #4 on: December 03, 2007, 11:19:04 AM » |
|
when i checked mysql tables of bot it's charset was latin1 with sweden encoding. if i'll change with MySQLAdmin charsets of all tables will this affect to "  "? or should i add some code listed in http://bebot.shadow-realm.org/index.php/topic,1094.0.html to fix that problem?
|
|
|
|
|
Logged
|
|
|
|
|
Alreadythere
|
 |
« Reply #5 on: December 03, 2007, 11:21:53 AM » |
|
I don't know what the functions in the post you linked do.
But changing the charset of your tables won't change anything, as bebot itself is enforcing utf8 in all incoming and outgoing messages.
|
|
|
|
|
Logged
|
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #6 on: December 03, 2007, 11:40:26 AM » |
|
what .php file should i find to correct bots encoding?
|
|
|
|
|
Logged
|
|
|
|
|
Alreadythere
|
 |
« Reply #7 on: December 03, 2007, 11:43:37 AM » |
|
It's in Bot.php, send_gc(), send_pgroup(), send_tell, inc_gmsg(), inc_pgmsg() and inc_tell(). Search for utf8_.
|
|
|
|
|
Logged
|
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #8 on: December 03, 2007, 11:48:19 AM » |
|
thanks, i'll watch that. will post here the result 
|
|
|
|
|
Logged
|
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #9 on: December 03, 2007, 06:14:44 PM » |
|
heh.. solved the problem. just commented strings $msg=utf8_encode($msg) and $msg=utf8_decode($msg). it solved problemwith "  ??" inguest channel.But the problem with News and Logon messages still was. I was used gui for MysqlAdmin ot watch the bd tables. The encoding of coloumns and tables was 'latin1' just changed it to 'cp1251' and terminated and started the bots. btw script like: cd /home/user/bot/ php StartBot.php bot1 & php StartBot.php bot2 & started both bots in background, but it starts from rc.local, and i think it's started with a system with a root priviegies...
|
|
|
|
|
Logged
|
|
|
|
|
Blueeagle
|
 |
« Reply #10 on: December 04, 2007, 10:46:41 AM » |
|
What you probably want is start-stop-daemon to start your bot. Edit: Your /etc/rc.local would then look something like this: start-stop-daemon --start --chuid user --exec php /home/user/bot/StartBot.php bot1 start-stop-daemon --start --chuid user --exec php /home/user/bot/StartBot.php bot2 exit 0
I have _NOT_ tested this code, but as far as I can read the man page it should be correct. You obviously have to change both (all four since you're starting two bots) instances of "user" to the actual user name starting the bot. I might also be on the wrong track here. :p
|
|
|
|
« Last Edit: December 04, 2007, 11:05:16 AM by Blueeagle »
|
Logged
|
The only problem that can't be solved by adding another wrapper is having too many wrappers.
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #11 on: December 04, 2007, 11:38:08 AM » |
|
and is it so bad to run bots from root? 
|
|
|
|
|
Logged
|
|
|
|
|
Alreadythere
|
 |
« Reply #12 on: December 04, 2007, 11:46:11 AM » |
|
Yes. In general you should only run programs as root that cannot work in any other way.
If a program running as root is exploited due to any bug it will allow full root access to your server. I don't know of any exploits for PHP and BeBot right now, but that doesn't mean that you can be sure that there is no possible exploit.
|
|
|
|
|
Logged
|
|
|
|
Ezhik
Freshman
Offline
Posts: 18
|
 |
« Reply #13 on: December 04, 2007, 02:14:40 PM » |
|
code of start should be a lil other  just tested it. 2 scripts is b1.sh and b2.sh (has 755 permissions) b1.sh: php StartBot.php Bot1 b2.sh php StartBot.php Bot2 Third script is named Bots.sh( permissions 755) #!/bin/bash cd /home/nbelenkov/bebot start-stop-daemon -S -c user -g 114 -d /home/user/bebot -x /home/user/bebot/1.sh & start-stop-daemon -S -c user -g 114 -d /home/user/bebot -x /home/user/bebot/2.sh &
hint: groups id u can see in /etc/groupsthen made a symlink to rc3.d dir like "S99Botz".
|
|
|
|
|
Logged
|
|
|
|
|