postfix and systemctl

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

postfix and systemctl

SysAdmin EM
Hello,

I install postfix3 in Centos 7, I'm used to working with the systemctl command but I can't administer the service that way. Does anyone have an example of the configuration to work via systemctl? 

Thank you.

Regards,
Reply | Threaded
Open this post in threaded view
|

Re: postfix and systemctl

Gerald Galster
> I install postfix3 in Centos 7, I'm used to working with the systemctl command but I can't administer the service that way. Does anyone have an example of the configuration to work via systemctl?

You should check if there is a postfix service file for systemd:

[root@server ~]# rpm -ql postfix | grep service
/usr/lib/systemd/system/postfix.service


If not, create one at the given path:

[root@server ~]# cat /usr/lib/systemd/system/postfix.service
[Unit]
Description=Postfix Mail Transport Agent
After=syslog.target network.target
Conflicts=sendmail.service exim.service

[Service]
Type=forking
PIDFile=/var/spool/postfix/pid/master.pid
EnvironmentFile=-/etc/sysconfig/network
ExecStartPre=-/usr/libexec/postfix/aliasesdb
ExecStartPre=-/usr/libexec/postfix/chroot-update
ExecStart=/usr/sbin/postfix start
ExecReload=/usr/sbin/postfix reload
ExecStop=/usr/sbin/postfix stop

[Install]
WantedBy=multi-user.target



Then reload systemd and start the service:

systemctl daemon-reload
systemctl enable postfix
systemctl start postfix
systemctl status postfix

Best regards
Gerald
Reply | Threaded
Open this post in threaded view
|

Re: postfix and systemctl

Peter Ajamian
In reply to this post by SysAdmin EM
On 10/03/20 11:50 pm, Emanuel Postfix wrote:
> I install postfix3 in Centos 7, I'm used to working with the systemctl
> command but I can't administer the service that way. Does anyone have an
> example of the configuration to work via systemctl?

Where did you get postfix 3 from?  The packages at GhettoForge certainly
come with systemd unit files and work fine with the systemctl command.


Peter
Reply | Threaded
Open this post in threaded view
|

Re: postfix and systemctl

SysAdmin EM
Hi!

In the file /etc/yum.repos.d/gf.repo add this config:

cat /etc/yum.repos.d/gf.repo
[gf]
name=Ghettoforge packages that won't overwrite core distro packages.
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/$basearch/mirrorlist
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
failovermethod=priority

[gf-plus]
name=Ghettoforge packages that will overwrite core distro packages.
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/$basearch/mirrorlist
# Please read http://ghettoforge.org/index.php/Usage *before* enabling this repository!
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
failovermethod=priority
includepkgs=postfix*

[gf-testing]
name=GhettoForge packages that are currently untested.
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/testing/$basearch/mirrorlist
# This repo may contain packages that overwrite core distro packages.  Please
# read http://ghettoforge.org/index.php/Usage before enabling this repository.
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
failovermethod=priority

[gf-source]
name=Ghettoforge packages - Source
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/SRPMS/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
failovermethod=priority

[gf-plus-source]
name=Ghettoforge plus packages - Source
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/SRPMS/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
failovermethod=priority

[gf-testing-source]
name=Ghettoforge testing packages - Source
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/testing/SRPMS/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
failovermethod=priority

from console I execute the following:

yum search postfix3

yum install postfix3.x86_64

I received this error: Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7

then i execute the command:


yum install postfix3.x86_64



El mar., 10 de mar. de 2020 a la(s) 08:55, Peter ([hidden email]) escribió:
On 10/03/20 11:50 pm, Emanuel Postfix wrote:
> I install postfix3 in Centos 7, I'm used to working with the systemctl
> command but I can't administer the service that way. Does anyone have an
> example of the configuration to work via systemctl?

Where did you get postfix 3 from?  The packages at GhettoForge certainly
come with systemd unit files and work fine with the systemctl command.


Peter
Reply | Threaded
Open this post in threaded view
|

Re: postfix and systemctl

Peter Ajamian
On 11/03/20 1:10 am, Emanuel Postfix wrote:
> In the file /etc/yum.repos.d/gf.repo add this config:

Get rid of that, the gf-release package contains that file.

> from console I execute the following:

yum --nogpg install
http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm

yum --enablerepo=gf-plus install postfix3

Also see http://ghettoforge.org/index.php/Postfix3


Peter