从本地 Windows 或 Mac 计算机远程重启 Linux 服务
有时我的媒体服务器不更新其数据库,修复它的唯一方法是重新启动守护程序。
我希望用户能够简单地运行可执行文件或脚本来执行此操作,而无需向他们透露任何登录信息(这可能会导致无意的头痛)。
我觉得最简单的方法是在 samba 共享上放置一个可以运行的可执行文件/脚本。用户将运行 Windows 或 Mac,它们都与服务器位于同一本地网络上。
Sometimes my media server does not update its database, the only way to fix it is to restart the daemon.
I would like users to be able to simply run an executable or script to do so without revealing any login information to them (which might result in inadvertent headaches).
I feel the easiest way to do this would be to have an executable/script located on a samba share which they can run. The users would be running Windows or Macs which are all on the same local network as the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编写一个小型 CGI 脚本或 Web 应用程序,其中有一个按钮,按下该按钮即可重新启动守护进程。
Write up a small CGI script or web app that has a button that when pushed restarts the daemon.
您只需要特权守护进程(或频繁的 cron)和 CGI 脚本之间的一些通信。让 CGI 脚本创建一个文件,如果守护程序或 cron 发现它,则重新启动服务并取消链接该文件。原始,但有效。
正如Ignacio所说,有很多很多支持CGI的轻量级HTTP服务器。
You just need some communication between a privileged daemon (or frequent cron) and the CGI script. Have the CGI script create a file, if the daemon or cron finds it have it restart the service and unlink the file. Primitive, but effective.
As Ignacio said, there are many, many lightweight HTTP servers that support CGI.