Skip to main content

Postfix can not start via systemd (simple fix)

Solving problem related to systemd process

I like postfix.   This is really smart and secure mail server. I'm helping above  dozen clients around the world and  tunning  postfix is really fun task. This morning I was downgrading postfix  to the stable version for one of the my friends and come across interesting issue. 

root@newserver:/etc/init.d# systemctl  status  postfix 
● postfix.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead) since вт 2017-06-13 14:35:41 EEST; 1h 48min ago
 Main PID: 25145 (code=exited, status=0/SUCCESS)

чер 13 14:47:09 newserver systemd[1]: Stopped postfix.service.
чер 13 14:47:29 newserver systemd[1]: Stopped postfix.service.
чер 13 14:58:22 newserver systemd[1]: Stopped postfix.service.
чер 13 14:58:23 newserver systemd[1]: Stopped postfix.service.
чер 13 15:05:20 newserver systemd[1]: Stopped postfix.service.
чер 13 15:29:06 newserver systemd[1]: Stopped postfix.service.
чер 13 15:29:06 newserver systemd[1]: Stopped postfix.service.
чер 13 15:32:06 newserver systemd[1]: Stopped postfix.service.
чер 13 15:32:07 newserver systemd[1]: Stopped postfix.service.
чер 13 15:35:54 newserver systemd[1]: Stopped postfix.service.
Warning: postfix.service changed on disk. Run 'systemctl daemon-reload' to reload units.

 I don't like systemd.  This service takes so much responsibility IMHO.  I'm preferring  init.d  scripts  (looks like I'm old fashion guy). If service can not start then checking startup files is correct way.
I have not seen it in default  systemd directory and  check  that other files are present  and are correct. finally detect it under /etc/default:
root@newserver:/lib/systemd/system# ls pos*
postgresql.service  postgresql@.service
root@newserver:/lib/systemd/system# cat postgresql.service 
# systemd service for managing all PostgreSQL clusters on the system. This
# service is actually a systemd target, but we are using a service since
# targets cannot be reloaded.

[Unit]
Description=PostgreSQL RDBMS

[Service]
Type=oneshot
ExecStart=/bin/true
ExecReload=/bin/true
RemainAfterExit=on

[Install]
WantedBy=multi-user.target

root@newserver:/lib/systemd/system# ls /etc/systemd/system/
clamav-daemon.socket.d/      network-online.target.wants/ sockets.target.wants/        syslog.service               
getty.target.wants/          paths.target.wants/          sshd.service                 timers.target.wants/         
multi-user.target.wants/     postfix.service              sysinit.target.wants/        


But  this file is  softlink   to /dev/null only:

root@newserver:/lib/systemd/system# ls /etc/systemd/system/postfix.service  -la
lrwxrwxrwx 1 root root 9 чер 13 14:35 /etc/systemd/system/postfix.service -> /dev/null

I've  deleted this only and reinstalled postfix for generating new one. After this postfix  is going to be green.
root@newserver:/lib/systemd/system# systemctl  daemon-reload
root@newserver:/lib/systemd/system# systemctl   status postfix
● postfix.service - LSB: Postfix Mail Transport Agent
   Loaded: loaded (/etc/init.d/postfix; bad; vendor preset: enabled)
  Drop-In: /run/systemd/generator/postfix.service.d
           └─50-postfix-$mail-transport-agent.conf
   Active: inactive (dead) since вт 2017-06-13 14:35:41 EEST; 1h 57min ago
     Docs: man:systemd-sysv-generator(8)
 Main PID: 25145 (code=exited, status=0/SUCCESS)

чер 13 14:47:09 newserver systemd[1]: Stopped postfix.service.
чер 13 14:47:29 newserver systemd[1]: Stopped postfix.service.
чер 13 14:58:22 newserver systemd[1]: Stopped postfix.service.
чер 13 14:58:23 newserver systemd[1]: Stopped postfix.service.
чер 13 15:05:20 newserver systemd[1]: Stopped postfix.service.
чер 13 15:29:06 newserver systemd[1]: Stopped postfix.service.
чер 13 15:29:06 newserver systemd[1]: Stopped postfix.service.
чер 13 15:32:06 newserver systemd[1]: Stopped postfix.service.
чер 13 15:32:07 newserver systemd[1]: Stopped postfix.service.
чер 13 15:35:54 newserver systemd[1]: Stopped postfix.service.
root@newserver:/lib/systemd/system# apt-get install  --reinstall  postfix
Зчитування переліків пакунків... Виконано
Побудова дерева залежностей                        
Зчитування інформації про стан... Виконано
оновлено 0, встановлено 0 нових, 1 перевстановлено, 0 відмічено для видалення і 8 не оновлено.
Необхідно завантажити 0 B/1 374 kB архівів.
Після цієї операції об'єм зайнятого дискового простору зросте на 0 B.
Передналаштування пакунків...
(Reading database ... 73453 files and directories currently installed.)
Preparing to unpack .../postfix_2.11.3-1+deb8u2_amd64.deb ...
Unpacking postfix (2.11.3-1+deb8u2) over (2.11.3-1+deb8u2) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for ufw (0.33-2) ...
Processing triggers for systemd (229-2) ...
Setting up postfix (2.11.3-1+deb8u2) ...

Postfix configuration was not changed.  If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed.  To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
root@newserver:/lib/systemd/system# systemctl  daemon-reload
root@newserver:/lib/systemd/system# systemctl   status postfix
● postfix.service - LSB: Postfix Mail Transport Agent
   Loaded: loaded (/etc/init.d/postfix; bad; vendor preset: enabled)
  Drop-In: /run/systemd/generator/postfix.service.d
           └─50-postfix-$mail-transport-agent.conf
   Active: active (running) since вт 2017-06-13 16:34:26 EEST; 12s ago
     Docs: man:systemd-sysv-generator(8)
 Main PID: 25145 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/postfix.service
           ├─20894 /usr/lib/postfix/master
           ├─20895 pickup -l -t unix -u -c
           └─20896 qmgr -l -t unix -u

чер 13 16:34:26 newserver systemd[1]: Starting LSB: Postfix Mail Transport Agent...
чер 13 16:34:26 newserver postfix[20782]: Starting Postfix Mail Transport Agent: postfix.
чер 13 16:34:26 newserver systemd[1]: Started LSB: Postfix Mail Transport Agent.
чер 13 16:34:26 newserver postfix/master[20894]: daemon started -- version 2.11.3, configuration /etc/postfix

Comments

Popular posts from this blog

Small script for one of the plarium game

few notes about google games. Goggle informed that access to the all games be closed after June, 30. I played "Pirates: Tides of fortune" and decided to limit my game time using small script. Detail is below. Some history First internet games were updated network games only. 15 years ago internet connection requires a lot of money and nobody had a problem with lagging of the other players. Usually games uses personal communication protocol. Warbirds, Aces High and Eve online use this way. Next part use a browser and trivial HTTP protocol. One of the popular game in this area is travian . Travian player uses browser and every browser (PC, cell phone, tablet) can be used for playing. Of course, popularity of the game is related to graphics. Trivial HTTP does not have good power in this and other technology is used for this side. One of them is Flash . Unfortunately flash requires a lot of CPU : "Pirates" was near to froze at my old celeron with ...

Update grub using dracut

Fixing grub using dracut Last kernel update was not successful to me. Centos can not boot with next messages:  [ 180.098802] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 180.610167] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 181.121619] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 181.633093] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 182.144831] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 182.656146] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 183.167306] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts [ 183.678755] dracut-initqueue[376]: Warning: dracut-initqueue timeout - starting timeout scripts  Of course simples way  is creating  linux  usb stick ...

Mac, emacs and new python3.10

Mac, emacs and new python3.10   I've deceided to upgrade my python to the new Python 3.10 and upgrade my IDE based on Emacs too.  Upgrading python to version 3.10  A installing python 3.10  is really simple task using a homebrew:  MacBook-Pro-Hohlov:call-me skhohlov$ brew search python ==> Formulae app-engine-python gst-python python-launcher python-tk@3.9 python@3.8 pythran boost-python ipython python-markdown python-yq python@3.9 ✔ jython boost-python3 micropython python-tabulate python@3.10 reorder-python-imports cython bpython ptpython python-tk@3.10 python@3.7 wxpython ==> Casks awips-python awip...