Skip to content
This repository was archived by the owner on Jun 21, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .etckeeper
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mkdir -p './polkit-1/localauthority/30-site.d'
mkdir -p './polkit-1/localauthority/50-local.d'
mkdir -p './polkit-1/localauthority/90-mandatory.d'
mkdir -p './postfix/sasl'
mkdir -p './postgresql-common/pg_upgradecluster.d'
mkdir -p './security/limits.d'
mkdir -p './security/namespace.d'
mkdir -p './systemd/network'
Expand Down Expand Up @@ -107,6 +108,7 @@ maybe chmod 0644 'apt/apt.conf.d/00InstallRecommends'
maybe chmod 0644 'apt/apt.conf.d/00trustcdrom'
maybe chmod 0644 'apt/apt.conf.d/01autoremove'
maybe chmod 0644 'apt/apt.conf.d/01autoremove-kernels'
maybe chmod 0644 'apt/apt.conf.d/01autoremove-postgresql'
maybe chmod 0644 'apt/apt.conf.d/05etckeeper'
maybe chmod 0644 'apt/apt.conf.d/50unattended-upgrades'
maybe chmod 0644 'apt/apt.conf.d/70debconf'
Expand Down Expand Up @@ -606,6 +608,7 @@ maybe chmod 0755 'init.d/nscd'
maybe chmod 0755 'init.d/nslcd'
maybe chmod 0755 'init.d/oidentd'
maybe chmod 0755 'init.d/postfix'
maybe chmod 0755 'init.d/postgresql'
maybe chmod 0755 'init.d/procps'
maybe chmod 0755 'init.d/rc'
maybe chmod 0755 'init.d/rc.local'
Expand Down Expand Up @@ -747,6 +750,7 @@ maybe chmod 0755 'logrotate.d'
maybe chmod 0644 'logrotate.d/apt'
maybe chmod 0644 'logrotate.d/aptitude'
maybe chmod 0644 'logrotate.d/dpkg'
maybe chmod 0644 'logrotate.d/postgresql-common'
maybe chmod 0644 'logrotate.d/redis-server'
maybe chmod 0644 'logrotate.d/rsyslog'
maybe chmod 0644 'logrotate.d/sssd-common'
Expand Down Expand Up @@ -878,6 +882,36 @@ maybe chmod 0755 'postfix/post-install'
maybe chmod 0644 'postfix/postfix-files'
maybe chmod 0755 'postfix/postfix-script'
maybe chmod 0755 'postfix/sasl'
maybe chmod 0755 'postgresql'
maybe chmod 0755 'postgresql-common'
maybe chmod 0644 'postgresql-common/createcluster.conf'
maybe chmod 0755 'postgresql-common/pg_upgradecluster.d'
maybe chmod 0644 'postgresql-common/root.crt'
maybe chmod 0644 'postgresql-common/user_clusters'
maybe chown 'postgres' 'postgresql/9.4'
maybe chgrp 'postgres' 'postgresql/9.4'
maybe chmod 0755 'postgresql/9.4'
maybe chown 'postgres' 'postgresql/9.4/main'
maybe chgrp 'postgres' 'postgresql/9.4/main'
maybe chmod 0755 'postgresql/9.4/main'
maybe chown 'postgres' 'postgresql/9.4/main/environment'
maybe chgrp 'postgres' 'postgresql/9.4/main/environment'
maybe chmod 0644 'postgresql/9.4/main/environment'
maybe chown 'postgres' 'postgresql/9.4/main/pg_ctl.conf'
maybe chgrp 'postgres' 'postgresql/9.4/main/pg_ctl.conf'
maybe chmod 0644 'postgresql/9.4/main/pg_ctl.conf'
maybe chown 'postgres' 'postgresql/9.4/main/pg_hba.conf'
maybe chgrp 'postgres' 'postgresql/9.4/main/pg_hba.conf'
maybe chmod 0640 'postgresql/9.4/main/pg_hba.conf'
maybe chown 'postgres' 'postgresql/9.4/main/pg_ident.conf'
maybe chgrp 'postgres' 'postgresql/9.4/main/pg_ident.conf'
maybe chmod 0640 'postgresql/9.4/main/pg_ident.conf'
maybe chown 'postgres' 'postgresql/9.4/main/postgresql.conf'
maybe chgrp 'postgres' 'postgresql/9.4/main/postgresql.conf'
maybe chmod 0644 'postgresql/9.4/main/postgresql.conf'
maybe chown 'postgres' 'postgresql/9.4/main/start.conf'
maybe chgrp 'postgres' 'postgresql/9.4/main/start.conf'
maybe chmod 0644 'postgresql/9.4/main/start.conf'
maybe chmod 0755 'ppp'
maybe chmod 0755 'ppp/ip-down.d'
maybe chmod 0755 'ppp/ip-down.d/000resolvconf'
Expand Down Expand Up @@ -1081,6 +1115,7 @@ maybe chmod 0640 'sudoers.d/hashbangctl'
maybe chmod 0644 'sysctl.conf'
maybe chmod 0755 'sysctl.d'
maybe chmod 0644 'sysctl.d/10-dmsg.conf'
maybe chmod 0644 'sysctl.d/30-postgresql-shm.conf'
maybe chmod 0644 'sysctl.d/README.sysctl'
maybe chmod 0755 'sysstat'
maybe chmod 0644 'sysstat/sysstat'
Expand Down Expand Up @@ -1119,7 +1154,6 @@ maybe chmod 0644 'tudurc'
maybe chmod 0644 'ucf.conf'
maybe chmod 0755 'udev'
maybe chmod 0755 'udev/hwdb.d'
maybe chmod 0755 'udev/rules.d'
maybe chmod 0644 'udev/udev.conf'
maybe chmod 0755 'ufw'
maybe chmod 0755 'ufw/applications.d'
Expand Down
17 changes: 17 additions & 0 deletions apt/apt.conf.d/01autoremove-postgresql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// File installed by postgresql-common. Currently not updated automatically,
// but might be in future releases.
//
// We mark all PostgreSQL packages as NeverAutoRemove because otherwise apt
// would remove the old postgresql-x.y package when the "postgresql" meta
// package changes its dependencies to a new version, rendering the old
// database cluster inaccessible. As access to the cluster might depend on
// other modules (like datatypes), we use a pretty wide pattern here. We might
// tighten this to match only actually used PostgreSQL versions in the future.

APT
{
NeverAutoRemove
{
"^postgresql-";
};
};
61 changes: 61 additions & 0 deletions init.d/postgresql
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/sh
set -e

### BEGIN INIT INFO
# Provides: postgresql
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PostgreSQL RDBMS server
### END INIT INFO

# Setting environment variables for the postmaster here does not work; please
# set them in /etc/postgresql/<version>/<cluster>/environment instead.

[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0

. /usr/share/postgresql-common/init.d-functions

# versions can be specified explicitly
if [ -n "$2" ]; then
versions="$2 $3 $4 $5 $6 $7 $8 $9"
else
get_versions
fi

case "$1" in
start|stop|restart|reload)
if [ "$1" = "start" ]; then
create_socket_directory
fi
if [ -z "`pg_lsclusters -h`" ]; then
log_warning_msg 'No PostgreSQL clusters exist; see "man pg_createcluster"'
exit 0
fi
for v in $versions; do
$1 $v || EXIT=$?
done
exit ${EXIT:-0}
;;
status)
LS=`pg_lsclusters -h`
# no clusters -> unknown status
[ -n "$LS" ] || exit 4
echo "$LS" | awk 'BEGIN {rc=0} {if (match($4, "down")) rc=3; printf ("%s/%s (port %s): %s\n", $1, $2, $3, $4)}; END {exit rc}'
;;
force-reload)
for v in $versions; do
reload $v
done
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [version ..]"
exit 1
;;
esac

exit 0

10 changes: 10 additions & 0 deletions logrotate.d/postgresql-common
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/var/log/postgresql/*.log {
weekly
rotate 10
copytruncate
delaycompress
compress
notifempty
missingok
su root root
}
Loading