From e3513381733273291ae777b89eafc1c5c16973e4 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 11 May 2015 13:51:18 +0000 Subject: [PATCH] - killed systemd --- postgresql.service | 13 ------------- postgresql.spec | 44 -------------------------------------------- postgresql.target | 2 -- postgresql@.service | 15 --------------- 4 files changed, 74 deletions(-) delete mode 100644 postgresql.service delete mode 100644 postgresql.target delete mode 100644 postgresql@.service diff --git a/postgresql.service b/postgresql.service deleted file mode 100644 index 61bb968..0000000 --- a/postgresql.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=PostgreSQL server -Wants=postgresql.target -After=postgresql.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/bin/systemctl is-active postgresql.target -ExecReload=/bin/true - -[Install] -WantedBy=multi-user.target diff --git a/postgresql.spec b/postgresql.spec index cdf4353..45a4b76 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -42,9 +42,6 @@ Source1: %{name}.init Source2: pgsql-Database-HOWTO-html.tar.gz # Source2-md5: 5b656ddf1db41965761f85204a14398e Source3: %{name}.sysconfig -Source4: %{name}@.service -Source5: %{name}.service -Source6: %{name}.target Patch0: %{name}-conf.patch Patch1: %{name}-absolute_dbpaths.patch Patch2: %{name}-ecpg-includedir.patch @@ -95,7 +92,6 @@ Requires(triggerpostun): /usr/sbin/usermod Requires: %{name}-clients >= %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} Requires: rc-scripts >= 0.4.3.0 -Requires: systemd-units >= 38 Requires: tzdata Obsoletes: postgresql-module-plpgsql Obsoletes: postgresql-module-tsearch2 @@ -822,7 +818,6 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \ $RPM_BUILD_ROOT{/var/{lib/pgsql,log},%{_pgsqldir}} \ $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \ $RPM_BUILD_ROOT%{_mandir} \ - $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system/%{name}.target.requires} \ $RPM_BUILD_ROOT/home/services/postgres install src/tutorial/*.sql $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} @@ -847,10 +842,6 @@ touch $RPM_BUILD_ROOT/var/log/pgsql install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql -install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}@.service -install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service -install %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.target - install -d howto tar zxf %{SOURCE2} -C howto @@ -941,43 +932,12 @@ fi %post /sbin/chkconfig --add postgresql %service postgresql restart "postgresql server" -if [ "$1" -eq "1" ]; then - PG_DB_CLUSTERS="" - [ -f /etc/sysconfig/postgresql ] && . /etc/sysconfig/postgresql - export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog - for pgdir in $PG_DB_CLUSTERS; do - instance="$(echo "$pgdir" | sed -e 's/^\///;s/-/\\x2d/g;s/@/\\x40/g;s/\//-/g')" - /bin/systemctl --quiet enable "postgresql@$instance.service" || : - done -fi -%systemd_post postgresql.service %preun if [ "$1" = "0" ]; then %service postgresql stop /sbin/chkconfig --del postgresql - - PG_DB_CLUSTERS="" - [ -f /etc/sysconfig/postgresql ] && . /etc/sysconfig/postgresql - export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog - for pgdir in $PG_DB_CLUSTERS; do - instance="$(echo "$pgdir" | sed -e 's/^\///;s/-/\\x2d/g;s/@/\\x40/g;s/\//-/g')" - /bin/systemctl --quiet disable "postgresql@$instance.service" || : - done fi -%systemd_preun postgresql.service - -%postun -%systemd_reload - -%triggerpostun -- %{name} < 9.3.3-2 -PG_DB_CLUSTERS="" -[ -f /etc/sysconfig/postgresql ] && . /etc/sysconfig/postgresql -for pgdir in $PG_DB_CLUSTERS; do - instance="$(echo "$pgdir" | sed -e 's/^\///;s/-/\\x2d/g;s/@/\\x40/g;s/\//-/g')" - /bin/systemctl --quiet enable "postgresql@$instance.service" || : -done -%systemd_trigger postgresql.service %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig @@ -990,10 +950,6 @@ done %doc COPYRIGHT README HISTORY doc/{bug.template,KNOWN_BUGS,MISSING_FEATURES,TODO} %attr(754,root,root) /etc/rc.d/init.d/postgresql %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postgresql -%{systemdunitdir}/%{name}.service -%{systemdunitdir}/%{name}@.service -%{systemdunitdir}/%{name}.target -%dir /etc/systemd/system/%{name}.target.requires %attr(755,root,root) %{_bindir}/initdb %attr(755,root,root) %{_bindir}/pg_basebackup diff --git a/postgresql.target b/postgresql.target deleted file mode 100644 index e8c6d17..0000000 --- a/postgresql.target +++ /dev/null @@ -1,2 +0,0 @@ -[Unit] -Description=PostgreSQL server instances diff --git a/postgresql@.service b/postgresql@.service deleted file mode 100644 index 4eb4761..0000000 --- a/postgresql@.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=PostgreSQL database server at %f -PartOf=postgresql.target postgresql.service -ReloadPropagatedFrom=postgresql.service - -[Service] -Type=forking -User=postgres -ExecStart=/usr/bin/pg_ctl -D %f start -w -s -ExecStop=/usr/bin/pg_ctl -D %f stop -w -s -m fast -ExecReload=/usr/bin/pg_ctl -D %f reload -w -s -PIDFile=%f/postmaster.pid - -[Install] -RequiredBy=postgresql.target -- 2.46.0