Comments (6)
杀死进程可以使用 posix_kill
函数发送信号给进程来达到目的。
大概这么用:
posix_kill($pid,$sig);
获取当前进程 pid
可以用 posix_getpid()
。
更多 进程操作函数可以搜索 posix php
自行挖掘。
1、vbot本身并没有检查是否有另一进程使用同一个session运行的功能,你需要自己判断,杀死进程可以参考上面的方法。
2、第二个问题我之前也想过,目前还没有相出很好的实现方案,不过按理说应该可以实现,这问题等 HanSon
大佬来解答吧。
from vbot.
第一个问题 我修改了下运行脚本 ,用laravel command 写的,最后一步执行的脚本有些不一样,但是原理差不多 代码如下
#!/bin/bash
if [ -f /root/.bash_profile ];
then
source /root/.bash_profile
fi
#session参数
session=$1
#目录位置
curdir=$(cd `dirname $0`; pwd)
# php位置
#phpbin=/usr/local/php7.0.14/bin/php
phpbin=/Applications/XAMPP/bin/php-7.0.13
cd $curdir
NAME="app:ini_webot --session=${session}"
ID=`ps -ef | grep "$NAME" | grep -v "grep" | awk '{print $2}'`
echo $ID
echo "---------------"
for id in $ID
do
kill -9 $id
echo "killed $id"
done
echo "---------------"
${phpbin} artisan $NAME >> ${curdir}/storage/logs/${session}.log &
@第二个问题貌似没找到更好的解决办法,感觉只能通过自动分配端口并记录的方式去做了,不知道
@Hanson 大佬有什么更好的建议么
from vbot.
这个最好解决方法就是从 vbot的底层代码修改,这个暂时没这么快
from vbot.
@Hanson 除了端口问题,可能还会碰到其他问题么,端口问题通过自动分配端口也可以解决的,应该不同端口的话相互就互不影响了吧 还有observe 里边的group.json 是做什么用的呀,这个好像也没区分不同session
from vbot.
group.json 只是个例子告诉你们可以这样用
如果在多用户场景,一个用户一个端口不太现实
from vbot.
请问如何给指定的微信群推送消息?
from vbot.
Related Issues (20)
- 请问可以通过c++程序,调用vbot给某个好友发消息么?
- 发信方的uin 获取不到 始终为0 HOT 1
- 撤回时无法取到撤回内容 HOT 2
- 已经不能用了吗?
- 拉人,踢人接口不能用了 HOT 4
- 现在微信不能登录网页版微信了 HOT 5
- 缓存设置为redis,是否需要修改一行代码 HOT 2
- 添加群好友返回信息错误
- 添加群好友返回信息错误
- 请问api接口如何发送图片?
- 我大号也登不上去,微信网页端应该要下线了 HOT 1
- 部分消息发送时会出现 Ret=3的错误
- 现在没法使用了吗? HOT 1
- 前段时间还好好的,最近两个星期每天凌晨3-5点都会程序退出,怎么不退出呢? HOT 6
- laravel5.5 使用 command 命令编写后 所有artisan命令都失效。 HOT 1
- 【研发必看!!!】做机器人,小助手,营销系统,客服系统,监管系统的可以 看下这个API方案 https://www.wkteam.cn/
- phpqrcode已经废弃了
- 推荐一个合规不封号的解决方案
- 商用方案看这里!hook 和协议都有
- 国务院对该项目的相关处理
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vbot.