You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[question] How to write proper upstart script for watchman #8
I am using ubuntu 12.10, and tried to create upstart script for watchman but the status is always stop although it is running.
Here is my current upstart watchman.conf
description "Watchman service"
start on started beanstalkd
stop on runlevel [!2345]
respawn
respawn limit 5 2
script
exec sudo -u root /var/bi/bin/watchman watch /var/bi/var/dbf & /var/bi/bin/watchman -- trigger /var/bi/var/dbf importPr "*.DBF""*.dbf" -- /var/bi/bicmd importPr
end script
You shouldn't need to do this. Watchman will detach and put itself in the background when it starts up.
If you need to run it under a supervisor, you should probably use the --foreground option.
Note that the watchman model is one service per user. Launching a root-owned watchman on startup will only benefit the root user.
@wez Thanks for your helpful response. --foreground works! In my system watches are reseted on system startup. But ----statefile can fix that. Now my upstart config is like this and it worked.
description "Watchman service"
start on started beanstalkd
stop on stopping beanstalkd
script
exec sudo -u root /var/bi/bin/watchman --statefile=/var/bi/.watchman.root.state --logfile=/var/bi/var/log/watchman.log --foreground
end script
Activity
wez commentedon Jun 11, 2013
You shouldn't need to do this. Watchman will detach and put itself in the background when it starts up.
If you need to run it under a supervisor, you should probably use the
--foregroundoption.Note that the watchman model is one service per user. Launching a root-owned watchman on startup will only benefit the root user.
We use https://bitbucket.org/wez/gimli to maintain and supervise our watchman processes per user. You can enable this at compile time if you run
./configure --with-gimliwez commentedon Jun 11, 2013
just scrolled right to read what you're running.
Watches are persistent, so you should probably do:
once to set it up, then have your upstart script be something like:
jeffreycahyono commentedon Jun 12, 2013
@wez Thanks for your helpful response. --foreground works! In my system watches are reseted on system startup. But ----statefile can fix that. Now my upstart config is like this and it worked.
tests/integration/modified.php
watchman: avoid recursive case during age out
avoid a deadlock in the idle watch reaper
change logging in exit handlers to not avoid locking