emqx关闭后删除目录失败,提示文件被占用

我在一个工程项目中,使用emqx作为mqtt服务器,制作的安装包,在卸载时,无法删除emqx的文件夹,手动删除,提示:文件被占用。。。

enter键 发泄超大号解压回车键usb电脑办公键盘程序员解压神器抖音网红Big Enter午睡枕头解压发送键创意礼物
解压神器 网红同款 一键多用 午睡枕头 | 月销量1095件
优惠价19.8元
原价¥39

淘口令:

¥aIwnX9Cg6DI¥
 

我一个一个文件手动删除,最后生下了erts\bin\epmd.exe。

从任务管理器里,却看不到epmd这个进程名。

后来搜索资料,知道了可以在“任务管理器”-“性能”-“打开资源监视器”里看到epmd.exe,在这里手动将其关闭了。

但是如何让程序自动关闭epmd.exe呢?

erlang服务器启动时,如果发现epmd尚未运行,它将自动启动epmd(Erlang端口映射器守护程序)。而erlang服务器自动启动的epmd进程,当erlang实例退出时,并不会自动将epmd也一并退出。

可以在自己的程序中调用“epmd -kill”来退出它。

相关资料:

问题标题:Is there a way to stop Erlang servers from automatically starting epmd?

问题描述:Erlang servers will automatically spawn epmd (the Erlang port mapper daemon) if it isn’t already running. I would prefer to manage epmd using systemd as a separate service. This is so that if I have multiple Erlang servers running on one host (e.g. RabbitMQ and ejabberd), epmd won’t dissapear if the server that automatically spawned epmd gets shut down. systemd will clean up any stray processes when a service gets shut down so an automatically spawned epmd won’t survive.

I can mostly handle this by making sure epmd is running as a separate service before starting any Erlang servers but I want to make extra sure that epmd is running only as a separate service.

回答:You can always just start epmd at boot time like any other daemon.

That said, epmd doesn’t actually exit when you exit the erl instance that auto-started it. You have to manually kill it as far as I know.

At least on Linux and OS X, that seems to be true.

追问/答复:I’m starting my Erlang daemons with systemd, so epmd will get killed when I shut the main daemon down. It’d be nice to prevent a daemon from ever starting up epmd to avoid any mistakes but for now starting up epmd separately before any other Erlang daemon is working for me. 

© 版权声明
THE END
喜欢就支持一下吧,技术咨询可以联系QQ407933975
点赞8
分享
评论 抢沙发