Migration application from init.d to systemd - Centos 7

General support questions
Post Reply
Anasstaze
Posts: 6
Joined: 2018/04/23 15:15:13

Migration application from init.d to systemd - Centos 7

Post by Anasstaze » 2019/11/06 14:45:32

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

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2019/11/06 14:53:56

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
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Anasstaze
Posts: 6
Joined: 2018/04/23 15:15:13

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

Post by Anasstaze » 2019/11/06 16:26:47

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,

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2019/11/06 17:18:29

You do know that there is no migration path from CentOS 7 to 8? It requires a reinstall.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

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

Post by jlehtone » 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.

User avatar
Errosion
Posts: 43
Joined: 2014/12/03 19:58:02

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

Post by Errosion » 2019/11/07 14:58:05

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.

Post Reply