How to set postgres process in monit file?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to set postgres process in monit file?
# 1  
Old 02-21-2013
How to set postgres process in monit file?

Dear Friends,

I need to add the postgres process in monit file ( Debian machine ). How to add that process in monit?. If anyone know the solution for this, pls let me know.

---------- Post updated at 02:27 PM ---------- Previous update was at 12:21 PM ----------

I have found the way to add the postgres process in monit file.

Using the following steps we can add the postgres process in monit.

/etc/monit/monitrc ( Monit filename )
------------------------------
# vim /etc/monit/monitrc
set daemon 120
check process postgres
with pidfile /var/run/crond.pid1
start = "/etc/init.d/postgresql-8.3 start"
stop = "/etc/init.d/postgresql-8.3 stop"

- Whenever postgres process is down it will start the process automatically with the help of monit.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Htop process viewer - set column width

I try to enlarge the htop column's width. I've found a solution, but it seems very specific and also too difficult. Is there any simpler way to make all the characters in a column visible? (0 Replies)
Discussion started by: plaidshirtuser
0 Replies

2. Shell Programming and Scripting

Postgres in Linux

I have this 15 postgres sql queries similar to below to run in linux... Its taking a lot of time to run (3hours) . can any one plz guide me how can i reduce the time of execution execute 'insert into cc.rpt_cons_sub_ccdb_data(report_date, server_name, report_type, count) select... (3 Replies)
Discussion started by: nikhil jain
3 Replies

3. Solaris

Child killing parent process and how to set up SMF

Hello, A little background on what we are doing first. We are running several applications from a CLI, and not all of them are fully functional. They do on occasion core dump, not a problem. We are running a service that takes a screen scrape of those apps and displays them in a more user... (5 Replies)
Discussion started by: Bryan.Eidson
5 Replies

4. Red Hat

process fails if setuid bit is set

Hi, OS : Linux I have an executable (P1) owned by user say "abcd" and the setuid bit is set. And there is another executable (P2) which brings up the process (P1). When the setuid bit is set, the process P1 is failing, if the setuid bit is not set there is no issue. I was wondering if... (6 Replies)
Discussion started by: ahamed101
6 Replies

5. Solaris

Set up TTL on process

Is there a way to setup the TTL (Time To Live) on a process. We have many ssh processes that seem to just stack up. These processes do not need a static connection all the time and it might cause problems on our servers. Does anybody know how to setup the TTL on a process? (10 Replies)
Discussion started by: jastanle84
10 Replies

6. AIX

monit similar in AIX

Hi Do you know if there is a similar tool like monit in AIX's packages? thanks Regards Israel. (1 Reply)
Discussion started by: iga3725
1 Replies

7. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

8. Shell Programming and Scripting

How to get and process mysql result set in shell script

Hi All, I am in a problem here is the description, Actually in my shell script i am firing a mysql query which returns multiple records and i have to process each record one by one. So could any one please suggest me how to solve my problem? Thanks in Advance Ashok Sharma (4 Replies)
Discussion started by: ashok1979
4 Replies

9. AIX

3004-505 Cannot set process environment

Guys I have an AIX 5.3 box.I am getting following messages if i try to switch to any non root user. bash-3.00# su - sys 3004-505 Cannot set process environment. bash-3.00# su - daemon 3004-505 Cannot set process environment. bash-3.00# su - adm 3004-505 Cannot set process environment.... (4 Replies)
Discussion started by: ak835
4 Replies

10. UNIX for Advanced & Expert Users

login error(can not set process env.)

I have created user in AIX 4.3.3 which the member of staff group. but during login ( with su command) it gives the error "can not set process environment " but when it is member of another group -dba -which is the group for oracle database- it works properly. Pls let me know the solution. ... (5 Replies)
Discussion started by: amit
5 Replies
Login or Register to Ask a Question
selabel_db(5)						     SELinux API documentation						     selabel_db(5)

NAME
selabel_db - userspace SELinux labeling interface and configuration file format for the RDBMS objects context backend. SYNOPSIS
int selabel_lookup(struct selabel_handle *hnd, security_context_t *context, const char *object_name, int object_type); int selabel_lookup_raw(struct selabel_handle *hnd, security_context_t *context, const char *object_name, int object_type); DESCRIPTION
The DB contexts backend maps from a pair of object name and class into security contexts. It is used to find the appropriate context for database objects when relabeling a certain database. The returned context must be freed using freecon(3). selabel_lookup(3) describes the function with its return and error codes. The object_name should be a fully qualified name using the hierarchy of database objects. For example, the pg_class table in the postgres database and pg_catalog schema should be qualified as: Bpostgres.pg_catalog.pg_class The NOTES section has further information on database support for namespace hierarchies. The object_type argument should be set to one of the following values: SELABEL_DB_DATABASE The object_name argument specifies the name of a database itself, such as "postgres". SELABEL_DB_SCHEMA The object_name argument specifies the name of a schema object, such as "postgres.public". SELABEL_DB_TABLE The object_name argument specifies the name of a table object, such as "postgres.public.my_table" SELABEL_DB_COLUMN The object_name argument specifies the name of a column object, such as "postgres.public.my_table.user_id" SELABEL_DB_TUPLE The object_name argument specifies the name of a table object which contains the tuples to be relabeled, such as "post- gresql.public.my_table". Note that we have no way to identify individual tuple objects, except for WHERE clause on DML state- ments, because it has no name. SELABEL_DB_PROCEDURE The object_name argument specifies the name of a procedure object, such as "postgres.public.my_func". Note that we don't sup- port lookup of individual security contexts for procedures which have the same name but different arguments. SELABEL_DB_SEQUENCE The object_name argument specifies the name of a sequence object, such as "postgres.public.my_seq". SELABEL_DB_BLOB The object_name argument specifies the name of a large object, such as "postgres.16308". Note that a large object does not have a name, so it is identified by its identifier value. SELABEL_DB_VIEW The object_name argument specifies the name of a view object, such as "postgres.public.my_view". SELABEL_DB_LANGUAGE The object_name argument specifies the name of a language object, such as "postgres.public.tcl". Any messages generated by selabel_lookup are sent to stderr by default, although this can be changed by selinux_set_callback(3). selabel_lookup_raw behaves identically to selabel_lookup but does not perform context translation. The FILES section details the configuration files used to determine the database object context. OPTIONS
In addition to the global options described in selabel_open(3), this backend recognizes the following options: SELABEL_OPT_PATH A non-null value for this option specifies a path to a file that will be opened in lieu of the standard DB contexts file. It tries to open the specfile designed for SE-PostgreSQL as default, so if another RDBMS uses this interface, it needs to give an explicit specfile designed for that RDBMS (see the FILES section for details). FILES
The database context file used to retrieve a context depends on the SELABEL_OPT_PATH parameter passed to selabel_open(3). If NULL, then the SELABEL_OPT_PATH value will default to the active policy database contexts location (as returned by selinux_sepgsql_context_path(3)), oth- erwise the actual SELABEL_OPT_PATH value specified is used (this option must be used to support databases other than SE-PostgreSQL). The default database object contexts file is: /etc/selinux/{SELINUXTYPE}/contexts/sepgsql_context Where {SELINUXTYPE} is the entry from the selinux configuration file config (see selinux_config(5)). The entries within the database contexts file are shown in the Object Name String Values and FILE FORMAT sections. Object Name String Values The string name assigned to each object_type argument that can be present in the database contexts file are: +---------------------+--------------+ |object_type | Text Name | +---------------------+--------------+ |SELABEL_DB_DATABASE | db_database | +---------------------+--------------+ |SELABEL_DB_SCHEMA | db_schema | +---------------------+--------------+ |SELABEL_DB_VIEW | db_view | +---------------------+--------------+ |SELABEL_DB_LANGUAGE | db_language | +---------------------+--------------+ |SELABEL_DB_TABLE | db_table | +---------------------+--------------+ |SELABEL_DB_COLUMN | db_column | +---------------------+--------------+ |SELABEL_DB_TUPLE | db_tuple | +---------------------+--------------+ |SELABEL_DB_PROCEDURE | db_procedure | +---------------------+--------------+ |SELABEL_DB_SEQUENCE | db_sequence | +---------------------+--------------+ |SELABEL_DB_BLOB | db_blob | +---------------------+--------------+ FILE FORMAT
Each line within the database contexts file is as follows: object_type object_name context Where: object_type This is the string representation of the object type shown in the Object Name String Values section. object_name The key used to obtain the context based on the object_type. The entry can contain '*' for wildcard matching or '?' for substitution. Note that if the '*' is used, then be aware that the order of entries in the file is important. The '*' on its own is used to ensure a default fallback context is assigned and should be the last entry in the object_type block. context The security context that will be applied to the object. The following example is for SE-PostgreSQL: # ./contexts/sepgsql_contexts file # object_type object_name context db_database my_database system_u:object_r:sepgsql_db_t:s0 db_database * system_u:object_r:sepgsql_db_t:s0 db_schema *.* system_u:object_r:sepgsql_schema_t:s0 db_tuple row_low system_u:object_r:sepgsql_table_t:s0 db_tuple row_high system_u:object_r:sepgsql_table_t:s0:c1023 db_tuple *.*.* system_u:object_r:sepgsql_table_t:s0 NOTES
1. A suitable database contexts file needs to be written for the target RDBMS and the SELABEL_OPT_PATH option must be used in sela- bel_open(3) to load it. 2. The hierarchy of the namespace for database objects depends on the RDBMS, however the selabel* interfaces do not have any specific sup- port for a namespace hierarchy. SE-PostgreSQL has a namespace hierarchy where a database is the top level object with the schema being the next level. Under the schema object there can be other types of objects such as tables and procedures. This hierarchy is supported as follows: If a security context is required for "my_table" table in the "public" schema within the "postgres" database, then the sela- bel_lookup parameters for object_type would be SELABEL_DB_TABLE and the object_name would be "postgres.public.my_table", the security context (if available), would be returned in context. 3. If contexts are to be validated, then the global option SELABEL_OPT_VALIDATE must be set before calling selabel_open(3). If this is not set, then it is possible for an invalid context to be returned. SEE ALSO
selinux(8), selabel_open(3), selabel_lookup(3), selabel_stats(3), selabel_close(3), selinux_set_callback(3), selinux_sepgsql_con- text_path(3), freecon(3), selinux_config(5) Security Enhanced Linux 01 DEC 2011 selabel_db(5)