Page 1 of 1

[solved] Problems with systems processes not restarting

PostPosted: May 28th, '14, 16:55
by linuxdad
I have converted a few /etc/inittab processes to the systems format (or so I thought), these processes have been working fine, until a recent issue, which I am uncertain about.

So I started to investigate two particular issues which are now part of the systems environment:

Code: Select all
systemctl --all | grep pop
poprelay-iptc.service     loaded failed   failed        POP Relay info for remote Sendmail communications.
poprelay.service          loaded failed   failed        POP Relay info for remote Sendmail communications.


So I attempted to restart the first service.

Code: Select all
systemctl start poprelay-itpc.service
Failed to issue method call: Unit poprelay-itpc.service failed to load: No such file or directory. See system logs and 'systemctl status poprelay-itpc.service' for details.

This brings me to the status:

Code: Select all
systemctl status poprelay-itpc.service
poprelay-itpc.service
     Loaded: error (Reason: No such file or directory)
     Active: inactive (dead)


Interestingly enough, I challenged the error message:

Code: Select all
find /etc -name "poprelay*" -print
/etc/systemd/system/multi-user.target.wants/poprelay-iptc.service
/etc/systemd/system/multi-user.target.wants/poprelay.service
/etc/systemd/system/poprelay-iptc.service
/etc/systemd/system/poprelay.service
/etc/mail/poprelay.conf
/etc/mail/mail/poprelay.conf


Hmm, that looks like the files are there, better check to see if I can execute the process manually:

Code: Select all
more /etc/systemd/system/multi-user.target.wants/poprelay-iptc.service
[Unit]
Description=POP Relay info for remote Sendmail communications.
 
[Service]
ExecStart=/sysadm/scripts/poprelayd-ABS-iptc.pl -dn
Restart=always
 
[Install]
WantedBy=multi-user.target


Hmm, looks like I can start this manually:

Code: Select all
 ps ax | grep -i pop
12394 pts/0    S      0:00 /usr/bin/perl /sysadm/scripts/poprelayd-ABS-iptc.pl -dn


Can anyone explain what is happening here?

Thank you.

Re: Problems with systems processes not restarting

PostPosted: May 28th, '14, 22:34
by barjac
Your unit file should be placed in /lib/systemd/system/ not in /etc
Systemd will look after the rest based on the content of the unit file.

Re: Problems with systems processes not restarting

PostPosted: May 28th, '14, 23:13
by doktor5000
barjac wrote:Your unit file should be placed in /lib/systemd/system/ not in /etc

Nope, not really. /etc is for the system administrator, /usr carries all those that come with the system, /lib is only a symlink to /usr/lib, FWIW.

Re: Problems with systems processes not restarting

PostPosted: May 29th, '14, 01:09
by barjac
Sorry, I meant /usr/lib/systemd/system/
as in:
Code: Select all
$ rpm --eval %{_unitdir}
/usr/lib/systemd/system

Re: Problems with systems processes not restarting

PostPosted: May 29th, '14, 01:59
by linuxdad
I do not understand what the difference is, or why this was working for more than three months!

So the question is, where does the poprelay-iptc.service configuration file go? (It was previously working in /etc/systemd/system for sometime.) Is is required to go to the /usr/lib/systemd/system tree? When did this change?

Re: Problems with systems processes not restarting

PostPosted: May 29th, '14, 02:05
by linuxdad
Wow, I do not understand what changed, but after copying the service definitions to /usr/lib/systemd/system, then enabling and then starting, the processes are starting again.

Thank you.

Re: [solved] Problems with systems processes not restarting

PostPosted: May 29th, '14, 12:49
by barjac
Well I am not well versed in systemd magic, however all the packages that I maintain that use unit files install them using the %{_unitdir} macro. I have never put anything related to unit files under /etc/systemd.
If you look in /etc/systemd/ all the 'files' are in fact symlinks which are (I'm guessing) created by systemd in response to the unit files in %{_unitdir} when 'systemctl --system daemon-reload' is run.
Others will no doubt be able to explain it more accurately, but I'm glad it's now working for you :)

Re: [solved] Problems with systems processes not restarting

PostPosted: May 29th, '14, 14:28
by linuxdad
Thank you again this forum has once again saved the day.