- Notifications
You must be signed in to change notification settings - Fork5
Commit8f5500e
committed
Make it reasonably safe to use pg_ctl to start the postmaster from a boot-time
script.To do this, have pg_ctl pass down its parent shell's PID in an environmentvariable PG_GRANDPARENT_PID, and teach CreateLockFile() to disregard that PIDas a false match if it finds it in postmaster.pid. This allows us to copewith 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 tobe careful about how you write the initscript though.Adjust the comments in contrib/start-scripts/ to not deprecate use ofpg_ctl. Also, fix the ROTATELOGS option in the OSX script, which wasindulging in exactly the sort of unsafe coding that renders this fixpointless :-(. A pipe inside the "sudo" will probably result in morethan one postgres-owned process hanging around.1 parent0e3f0cb commit8f5500e
File tree
5 files changed
+77
-38
lines changed- contrib/start-scripts
- osx
- src
- backend/utils/init
- bin/pg_ctl
5 files changed
+77
-38
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
31 |
| - | |
32 |
| - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
| 27 | + | |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
49 |
| - | |
50 |
| - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
72 |
| - | |
73 |
| - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
88 |
| - | |
| 88 | + | |
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
107 |
| - | |
| 107 | + | |
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
|
Lines changed: 48 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
683 | 683 |
| |
684 | 684 |
| |
685 | 685 |
| |
686 |
| - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
687 | 726 |
| |
688 | 727 |
| |
689 | 728 |
| |
| |||
745 | 784 |
| |
746 | 785 |
| |
747 | 786 |
| |
748 |
| - | |
749 |
| - | |
750 |
| - | |
751 |
| - | |
752 |
| - | |
753 |
| - | |
754 |
| - | |
755 |
| - | |
756 |
| - | |
757 |
| - | |
758 |
| - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
759 | 792 |
| |
760 | 793 |
| |
761 | 794 |
| |
| |||
772 | 805 |
| |
773 | 806 |
| |
774 | 807 |
| |
775 |
| - | |
776 |
| - | |
777 |
| - | |
778 |
| - | |
779 |
| - | |
780 |
| - | |
781 | 808 |
| |
782 |
| - | |
783 |
| - | |
784 |
| - | |
785 |
| - | |
786 |
| - | |
| 809 | + | |
| 810 | + | |
787 | 811 |
| |
788 | 812 |
| |
789 | 813 |
| |
|
Lines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
672 | 672 |
| |
673 | 673 |
| |
674 | 674 |
| |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
675 | 690 |
| |
676 | 691 |
| |
677 | 692 |
| |
|
0 commit comments
Comments
(0)