我正在尝试为Teampeak服务器制作一个简单的暴发户脚本,但无法使其正常工作。
当我说启动initctl时,它只是执行而从未完成,甚至没有发出任何消息。停止也是如此。
为确保我没有做错任何事情,我已经复制了cron脚本并尝试运行它,但是发生的情况相同。
我在这里做错了什么?
更新:
这是我的TS3脚本:
# myservice - myservice job file
description "my service description"
author "Me <myself@i.com>"
# 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 on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Start the process
script
       emit going into TS3 dir
       chdir /home/danizmax/teamspeak3-server_linux-x86/
       emit starting TS3
       exec su -c "/home/danizmax/teamspeak3-server_linux-x86/ts3server_startscript.sh start" danizmax &
       emit done
end script
即使使用最简单的脚本,我也尝试过,但这也不起作用:
description     "regular background program processing daemon"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork
respawn
exec echo example
console output
谢谢您的帮助。
                  您可能想显示您要运行的新贵作业,以便我们对其进行调试?很难知道为什么挂不见。
                
                
                  
                    —
                    slangasek 2011年
                    
                  
                
              
                  我已经复制了cron脚本并尝试运行它,并且发生了同样的事情,只是停止并且永不返回外壳
                
                
                  
                    —
                    danizmax 2011年
                    
                  
                
              
                  我们仍然需要查看您的新贵脚本。没有它,我们将无能为力。请发布它,或向我们提供链接。
                
                
                  
                    —
                    hggdh 2011年
                    
                  
                
              
                  在没有看到脚本的情况下,我所能做的只是猜测:您的脚本是否关心它是由新贵以root用户身份运行的?根路径不同。如果您的脚本想要使用不在root的PATH中的应用程序,则必须指定完整路径。您的脚本中是否有没有返回的编?
                
                
                  
                    —
                    waltinator 2011年