Difference between pages "Package:Monit" and "Template:Ebuild"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
(initial commit)
 
 
Line 1: Line 1:
<noinclude>
This is the "Ebuild" template.
It should be called in the following format:
<pre>
{{Ebuild
{{Ebuild
|Summary=a utility for monitoring and managing daemons or similar programs running on a Unix system.
|Summary=
|CatPkg=app-admin/monit
|CatPkg=
|Maintainer=
|Maintainer=
|Homepage=
}}
}}
[http://mmonit.com/monit/ Monit] is a utility for managing and monitoring processes, programs, files, directories and filesystems on a UNIX system.
</pre>
 
Edit the page to see the template text.
== Installation ==
</noinclude><includeonly>{{#widget:AddThis}}<div class="container"><div class="row">
=== Emerge ===
<div class="col-md-3 col-md-push-9">
To install {{Package|app-admin/monit}}:
<b>[[CatPkg::{{{CatPkg|}}}]]</b>
<console>###i##emerge monit</console>
<hr>{{#vardefine:cat|{{#explode:{{{CatPkg}}}|/|0}}}}{{#vardefine:pkg|{{#explode:{{{CatPkg}}}|/|1}}}}{{#get_web_data:url=http://ports.funtoo.org/packages.xml|format=xml|use xpath|data=repo_id=/packages/category[@name='{{#var:cat}}']/package[@name='{{#var:pkg}}']/@repository}}{{#vardefine:repoid|{{#if:{{#external_value:repo_id}}|{{#external_value:repo_id}}|gentoo}}}}{{#set:RepoID={{#var:repoid}}}}
 
<table border="0" width="100%">
== Configuration ==
{{#if: {{{Maintainer|}}} |<tr><td><i>Current Maintainer(s):</i></td><td>{{#arraymaptemplate:{{{Maintainer|}}}|MaintainerDisplay|,|<br>}}</td></tr> |}}<tr><td><i>Source Repository:</i></td><td>{{#ask:[[Category:Repositories]] [[Repository ID::{{#var:repoid}}]]}}</td></tr>   {{#if: {{{Homepage|}}} |<tr><td></td><td>[[Homepage::{{{Homepage|}}}|Homepage]]</td></tr> |}}</table><hr>
Config file of monit resides in <tt>/etc/monitrc</tt>. And there is a item to specify a config directory. Uncomment if needed.
<b>Summary:</b> [[Summary::{{{Summary|}}}]]
 
{{#get_web_data:url=http://127.0.0.1:8888/portage/meta/{{{CatPkg}}}|format=xml|use xpath|data=use=/package/@use}}{{#set:Use={{#external_value:use}}}}{{#if: {{#external_value:use}}|
{{File|name=/etc/monitrc|desc=config dir|body=
== Use Flags ==
## It is possible to include additional configuration parts from other files or
{{#arraymaptemplate:{{#external_value:use}}|ExternUse|,|}}
## directories.
#
# include /etc/monit.d/*
#
}}
 
=== Users ===
Users added to the monit or users group will be able to manipulate monit through the web interface.
 
<console>###i##gpasswd -a $USER monit</console>
<console>###i##gpasswd -a $USER users</console>
 
{{fancywarning|passwords can be streamed to monits web interface, disable it all together after it is setup}}
 
{{fancyimportant|for security purposes change this entry}}
 
{{file|name=/etc/monitrc|desc=|body=
allow admin:monit}}
 
== Boot Services ==
=== inittab ===
{{fancynote|this is the preferred method to run monit}}
{{file|name=/etc/inittab|desc=auto restart monit in case of failure|body=
ca:12345:ctrlaltdel:/sbin/shutdown -r now
 
# Run monit in standard runlevels
mo:2345:respawn:/usr/bin/monit -Ic /etc/monitrc
 
# Used by /etc/init.d/xdm to control DM startup.
}}
}}
<div class="bs-head" style="text-decoration: underline; margin-bottom: 15px;">Funtoo News</div>
{{NewsList|3}}
[[News|View More News...]]


to start monit immediately after changing inittab
</div><div class="col-xs-12 col-md-9 col-md-pull-3">{{DISPLAYTITLE:{{PAGENAME}}}}
 
<div id="ebuild_header"><div id="ebuild_logo" style="padding-bottom: 1em;">[[File:ebuild.png|link=|frameless|class=img-responsive]]</div><div id="ebuild_title">
<console>###i##telinit q</console>
= {{PAGENAME}} =
 
</div></div>
=== OpenRC ===
{{#seo:
{{fancynote|prefer inittab method over rc services}}
|title=Package: {{PAGENAME}} ({{{CatPkg}}})
To start the service at boot.
|keywords={{{CatPkg}}},ebuild,gentoo,funtoo
<console>###i##rc-update add monit default</console>
|description=A Funtoo Linux ebuild for {{{CatPkg}}}: {{{Summary|}}}
To start the service immediately.
}}{{Tip|This is a wiki page. To edit it, {{CreateAccount}}. Then [[{{#special:userlogin}}|log in]] and then {{#formlink:form=Ebuild|link text=click here to edit this page|target={{FULLPAGENAME}}}}. See our [[Help:Funtoo_Editing_Guidelines|editing guidelines]] to becoming a wiki-editing pro.}}
<console>###i##/etc/init.d/monit start</console>
</includeonly>
 
==== Monitoring Monit ====
This hourly cron script will check to make sure monit has not crashed. As this uses pgrep, make sure to not name it monit.
 
{{file|name=/etc/cron.hourly/moncheck|desc=|body=
#!/bin/bash
if ! pgrep monit >/dev/null;then
rc-service monit restart
fi
}}
 
== Pidfile Check ==
Monit relies upon pid files. For daemons that do not create a pidfile: a [http://mmonit.com/wiki/Monit/FAQ#pidfile work around] is needed.
 
== Examples ==
=== Auto Restart Mysql ===
{{file|name=/etc/monitrc|desc=auto restart mysql|body=
check process mysql with pidfile /var/run/mysqld/mysqld.pid
    start program = "/bin/bash -c 'rc-service mysql start'"
    stop program  = "/bin/bash -c 'rc-service mysql stop'"
}}
 
== Web Interface ==
 
Navigate to http://localhost:2812/ & login using your edited configuration line or admin / monit if you have not changed it yet.
 
[[Category:Monitoring]]
{{EbuildFooter}}

Revision as of 17:16, January 12, 2015

This is the "Ebuild" template. It should be called in the following format:

{{Ebuild
|Summary=
|CatPkg=
|Maintainer=
|Homepage=
}}

Edit the page to see the template text.