我正在尝试使用Upstart来对一个脚本进行守护。 所以,我在/etc/init/下创build了一个.conf文件。 现在检查我做的conf文件 init-checkconf /etc/init/ping_me.conf 它说 ERROR: version of /sbin/init too old 我的Linux内核版本是3.19.0-20-generic 。 Upstart无法configuration服务。 因此, service ping_me start不起作用。 那么,如果init可以更新,我怎么能更新呢?
如何在CentOS 6中用自定义脚本replaceTTY。CentOS 6使用新手而不是标准的SysV init脚本,所以我很难弄清楚它是如何工作的。 通常(在SysV初始化脚本中),我将编辑/ etc / inittab,并用我的脚本replace其中一个mingetty行,如下所示: 1:2345:respawn:/root/myscript tty1 但是,与Upstart,这个文件没有相关的行,所以我不确定如何做到这一点。
新贵和supervisord之间的function是否有重叠? 我有一个java进程,我需要启动启动,并监视此过程,以确保它保持运行(尝试并重新启动它,如果它下来)。 我是否可以为这两项要求使用暴发户,还是需要同时使用暴发户和超级督察?
我已经在Amazon EC2 Ubuntu 12.04 TLS实例上设置了这个新贵脚本来执行node.js应用程序。 该脚本使用setuid和setgid。 它工作正常,而不使用setuid和setgid但是当我使用它们,如果失败,因为进程无法写入/var/log/myapp.log(这是我想用于logging的path)由于权限被拒绝的错误。 /proc/self/fd/9: 13: /proc/self/fd/9: cannot create /var/log/noommi.log: Permission denied 我使用默认用户“ubuntu”来执行脚本,这是我login到本机的同一个用户(我知道这对用户其他用户会更好)因为我看到Ubuntu用户属于adm组,这是一个组包含在/ var / log中。 通过执行ls -la (使用“ubuntu”用户),这是var / log的结果: drwxr-xr-x 11 root root 4096 Oct 15 12:05 . drwxr-xr-x 12 root root 4096 Oct 12 21:44 .. 这是脚本/etc/init/myapp.conf的内容: description "start and stop myapp" version "1.0" author "Me!" start on filesystem […]
我试图让uWSGI 在启动时在一个Vagrant盒子上运行 。 所以我用以下内容创build了/etc/init/uwsgi.conf : # simple uWSGI script description "uwsgi tiny instance" start on runlevel [2345] stop on runlevel [06] respawn exec /usr/local/bin/uwsgi –ini /vagrant/share/uwsgi.ini 如果我从控制台运行start uwsgi ,但启动时无法启动。 /var/log/syslog包含以下内容: kernel: [ 6.234112] init: uwsgi main process (1017) terminated with status 1 kernel: [ 6.234122] init: uwsgi main process ended, respawning … kernel: [ 6.586285] […]
Upstart基于事件参数提供对启动作业的支持: start on custom-event NAME=foo 这只会在发出custom-event并且参数NAME的值为foo时才开始工作。 它也提供了一系列的参数: start on custom-event QUANTITY=[12] 这只会在custom-event时开始工作参数QUANTITY值为1或2 。 我无法弄清楚如何提供一个关系运算符: start on coretemp TEMP>60 stop on coretemp TEMP<50 这里的想法是开始这个工作(真的是一个任务),当CPU核心温度变得太大。 如果新贵还不支持算术关系运算符,我不会感到惊讶。 但是,这个语法也不起作用。 start on coretemp TEMP=[60,61,62,63,…,79,80] stop on coretemp TEMP=[30,31,32,33,…,49,50] 我的基地,试图让新贵做一些它从来没有做的事情? 到目前为止,我唯一可行的解决scheme是让我的温度监控守护进程发出自定义事件: coretemp-above-60 coretemp-below-50
每当一个服务器closures时,我应该运行一个特定的脚本,以确保一些服务总是停止,而其他一些服务仍然运行。 在实践中:在同一主机上的Web服务器closures后(确保数据库处于一致状态),我应该运行一个备份脚本,拍摄MySQL数据库的快照。 我还应该确保networking可用,因为备份脚本将文件传输到另一个主机。 我试图创build一个暴发户的任务,下面的节: start on (stopped apache2 and stopping mysql and net-device-up IFACE=eth0) 但是这个脚本从来没有运行。 我需要什么节以确保脚本正确运行? 还是有可能与暴发户? 更新:我testing的操作系统是Ubuntu 11.04(natty)
我在/ opt / xyz / bin / xyz中有一个守护进程。 不幸的是,它不能把自己置于后台,在下半年内就不能这样做。 我的问题如下:进入 service xyz start 只是返回 xyz start/running, process 23484 总是,即使它立即退出退出代码1.我的configuration是这样的: $ cat /etc/init/xyz.conf description "XYZ" start on started networking stop on shutdown exec /opt/xyz/bin/xyz 其余的工作正常。 新贵认识到这个过程已经开始,停止工作也很好。 有什么build议么?
我试图创build一个新贵的脚本来启动时运行一个python脚本。 从理论上讲,这看起来很简单,但我似乎无法得到它的工作。 我正在使用我在这里find并改变的骨架脚本。 description "Used to start python script as a service" author "Me <[email protected]>" # Stanzas # # Stanzas control when and how a process is started and stopped # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn # When to start the service start on runlevel [2345] # When to stop the service stop […]
我有两个暴发户的脚本,我想第二个在第一个之后开始 这是我在第二个(迪尔/秒): start on (started runlevel [345] and dir/first) stop on (stopped dir/first or runlevel [0126]) 这两个脚本都在/ etc / init / dir /目录中。 我用这两个链接作为参考: http : //jurjenbokma.com/ApprenticesNotes/ubuntu_upstart.html和http://upstart.ubuntu.com/cookbook/ – 问题1 当我开始第一个 initctl start dir/first 第二个不启动! – 问题2 另外,我可以开始第二个 initctl start dir/second 即使第一个停止! 那么为什么这不工作?