[{"data":1,"prerenderedAt":601},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2013\u002F12\u002F13\u002Fpuppet-service-config-for-ejabberd\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":588,"date":589,"description":213,"embedImage":588,"extension":590,"image":588,"intro":588,"meta":591,"navigation":592,"path":593,"seo":594,"series":588,"sitemap":595,"stem":596,"tags":597,"__hash__":600},"content\u002F2013\u002F12\u002F13\u002Fpuppet-service-config-for-ejabberd.md","Puppet service config for ejabberd",{"type":208,"value":209,"toc":586},"minimark",[210,214,217,265,268,271,294,297,325,328,354,357,360,406,409,450,453,568,571,579,582],[211,212,213],"p",{},"I have an issue getting a working puppet service config for ejabberd on debian.",[211,215,216],{},"The init.d script supports the following options:",[218,219,224],"pre",{"className":220,"code":221,"language":222,"meta":223,"style":223},"language-shell shiki shiki-themes github-dark","Usage: \u002Fetc\u002Finit.d\u002Fejabberd {start|stop|restart|force-reload|live}\n","shell","",[225,226,227],"code",{"__ignoreMap":223},[228,229,232,236,240,243,247,250,252,255,257,260,262],"span",{"class":230,"line":231},"line",1,[228,233,235],{"class":234},"svObZ","Usage:",[228,237,239],{"class":238},"sU2Wk"," \u002Fetc\u002Finit.d\u002Fejabberd",[228,241,242],{"class":238}," {start",[228,244,246],{"class":245},"snl16","|",[228,248,249],{"class":234},"stop",[228,251,246],{"class":245},[228,253,254],{"class":234},"restart",[228,256,246],{"class":245},[228,258,259],{"class":234},"force-reload",[228,261,246],{"class":245},[228,263,264],{"class":234},"live}\n",[211,266,267],{},"So - it has restart but not status. That means setting hasstatus to false and giving it a status command.",[211,269,270],{},"OK - let's fall back to a ps based status - we want to look for the ejabberd process (beam).",[218,272,274],{"className":220,"code":273,"language":222,"meta":223,"style":223},"ps -ef | grep beam\n",[225,275,276],{"__ignoreMap":223},[228,277,278,281,285,288,291],{"class":230,"line":231},[228,279,280],{"class":234},"ps",[228,282,284],{"class":283},"sDLfK"," -ef",[228,286,287],{"class":245}," |",[228,289,290],{"class":234}," grep",[228,292,293],{"class":238}," beam\n",[211,295,296],{},"We're not interested in the grep processes",[218,298,300],{"className":220,"code":299,"language":222,"meta":223,"style":223},"ps -ef | grep beam | grep -v grep\n",[225,301,302],{"__ignoreMap":223},[228,303,304,306,308,310,312,315,317,319,322],{"class":230,"line":231},[228,305,280],{"class":234},[228,307,284],{"class":283},[228,309,287],{"class":245},[228,311,290],{"class":234},[228,313,314],{"class":238}," beam",[228,316,287],{"class":245},[228,318,290],{"class":234},[228,320,321],{"class":283}," -v",[228,323,324],{"class":238}," grep\n",[211,326,327],{},"But we also want a return status - not output",[218,329,331],{"className":220,"code":330,"language":222,"meta":223,"style":223},"ps -ef | grep beam | grep -qv grep\n",[225,332,333],{"__ignoreMap":223},[228,334,335,337,339,341,343,345,347,349,352],{"class":230,"line":231},[228,336,280],{"class":234},[228,338,284],{"class":283},[228,340,287],{"class":245},[228,342,290],{"class":234},[228,344,314],{"class":238},[228,346,287],{"class":245},[228,348,290],{"class":234},[228,350,351],{"class":283}," -qv",[228,353,324],{"class":238},[211,355,356],{},"This should set the return status correctly.",[211,358,359],{},"In fact I can test too:",[218,361,363],{"className":220,"code":362,"language":222,"meta":223,"style":223},"$ ps -ef | grep beam | grep -qv grep\n$ echo $?\n0\n",[225,364,365,389,400],{"__ignoreMap":223},[228,366,367,370,373,375,377,379,381,383,385,387],{"class":230,"line":231},[228,368,369],{"class":234},"$",[228,371,372],{"class":238}," ps",[228,374,284],{"class":283},[228,376,287],{"class":245},[228,378,290],{"class":234},[228,380,314],{"class":238},[228,382,287],{"class":245},[228,384,290],{"class":234},[228,386,351],{"class":283},[228,388,324],{"class":238},[228,390,392,394,397],{"class":230,"line":391},2,[228,393,369],{"class":234},[228,395,396],{"class":238}," echo",[228,398,399],{"class":283}," $?\n",[228,401,403],{"class":230,"line":402},3,[228,404,405],{"class":234},"0\n",[211,407,408],{},"And if I change to grep after a non-existant process (just to test)",[218,410,412],{"className":220,"code":411,"language":222,"meta":223,"style":223},"$ ps -ef | grep beamx | grep -qv grep\n$ echo $?\n1\n",[225,413,414,437,445],{"__ignoreMap":223},[228,415,416,418,420,422,424,426,429,431,433,435],{"class":230,"line":231},[228,417,369],{"class":234},[228,419,372],{"class":238},[228,421,284],{"class":283},[228,423,287],{"class":245},[228,425,290],{"class":234},[228,427,428],{"class":238}," beamx",[228,430,287],{"class":245},[228,432,290],{"class":234},[228,434,351],{"class":283},[228,436,324],{"class":238},[228,438,439,441,443],{"class":230,"line":391},[228,440,369],{"class":234},[228,442,396],{"class":238},[228,444,399],{"class":283},[228,446,447],{"class":230,"line":402},[228,448,449],{"class":234},"1\n",[211,451,452],{},"So I created the following service definition:",[218,454,458],{"className":455,"code":456,"language":457,"meta":223,"style":223},"language-ruby shiki shiki-themes github-dark","class ejabberd::service {\n  service { 'ejabberd':\n    ensure     => running,\n    hasstatus  => false,\n    hasrestart => true,\n    status     => 'ps -ef | grep beam | grep -qv grep',\n    enable     => true,\n    require    => Class['ejabberd::config'],\n  }\n}\n","ruby",[225,459,460,472,483,491,503,514,525,535,556,562],{"__ignoreMap":223},[228,461,462,465,468],{"class":230,"line":231},[228,463,464],{"class":245},"class",[228,466,467],{"class":234}," ejabberd::service",[228,469,471],{"class":470},"s95oV"," {\n",[228,473,474,477,480],{"class":230,"line":391},[228,475,476],{"class":470},"  service { ",[228,478,479],{"class":238},"'ejabberd'",[228,481,482],{"class":470},":\n",[228,484,485,488],{"class":230,"line":402},[228,486,487],{"class":245},"    ensure",[228,489,490],{"class":470},"     => running,\n",[228,492,494,497,500],{"class":230,"line":493},4,[228,495,496],{"class":470},"    hasstatus  => ",[228,498,499],{"class":283},"false",[228,501,502],{"class":470},",\n",[228,504,506,509,512],{"class":230,"line":505},5,[228,507,508],{"class":470},"    hasrestart => ",[228,510,511],{"class":283},"true",[228,513,502],{"class":470},[228,515,517,520,523],{"class":230,"line":516},6,[228,518,519],{"class":470},"    status     => ",[228,521,522],{"class":238},"'ps -ef | grep beam | grep -qv grep'",[228,524,502],{"class":470},[228,526,528,531,533],{"class":230,"line":527},7,[228,529,530],{"class":470},"    enable     => ",[228,532,511],{"class":283},[228,534,502],{"class":470},[228,536,538,541,544,547,550,553],{"class":230,"line":537},8,[228,539,540],{"class":245},"    require",[228,542,543],{"class":470},"    => ",[228,545,546],{"class":283},"Class",[228,548,549],{"class":470},"[",[228,551,552],{"class":238},"'ejabberd::config'",[228,554,555],{"class":470},"],\n",[228,557,559],{"class":230,"line":558},9,[228,560,561],{"class":470},"  }\n",[228,563,565],{"class":230,"line":564},10,[228,566,567],{"class":470},"}\n",[211,569,570],{},"This worked to start with - but recently it suddenly started restarting the process every puppet run - here's the output from logcheck:",[218,572,577],{"className":573,"code":575,"language":576},[574],"language-text","--------------------- Puppet Begin ------------------------\n\n\nService starts:\n    ejabberd: 143 Time(s)\n\n---------------------- Puppet End -------------------------\n","text",[225,578,575],{"__ignoreMap":223},[211,580,581],{},"And I can't for the life of me see why.",[583,584,585],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}",{"title":223,"searchDepth":391,"depth":391,"links":587},[],null,"2013-12-13 09:29 +0100","md",{},true,"\u002F2013\u002F12\u002F13\u002Fpuppet-service-config-for-ejabberd",{"title":206,"description":213},{"loc":593},"2013\u002F12\u002F13\u002Fpuppet-service-config-for-ejabberd",[598,599],"puppet","ejabberd","X72WZkXH04dKM7x7kU5ZGng_dGpKzYPyUKVTwVEjed0",1775293005367]