From 071b50c909b473b4d244f7ae6427c027d871b8ee Mon Sep 17 00:00:00 2001 From: Daniel Theophanes Date: Tue, 13 Jan 2015 20:33:11 -0800 Subject: [PATCH] service: for upstart use INT so go process doesn't stop before Stop handler. --- example/example | Bin 4177872 -> 4177872 bytes service_linux.go | 3 +++ 2 files changed, 3 insertions(+) diff --git a/example/example b/example/example index 9c00e5dcfafbcf9dc7d447783420c352c9362819..7ef42d017dc9271057821a1de354accfb545b0dd 100755 GIT binary patch delta 237 zcmWN=OG*L(0LNh_EwhKFmZ_;tV^%Xh%F15mW0@OQ?!%QxLm+Nk4)_C)-~qgX;5EER z;0d(<2j6PDF;?nfu!9djyX+BQpCAVua>Owq!kiExN{my^h;vSYBq=UPlOf9`CRYpV z%Ql=@+qP=qpMmR|qe1_-=bG(KcQ&!Dzp3X~n$v5|>y6&(o!aVXVd*)=_1I`lhx4MA jw5<2~pcQ@8CwAQYtO+U4+jpcCO{7(M^8Ae%l delta 226 zcmWm2IZgrr0EW>F`!0*D0>Y@k44^E6D55Q#f|i!Vf^v#4;Q}Ue0Iop7H8=`~(ORB20uRG2$e+AxVlf8E(mvBTs=MCGIFwp~^iq>U(o;86|gN znN#=IGEeU6r=8q7wkZ$tC{NOmrnJNoTiOT5?wmJ9Z@b=gq$|(zBG>E7K!)-vBN@w^ UOypfYWGbIBldr>i_q{Ct1H?I1umAu6 diff --git a/service_linux.go b/service_linux.go index 26931e7..ad7cf72 100644 --- a/service_linux.go +++ b/service_linux.go @@ -342,10 +342,13 @@ case "$1" in esac exit 0` +// The upstart script should stop with an INT or the Go runtime will terminate +// the program before the Stop handler can run. const upstartScript = `# {{.Description}} description "{{.Display}}" +kill signal INT start on filesystem or runlevel [2345] stop on runlevel [!2345]