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
POSTGRES(1)						  PostgreSQL Server Applications					       POSTGRES(1)

NAME
postgres - run a PostgreSQL server in single-user mode SYNOPSIS
postgres [ -A 0 | 1 ] [ -B nbuffers ] [ -c name=value ] [ -d debug-level ] [ -D datadir ] [ -e ] [ -E ] [ -f s | i | t | n | m | h ] [ -F ] [ -i ] [ -N ] [ -o filename ] [ -O ] [ -P ] [ -s | -t pa | pl | ex ] [ -S sort-mem ] [ -W seconds ] [ --name=value ] database postgres [ -A 0 | 1 ] [ -B nbuffers ] [ -c name=value ] [ -d debug-level ] [ -D datadir ] [ -e ] [ -f s | i | t | n | m | h ] [ -F ] [ -i ] [ -o filename ] [ -O ] [ -p database ] [ -P ] [ -s | -t pa | pl | ex ] [ -S sort-mem ] [ -v protocol-version ] [ -W seconds ] [ --name=value ] DESCRIPTION
The postgres executable is the actual PostgreSQL server process that processes queries. It is normally not called directly; instead a post- master(1) multiuser server is started. The second form above is how postgres is invoked by the postmaster(1) (only conceptually, since both postmaster and postgres are in fact the same program); it should not be invoked directly this way. The first form invokes the server directly in interactive single-user mode. The primary use for this mode is during bootstrapping by initdb(1). Sometimes it is used for debugging or disaster recovery. When invoked in interactive mode from the shell, the user can enter queries and the results will be printed to the screen, but in a form that is more useful for developers than end users. But note that running a single-user backend is not truly suitable for debugging the server since no realistic interprocess communication and locking will happen. When running a stand-alone backend, the session user will be set to the user with ID 1. This user does not actually have to exist, so a stand-alone backend can be used to manually recover from certain kinds of accidental damage to the system catalogs. Implicit superuser pow- ers are granted to the user with ID 1 in stand-alone mode. OPTIONS
When postgres is started by a postmaster(1) then it inherits all options set by the latter. Additionally, postgres-specific options can be passed from the postmaster with the -o switch. You can avoid having to type these options by setting up a configuration file. See the Administrator's Guide for details. Some (safe) options can also be set from the connecting client in an application-dependent way. For example, if the environment variable PGOPTIONS is set, then libpq-based clients will pass that string to the server, which will interpret it as postgres command-line options. GENERAL PURPOSE The options -A, -B, -c, -d, -D, -F, and --name have the same meanings as the postmaster(1) except that -d 0 prevents the debugging level of the postmaster from being propagated to the backend. -e Sets the default date style to ``European'', which means that the ``day before month'' (rather than month before day) rule is used to interpret ambiguous date input, and that the day is printed before the month in certain date output formats. See the PostgreSQL User's Guide for more information. -o filename Sends all debugging and error output to filename. If the backend is running under the postmaster, this option is ignored, and the stderr inherited from the postmaster is used. -P Ignore system indexes while scanning/updating system tuples. The REINDEX command for system tables/indexes requires this option to be used. -s Print time information and other statistics at the end of each query. This is useful for benchmarking or for use in tuning the num- ber of buffers. -S sort-mem Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. The value is speci- fied in kilobytes, and defaults to 512 kilobytes. Note that for a complex query, several sorts and/or hashes might be running in parallel, and each one will be allowed to use as much as sort-mem kilobytes before it starts to put data into temporary files. OPTIONS FOR STAND-ALONE MODE database Specifies the name of the database to be accessed. If it is omitted it defaults to the user name. -E Echo all queries. -N Disables use of newline as a query delimiter. SEMI-INTERNAL OPTIONS There are several other options that may be specified, used mainly for debugging purposes. These are listed here only for the use by Post- greSQL system developers. Use of any of these options is highly discouraged. Furthermore, any of these options may disappear or change in a future release without notice. -f { s | i | m | n | h } Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, while n, m, and h dis- able nested-loop, merge and hash joins respectively. Note: Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the opti- mizer from using those plan types if it has any other alternative. -i Prevents query execution, but shows the plan tree. -O Allows the structure of system tables to be modified. This is used by initdb. -p database Indicates that this server has been started by a postmaster and makes different assumptions about buffer pool management, file descriptors, etc. -t pa[rser] | pl[anner] | e[xecutor] Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option. -v protocol Specifies the version number of the frontend/backend protocol to be used for this particular session. -W seconds As soon as this option is encountered, the process sleeps for the specified amount of seconds. This gives developers time to attach a debugger to the backend process. ENVIRONMENT
PGDATA Default data direction location For others, which have little influence during single-user mode, see postmaster(1). NOTES
To stop a running query use the SIGINT signal. To tell postgres to reread the config file, use a SIGHUP signal. The postmaster uses SIGTERM to tell a postgres process to quit normally and SIGQUIT to terminate without the normal cleanup. These should not be used by users. USAGE
Start a stand-alone backend with a command like postgres -D $PGDATA other-options my_database Provide the correct path to the database area with -D, or make sure that the environment variable PGDATA is set. Also specify the name of the particular database you want to work in. Normally, the stand-alone backend treats newline as the command entry terminator; there is no intelligence about semicolons, as there is in psql. To continue a command across multiple lines, you must type backslash just before each newline except the last one. But if you use the -N command line switch, then newline does not terminate command entry. The backend will read the standard input until the end-of-file (EOF) marker, then process the input as a single query string. Backslash-newline is not treated specially in this case. To quit the session, type EOF (Control+D, usually). If you've used -N, two consecutive EOFs are needed to exit. Note that the stand-alone backend does not provide sophisticated line-editing features (no command history, for example). SEE ALSO
initdb(1), ipcclean(1), postmaster(1) Application 2002-11-22 POSTGRES(1)