Page 1 of 1

Migration application from init.d to systemd - Centos 7

Posted: 2019/11/06 14:45:32
by Anasstaze
Hi everbody,

I have a question about migration from init.d to systemd.

I have a server that runs on CentOS 6 and contains an agent installation nrpe on /etc/init.d
This server migrated to CentOS 7 and I wanted to know if asimple mv of the agent files nrpe from init.d to systemd was the correct form of the migration.


Thanks and best regards

Re: Migration application from init.d to systemd - Centos 7

Posted: 2019/11/06 14:53:56
by TrevorH
It wasn't. There are nrpe packages in EPEL for CentOS/RHEL 7 that you should be using and they contain proper systemd unit files to start/stop the service.

Code: Select all

# repoquery -l nrpe.x86_64
/etc/nagios/nrpe.cfg
/etc/nrpe.d
/etc/sysconfig/nrpe
/usr/lib/systemd/system/nrpe.service
/usr/lib/tmpfiles.d/nrpe.conf
/usr/sbin/nrpe
/usr/share/doc/nrpe-3.2.1
/usr/share/doc/nrpe-3.2.1/CHANGELOG.md
/usr/share/doc/nrpe-3.2.1/LEGAL
/usr/share/doc/nrpe-3.2.1/LICENSE.md
/usr/share/doc/nrpe-3.2.1/NRPE.pdf
/usr/share/doc/nrpe-3.2.1/README.SSL.md
/usr/share/doc/nrpe-3.2.1/README.md
/usr/share/doc/nrpe-3.2.1/SECURITY.md
/var/run/nrpe

Re: Migration application from init.d to systemd - Centos 7

Posted: 2019/11/06 16:26:47
by Anasstaze
So, now having CentOS 7 running in this server. What is the appropriate way to migrate all applications like nrpe to systemd and can use systemctl to manage it ?

Thank you in advance,

Re: Migration application from init.d to systemd - Centos 7

Posted: 2019/11/06 17:18:29
by TrevorH
You do know that there is no migration path from CentOS 7 to 8? It requires a reinstall.

Re: Migration application from init.d to systemd - Centos 7

Posted: 2019/11/06 19:19:25
by jlehtone
Nor from 6 to 7.

The "migration procedure" was implied already in Trevor's first comment: you install equivalent service to 7 that you had in the 6.
Since services packaged for 7 do use systemd, there is no need to "migrate".

Do not "move" or "copy". Re-apply the idea.


If you do need to install a custom service, then you read upstream (RHEL) documentation on how to write a systemd unit.

Re: Migration application from init.d to systemd - Centos 7

Posted: 2019/11/07 14:58:05
by Errosion
jlehtone wrote:
2019/11/06 19:19:25
Nor from 6 to 7.

The "migration procedure" was implied already in Trevor's first comment: you install equivalent service to 7 that you had in the 6.
Since services packaged for 7 do use systemd, there is no need to "migrate".

Do not "move" or "copy". Re-apply the idea.

If you do need to install a custom service, then you read upstream (RHEL) documentation on how to write a systemd unit.
This.

Though from what I found for the custom scripts, unless you doing something super fancy in your init.d scripts writing the systemd equivalents is not that difficult.