我已经创建了一个类似下面的管道,请注意,我在源代码存储库中有脚本文件,即"backup_grafana.sh“和"gitPush.sh”,其中存在Jenkinsfile。但由于以下错误,我无法执行该脚本:-
/home/jenkins/workspace/grafana-backup@tmp/durable-52495dad/script.sh:
line 1: backup_grafana.sh: not found
请注意,我在pod中的kubernetes上运行jenkins master。因此,复制错误提示的脚本文件是不可能的,因为pod可能会被销毁并动态重新创建(在
我想创建使用Upstart将心跳服务( python脚本)部署为服务。
我的理解是,我必须添加一个包含以下内容的/etc/init/myheartbeatservice.conf。
# my heartbeat service
description "Heartbeat monitor"
start on startup
stop on shutdown
script
exec /path/to/my/python/script.py
end script
我的脚本启动了另一个服务进程,它监视这些进程并定期向外部服务器发送心跳。startup和shu
每当服务器关闭时,我都应该运行特定的脚本,确保某些服务总是被停止,而另一些服务,但所需的服务仍然处于运行状态。
在实践中:在关闭同一主机上的web服务器(确保数据库处于一致状态)之后,我应该运行一个备份脚本,对MySQL数据库进行快照。我还应该确保网络是可用的,因为备份脚本将文件传输到另一个主机。
我尝试创建一个upstart任务,其中包含以下章节:
start on (stopped apache2 and stopping mysql and net-device-up IFACE=eth0)
然而,这个脚本从未运行过。
我需要什么节来确保脚本的正确运行?或者,它甚至可能与暴发户?
更新:
我有一个Ubuntu12.04机器,我在其中运行我的C++应用服务器,我正在控制通过启动脚本。也就是说,每当我的应用服务器崩溃时,我的upstart脚本将自动重新启动它们,每当我的ubuntu机器重新启动/重新启动时,我的upstart脚本将再次重新启动我的应用服务器。
下面是我的新贵脚本:
start on runlevel [2345]
stop on runlevel [016]
chdir /opt/process/process_server
respawn
post-start script
echo "App server started at `date +
我正在运行Ubuntu12.04.3LTS,并安装了一些服务,如Samba、DHCP服务器、.
当我运行“立即停止”、"telinit 6“或类似命令时,我会收到以下警告:
Since the script you are attempting to invoke has been converted
to an Upstart job, you may also use the...
我可以看到,受影响的服务尝试停止/启动两次。一次通过Upstart作业,然后再通过/etc/rcN.d文件夹中的S/K符号链接,该文件夹的目标是init.d脚本。也许我可以简单地删除/etc/rcN.d
我让这个Javascript信号服务器使用nodejs运行。
但每天都会崩溃,结果整个服务都会中断。如果nodejs脚本崩溃或未运行,我将使用以下无限循环重新启动它。但它不是很好用。
有人能优化它吗?或者,如果进程突然失效,是否有更好的方法来保持a.js的启动和运行。
#!/bin/bash
while :
do
# 1
videoupload=$(pgrep -f "a.js")
if [ $videoupload ]; then
log1="running a $1 $2"
else
log1="re-launch a
我必须解决以下问题:我们有一个由bash脚本启动的Java应用程序。这个应用程序应该作为守护进程运行,所以我们有一个启动作业来启动它。
start on runlevel [2345]
stop on runlevel [!2345]
#tell upstart we will fork later, so it will mangage the pids.
expect fork
#If the daemon stoppes unexpectedly, restart it!
respawn
scri
我面临以下问题。我希望在Ubuntu11.10系统(在下面的链接:在Ubuntu上使用Upstart的Python服务中已经提到)上以服务的形式运行python脚本--我遵循了上述链接中提到的步骤,但是我在syslog中得到了以下错误消息:
init: script main process (21826) terminated with status 1
Jun 8 16:59:55 bilbo kernel: [263012.984531] init: script main process ended, respawning
Jun 8 16:59:55 bilbo kernel: [2