I am using Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-85-generic x86_64) where I created a simple Upstart job:
# content of /etc/init/listener.conf
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /home/mk/log_listener
The script itself looks like this:
#!/bin/sh
tail -F /var/log/vsftpd.log | while read line; do
if echo "$line" | grep -q 'OK UPLOAD:'; then
curl http://some.url/
fi
done
But for some reason the job starts two processes:
$ ps jax | grep lis
1 1234 1234 1234 ? -1 Ss 0 0:00 /bin/sh /home/mk/log_listener
1234 1236 1234 1234 ? -1 S 0 0:00 /bin/sh /home/mk/log_listener
I suppose this is not a "normal" behavior? How can I find out who and why is starting the second process and how to properly call the script in my Upstart job?
ps
(ps jax | grep listener) to confirm or deny the idea that the processes are related (parent/child). – Jeff Schaller Apr 14 '16 at 16:24ps jax
command. – errata Apr 14 '16 at 16:31