kubuntu 解决坚果云退出后重启的问题

现象

在托盘处点击退出坚果云后, 坚果云自动重新启动, 在托盘处再次出现坚果云小图标

查看进程列表发现 “python3 /home/jianghuixin/.nutstore/dist/bin/nutstore-pydaemon.py” 命令一直都在, 没有结束

$ ps -ef | grep nutstore

猜测原因:

  1. 坚果云客户端在退出时, 会向 nutstore-pydaemon.py 进程发送 “exit” 的命令, 但这个过程失败了
  2. nutstore-pydaemon.py 进程的 watchDog 线程检测到客户端"意外"退出, 重新启动客户端

解决

坚果云的 GUI 客户端是由 java 封装编写的, 不方便修改, 可以修改 nutstore-pydaemon.py 文件中的代码, 在 JavaAppWatchDog.run 函数中禁止客户端重启(源代码文件的 381 行)

原有代码是 if restart_num > 10, 现改为 if restart_num > 1

# Tell the java client how many times it has been restarted
restart_num = self.inc_and_get_restart_num()
if restart_num > 1:
	logger.warning('We have restarted %d times, so abort it' % restart_num)
	# avoid restarting the java client again and again. The threshold should be
	# larger than the threshold of java client, which is 5 so that java client can detect the
	# problem and notify the user. This should only be triggered when java client is
	# crashed too early, e.g. the gnome/gtk environment is not ready and it can not
	# be initialized
	os._exit(-1)

首次启动 GUI 客户端时, restart_num 的值变为 1, 下一次试图启动客户端前 restart_num 的值变为 2, 由于大于 1, 进程结束

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值