linux下监听redis服务,确保redis服务一停止的就立刻启动 很急 在线等!请帮忙

linux下监听redis服务,确保redis服务一停止的就立刻启动 很急 在线等!请帮忙,第1张

第一写程序

主程序,启动,fork一个进程,再exec redis程序,这样可以获取到redis的进程ID,根据进程ID,在主进程中每N秒/毫秒都行,检查对应进程ID的程序还是不是redis,如果不是,立马重启。程序写成守护进程。

第二写shell脚本,思路基本同上。区别,shell脚本,可以比对程序名称,监听时间间隔可能只能到秒级。

错误提示是没有权限,网上搜了下看到:

The Unix permissions for the hidden directory /tmp/.oracle should be:

Owner = the Oracle user who performed the database install,

Group = the dba group of the Oracle user,

and the directory's Unix permissions should be drwxrwxrwx

试试:

1) 进入/tmp目录

# cd /var/tmp(on Solaris Linux)

或者

# cd /tmp(on Hp and IBM)

2) 修改权限

# chown -R oracle10:dba .oracle

或者

# chmod 777 .oracle


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12044417.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存