I'm trying to start/stop rsyslog through a python script:
RSYSLOG_INIT_SCRIPT='/etc/init.s/rsyslogd'
subprocess.call([RSYSLOG_INIT_SCRIPT,'stop'])
/etc/init.d/rsyslogd is a regular init script. The problem is that it continues executing this script again and again. (I've added an echo to the script to confirm this). This is the stacktrace when i kill it:
File "queuerunner.py", line 72, in <module>
rsysloglauncher.startrsyslog()
File "/root/logging-server/Logging-server-init/src/initializer/rsyslog/rsysloglauncher.py", line 23, in startrsyslog
subprocess.call([RSYSLOG_INIT_SCRIPT,"stop"])
File "/storage/local/python-2.6.4/lib/python2.6/subprocess.py", line 470, in call
return Popen(*popenargs, **kwargs).wait()
File "/storage/local/python-2.6.4/lib/python2.6/subprocess.py", line 1157, in wait
pid, sts = os.waitpid(self.pid, 0)
Help?