Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-01-26Remove gratuitous references to postmaster programPeter Eisentraut
"postgres" has long been officially preferred over "postmaster" as the name of the program to invoke to run the server. Some example scripts and code comments still used the latter. Change those. Discussion: https://www.postgresql.org/message-id/flat/ece84b69-8f94-8b88-925f-64207cb3a2f0@enterprisedb.com
2017-11-17Remove contrib/start-scripts/osx/.Tom Lane
Since those scripts haven't worked at all in macOS releases of 2014 and later, and aren't the recommended way to do it on any release since 2005, there seems little point carrying them into the future. It's very unlikely that anyone would be installing PG >= 11 on a macOS release where they couldn't use contrib/start-scripts/macos/. Discussion: https://postgr.es/m/31338.1510763554@sss.pgh.pa.us
2017-11-17Provide modern examples of how to auto-start Postgres on macOS.Tom Lane
The scripts in contrib/start-scripts/osx don't work at all on macOS 10.10 (Yosemite) or later, because they depend on SystemStarter which Apple deprecated long ago and removed in 10.10. Add a new subdirectory contrib/start-scripts/macos with scripts that use the newer launchd infrastructure. Since this problem is independent of which Postgres version you're using, back-patch to all supported branches. Discussion: https://postgr.es/m/31338.1510763554@sss.pgh.pa.us
2017-11-06start-scripts: switch to $PGUSER before opening $PGLOG.Noah Misch
By default, $PGUSER has permission to unlink $PGLOG. If $PGUSER replaces $PGLOG with a symbolic link, the server will corrupt the link-targeted file by appending log messages. Since these scripts open $PGLOG as root, the attack works regardless of target file ownership. "make install" does not install these scripts anywhere. Users having manually installed them in the past should repeat that process to acquire this fix. Most script users have $PGLOG writable to root only, located in $PGDATA. Just before updating one of these scripts, such users should rename $PGLOG to $PGLOG.old. The script will then recreate $PGLOG with proper ownership. Reviewed by Peter Eisentraut. Reported by Antoine Scemama. Security: CVE-2017-12172
2017-02-06Fix typos in comments.Heikki Linnakangas
Backpatch to all supported versions, where applicable, to make backpatching of future fixes go more smoothly. Josh Soref Discussion: https://www.postgresql.org/message-id/CACZqfqCf+5qRztLPgmmosr-B0Ye4srWzzw_mo4c_8_B_mtjmJQ@mail.gmail.com
2017-01-14pg_ctl: Change default to wait for all actionsPeter Eisentraut
The different actions in pg_ctl had different defaults for -w and -W, mostly for historical reasons. Most users will want the -w behavior, so make that the default. Remove the -w option in most example and test code, so avoid confusion and reduce verbosity. pg_upgrade is not touched, so it can continue to work with older installations. Reviewed-by: Beena Emerson <memissemerson@gmail.com> Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
2017-01-14Updates to reflect that pg_ctl stop -m fast is the defaultPeter Eisentraut
Various example and test code used -m fast explicitly, but since it's the default, this can be omitted now or should be replaced by a better example. pg_upgrade is not touched, so it can continue to operate with older installations.
2017-01-12Make whitespace consistent inside some script filesPeter Eisentraut
I don't know what the global standard might be, but at least adjacent code should use the same whitespace.
2015-04-26Fix typo in linux startup script.Tom Lane
Missed a "$" in what was meant to be a variable substitution. Careless mistake in commit f23425fa950fec3aff458de117037c9caadbc35c.
2014-09-09doc: Reflect renaming of Mac OS X to OS XPeter Eisentraut
bug #10528
2014-07-01Improve handling of OOM score adjustment in sample Linux start script.Tom Lane
Per a suggestion from Christoph Berg.
2014-06-19Improve our mechanism for controlling the Linux out-of-memory killer.Tom Lane
Arrange for postmaster child processes to respond to two environment variables, PG_OOM_ADJUST_FILE and PG_OOM_ADJUST_VALUE, to determine whether they reset their OOM score adjustments and if so to what. This is superior to the previous design involving #ifdef's in several ways. The behavior is now available in a default build, and both ends of the adjustment --- the original adjustment of the postmaster's level and the subsequent readjustment by child processes --- can now be controlled in one place, namely the postmaster launch script. So it's no longer necessary for the launch script to act on faith that the server was compiled with the appropriate options. In addition, if someone wants to use an OOM score other than zero for the child processes, that doesn't take a recompile anymore; and we no longer have to cater separately to the two different historical kernel APIs for this adjustment. Gurjeet Singh, somewhat revised by me
2013-09-04Remove dead URL mention in OSX startup scriptBruce Momjian
Backpatch to 9.3. Per suggestion from Gavan Schneider
2013-04-30Revert "pg_ctl: Add idempotent option"Peter Eisentraut
This reverts commit 87306184580c9c49717b00d48a2f9e717f21e0a8. The behavior in certain cases is still being debated, and it's too late to solve this before beta.
2013-04-19Don't try to pass -I switch to postmaster in contrib/start-scripts/linux.Tom Lane
Undo thinko in commit 87306184580c9c49717b00d48a2f9e717f21e0a8. Per bug #8098 from Catherine Devlin.
2013-04-14pg_ctl: Add idempotent optionPeter Eisentraut
This changes the behavior of the start and stop actions to exit successfully if the server was already started or stopped. This changes the default behavior of the start action: Before, if the server was already running, it would print a message and succeed. Now, that situation will result in an error. When running in idempotent mode, no message is printed and pg_ctl exits successfully. It was considered to just make the idempotent behavior the default and only option, but pg_upgrade needs the old behavior.
2012-06-13Support Linux's oom_score_adj API as well as the older oom_adj API.Tom Lane
The simplest way to handle this is just to copy-and-paste the relevant code block in fork_process.c, so that's what I did. (It's possible that something more complicated would be useful to packagers who want to work with either the old or the new API; but at this point the number of such people is rapidly approaching zero, so let's just get the minimal thing done.) Update relevant documentation as well.
2011-11-26Fix overly-aggressive and inconsistent quoting in OS X start script.Tom Lane
Sidar Lopez, per bug #6310, with some additional improvements by me. Back-patch to 9.0, where the issue was introduced.
2010-11-23Remove useless whitespace at end of linesPeter Eisentraut
2010-09-20Remove cvs keywords from all files.Magnus Hagander
2010-02-23Modify freebsd start script to just exit 0 with message.Bruce Momjian
2010-02-23Update startup scripts for Linux and FreeBSD.Bruce Momjian
Kevin Grittner
2010-01-11Add some simple support and documentation for using process-specific oom_adjTom Lane
settings to prevent the postmaster from being OOM-killed on Linux systems. Alex Hunsaker and Tom Lane
2009-08-27Make it reasonably safe to use pg_ctl to start the postmaster from a boot-timeTom Lane
script. To do this, have pg_ctl pass down its parent shell's PID in an environment variable PG_GRANDPARENT_PID, and teach CreateLockFile() to disregard that PID as a false match if it finds it in postmaster.pid. This allows us to cope with one level of postgres-owned shell process even with pg_ctl in the way, so it's just as safe as starting the postmaster directly. You still have to be careful about how you write the initscript though. Adjust the comments in contrib/start-scripts/ to not deprecate use of pg_ctl. Also, fix the ROTATELOGS option in the OSX script, which was indulging in exactly the sort of unsafe coding that renders this fix pointless :-(. A pipe inside the "sudo" will probably result in more than one postgres-owned process hanging around.
2008-01-16Remove inappropriate cd commands, per David Wheeler. Also makeTom Lane
the PATH responsive to the installation prefix, which was the apparent intent of the previous edit, but not well executed.
2007-05-30Add standard error redirection for OS/X & darwin startup script.Bruce Momjian
Les Hill
2007-05-30Update /contrib OS/X startup files, and move to a separate OS/XBruce Momjian
directory. Mark Cotner and David Fetter
2006-07-13Be consistent about not using ECHO_N/ECHO_C (seems unnecessary on Linux).Peter Eisentraut
2004-10-01Adjust postmaster to recognize that a lockfile containing its parent's PIDTom Lane
must be stale. Tweak example startup scripts to not use pg_ctl but launch the postmaster directly, thereby ensuring that only the postmaster's direct parent shell will be a postgres-owned process. In combination these should fix the longstanding problem of the postmaster sometimes refusing to start during reboot because it thinks the old lockfile is not stale.
2004-03-09I wanted to submit some changes to the bundled postgres startupBruce Momjian
script for Mac OS X. I added calls to utilize the bundled apache rotatelogs script in the DB startup for log rotation. Also modified startup parameters file to allow using the "SystemStarter" utility to start/stop/restart postgres with a rotating log file. The script credits David Wheeler, 2002. I wrote him a message about the changes an he suggested I post them here. I explain some of the changes below. Not sure how to submit the changes. I have 3 files, "PostgreSQL" script, "StartupParameters.plist" file, "pg_startupscript.diff" file. The diff file was run against the original "PostgreSQL" script file. I'll try attaching them to this message. If they get filtered I can resend if needed. Thanks. Ray A. ------------------------------------ 1) Changed the "Provides" parameter in StartupParameters.plist to "PostgreSQL" from "postgres database" simply for ease of typing. It seems that the SystemStarter utility uses the "Provides" value if you want to control the script. This way I did not have to enclose it in quotes on commandline. The modified StartupParameters.plist is now an XML document also. 2) For the startup script I added 2 user modifiable variables: # do you want to rotate the log files, 1=true 0=false ROTATELOGS=1 # logfile rotate in seconds ROTATESEC="604800" I also added a non modifiable variable: # The apache log rotation utility LOGUTIL="/usr/sbin/rotatelogs" I modified the StartService and RestartService functions to execute the new commands if the user wants log rotation. Ray Aspeitia
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-11-12Typo fix in comment from David WheelerBruce Momjian
2003-07-26Fix for Linux startup script.Bruce Momjian
Slawomir Sudnik
2003-06-12Add Linux restart --- Slawomir SudnikBruce Momjian
Add "-l $PGLOG" for restart --- Darko Prenosil
2002-12-09I've simplified the Darwin/Mac OS X startup script I submitted earlierBruce Momjian
in the year. This version has only the two files required by the Darwin startup bundle design. Plus the sh script now uses Darwin-standard functions to start up PostgreSQL, and it checks for the presence of a variable in /etc/hostconfig, as do other Darwin startup scripts. I suggest that a new directory be created, contrib/start-scripts/darwin, and that these two files be put into it. Folks who want to use the script can read the comments inside it to figure out how to use it. David Wheeler
2001-07-30Patch to add comments to Linux startup script.Bruce Momjian
Rene Pijlman
2001-04-19Pass -D option to pg_ctl because export PGDATA won't be preserved acrossPeter Eisentraut
'su -l'. Reported by <VASQUEZ_JASON@LILLY.COM>.
2001-02-10Add new FreeBSD start script that makes use of new pg_ctl functionality.Peter Eisentraut
2001-02-08Remove outdated contrib/linux start scripts. Beat some sense intoPeter Eisentraut
contrib/init.d start script. Place into more aptly named directory. Maybe we could add scripts for other platforms here later.